500 Internal Server Error when uploading a PyPI package
Summary
I'm unable to upload certain packages to the project pypi package registry. Uploading the package results in a "500: Internal Server Error".
Steps to reproduce
I create a project on gitlab.com to illustrate this. To reproduce run following commands.
export TWINE_USERNAME=pypi
export TWINE_PASSWORD=hpGTaYCLEeeb_2Zx3tgm
export TWINE_REPOSITORY_URL=https://gitlab.com/api/v4/projects/20753229/packages/pypi
wget https://files.pythonhosted.org/packages/4e/97/494524c239e78ac45511f54f4fe64f610e4041e79a12500dc20303d9338a/lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl
twine upload lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl
Example Project
https://gitlab.com/hesstobi/pypi-issue
What is the current bug behavior?
The package is not uploaded with an 500 Error.
What is the expected correct behavior?
The package should be uploaded to the project package registry.
Relevant logs and/or screenshots
The output of the commands above running in `docker run -it --rm python:3.8 bash`
$ twine upload lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl Uploading distributions to https://gitlab.com/api/v4/projects/20753229/packages/pypi Uploading lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.98M/6.98M [00:02<00:00, 3.17MB/s] Received "500: Internal Server Error" Package upload appears to have failed. Retry 1 of 5 Uploading lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.98M/6.98M [00:02<00:00, 2.77MB/s] Received "500: Internal Server Error" Package upload appears to have failed. Retry 2 of 5 Uploading lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.98M/6.98M [00:02<00:00, 2.98MB/s] Received "500: Internal Server Error" Package upload appears to have failed. Retry 3 of 5 Uploading lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.98M/6.98M [00:02<00:00, 3.13MB/s] Received "500: Internal Server Error" Package upload appears to have failed. Retry 4 of 5 Uploading lxml-4.5.2-cp38-cp38-manylinux2014_aarch64.whl 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.98M/6.98M [00:01<00:00, 3.75MB/s] Received "500: Internal Server Error" Package upload appears to have failed. Retry 5 of 5 NOTE: Try --verbose to see response content. HTTPError: 500 Internal Server Error from https://gitlab.com/api/v4/projects/20753229/packages/pypi Internal Server Error $ twine --version twine version 3.2.0 (pkginfo: 1.5.0.1, requests: 2.24.0, setuptools: 49.3.1, requests-toolbelt: 0.9.1, tqdm: 4.48.2)
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)