PyPi Packages containing an Epoch can cause a 500 internal server error #9796

Closed
opened 2025-11-02 08:49:53 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @Racer159 on GitHub (Nov 7, 2022).

Description

Python does not fully follow semantic versioning and has an optional epoch segment (([1-9][0-9]*!)? (note the !) in front of its versions. Providing a package with a version with an epoch results in a 500 error on upload and a 500 error on subsequent requests to /admin/packages as well.

Note

: I did not actually run this on try.gitea.io because it breaks the /admin/packages route for all users (at least when tested locally and in the chart), and I wasn't able to remove it via the API. If desired I can run this against that instance though.

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/Racer159/cbe5bfb6df438cee59400695ec6ce89b

Screenshots

image
image

Git Version

2.38.0

Operating System

popOS 22.04

How are you running Gitea?

For testing locally off of the main branch, in production using the official chart version 6.0.3 (app version 1.17.3)

Database

SQLite

Originally created by @Racer159 on GitHub (Nov 7, 2022). ### Description Python does not fully follow semantic versioning and has an optional epoch segment (`([1-9][0-9]*!)?` (note the `!`) in front of its versions. Providing a package with a version with an epoch results in a 500 error on upload and a 500 error on subsequent requests to `/admin/packages` as well. > **Note**: I did not actually run this on `try.gitea.io` because it breaks the `/admin/packages` route for all users (at least when tested locally and in the chart), and I wasn't able to remove it via the API. If desired I can run this against that instance though. ### Gitea Version 1.17.3 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/Racer159/cbe5bfb6df438cee59400695ec6ce89b ### Screenshots ![image](https://user-images.githubusercontent.com/3977569/200358821-a93d51b2-0c33-408b-8fa2-398edb4f4b30.png) ![image](https://user-images.githubusercontent.com/3977569/200358902-9ea8f08c-7ae3-4746-bb5a-80d49f382317.png) ### Git Version 2.38.0 ### Operating System popOS 22.04 ### How are you running Gitea? For testing locally off of the `main` branch, in production using the official chart version 6.0.3 (app version 1.17.3) ### Database SQLite
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 08:49:54 -06:00
Author
Owner

@Racer159 commented on GitHub (Nov 7, 2022):

Linking to this as well since the test case package can be made in the same way, just substitute 2022.9.24+r159.1 for 1!2.1.0 (or similar):

https://github.com/go-gitea/gitea/issues/21683

@Racer159 commented on GitHub (Nov 7, 2022): Linking to this as well since the test case package can be made in the same way, just substitute `2022.9.24+r159.1` for `1!2.1.0` (or similar): https://github.com/go-gitea/gitea/issues/21683
Author
Owner

@lunny commented on GitHub (Nov 8, 2022):

closed by #21708

@lunny commented on GitHub (Nov 8, 2022): closed by #21708
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9796