Pypi Repository Package Doesn't Override Packages With The Same Version

I have configured a PyPy package manager for my repository
and tried to upload the same package version with the save version more than once

When I have executed the following command:
python3 -m twine upload --repository gitlab dist/

I have received the following error:
Content received from server:
{“message”:“Validation failed: File name has already been taken”}
HTTPError: 400 Bad Request from https://gitlab.com/api/v4/projects/19660947/packages/pypi
Bad Request

In the GitLab documentation it states that the packages with the same versions are being replaced:
https://docs.gitlab.com/ee/user/packages/pypi_repository/index.html#uploading-packages

1 Like

May i ask what version u are using? I can’t get the package manger enabled on gitlab CE.
Edit: https://gitlab.com/help/user/packages/index states that we have it after release of 13.3.

Hi,

this sounds like a bug to me, especially since it responds with 400/bad request. Can you re-test this again (might be fixed since GitLab.com is a rolling release to production every day). If the issue persists, please go ahead and create a bug report. Thanks! :slight_smile:

Cheers,
Michael

2 Likes

Just happened to me. Using almost the same setting than cbdan.

You can’t do that.

When publishing packages, note that:

  • The maximum allowed size is 50 MB.
  • You can’t upload the same version of a package multiple times. If you try, you receive the error Validation failed: File name has already been taken.

Read the original doc

1 Like

I had the same issue, adding “–skip-existing” to the end of the command worked for me

That fixes the command but I do not want it to just skip existing packages. I want twine to be able to overwrite the existing package version. I think the only way to do this unfortunately is to either have a minor bump in the version (maybe based on git commit sha) or delete the package from the registry before uploading a new one