Skip to content

"Filename has already been used" when uploading #4985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mherrmann opened this issue Oct 31, 2018 · 4 comments
Closed

"Filename has already been used" when uploading #4985

mherrmann opened this issue Oct 31, 2018 · 4 comments

Comments

@mherrmann
Copy link

mherrmann commented Oct 31, 2018

I have a package called fbs on PyPI. Every once in a while, I get the following error while trying to upload a new version with twine:

HTTPError: 400 Client Error: This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/

The error occurs even though I have never uploaded the respective version before. To work around it, I have to use a different version number.

What's curious: The version numbers for which this happens exhibit a strange pattern. The problem has so far occurred for versions 0.2.1, 0.2.2, 0.2.3, 0.3.1, 0.3.2 and 0.3.3. Notice the pattern .1, .2, .3. But probably it's coincidence.

Out of curiosity, I tried pip install for one of the versions which PyPI claims already exist. (Eg. pip install fbs==0.3.1.) But I got

No matching distribution found for fbs==0.3.1

My suspicion is that someone else had control of this package on PyPI before me, then deleted it. This left over some "old" releases, which now conflict with my new ones. If PyPI lets you delete packages, then I believe it should also clean up any old files so future owners of that package can use it as if it were new.

I'm using twine 1.12.1 and the following commands for uploading:

python setup.py sdist
twine upload dist/fbs-x.y.z.tar.gz

twine upload --verbose dist/fbs-0.3.1.tar.gz gave:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading fbs-0.3.1.tar.gz
Content received from server:
<html>
 <head>
  <title>400 This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse</title>
 </head>
 <body>
  <h1>400 This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse
 </body>
</html>
HTTPError: 400 Client Error: This filename has already been used, use a different version. See https://pypi.org/help/#file-name-reuse for url: https://upload.pypi.org/legacy/

I'm on Ubuntu Linux 16.04 with Python 3.5.3, in case that's relevant.

Thanks!

@mherrmann
Copy link
Author

mherrmann commented Oct 31, 2018

Looks like this is related to pypa/packaging-problems/issues/74. But it's also somewhat different in that the scenario there is to re-upload after deleting a file. The present issue is likely about re-uploading after deleting the entire package.

@mherrmann
Copy link
Author

Also seems like what I'm experiencing is pypa/packaging-problems/issues/188. Except that there, the owner deleted the package himself. I seem to have unknowingly inherited a package from a previous author.

@di
Copy link
Member

di commented Oct 31, 2018

@mherrmann You are correct, the fbs project has deleted releases from a previous owner. You can see the list of all actions done to the project, including which files/versions have already been uploaded at https://pypi.org/manage/project/fbs/history/.

This is essentially a duplicate of #4440, which proposes to fix this confusion by "soft" deleting projects, releases and files, and having them persist across ownership changes. As such, I'm going to close this issue, but thanks for the report!

@di di closed this as completed Oct 31, 2018
@mherrmann
Copy link
Author

Makes sense. Thanks :-)

facebook-github-bot pushed a commit to facebook/pyre-check that referenced this issue Jul 31, 2020
Summary:
really just need a commit to buffer an open source version bump 0.0.51

Context:
pypi/warehouse#4985

Reviewed By: mrkmndz

Differential Revision: D22879537

fbshipit-source-id: 286a7275cda0658245700887a5eb686b9df4018e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants