Internal Server Error when attempting to download archive via API #8121

Closed
opened 2025-11-02 07:54:27 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @jotoho on GitHub (Nov 17, 2021).

Gitea Version

1.15.6

Git Version

2.30.2

Operating System

Raspberry Pi OS + Docker

How are you running Gitea?

Running official docker image (tag: 1.15-linux-arm64, id: d7e5e9d96a5d269120a579a887efeae1589afb8d92ba4c03fe61264548e9af7f) on an up-to-date version of Raspberry Pi OS (based on Debian bullseye).

TLS is handled by a Caddy reverse-proxy.

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/jotoho/e4813169969a9d0a669cd86169de14e8

Description

I was attempting to learn how to use the API to download the files in a private repository and attempted using it with a public repo first to avoid needing to provide a token.

Unfortunately when I tried to access the archive for master via /api/swagger or curl, my server threw back a "500 Internal Server Error" message.

Screenshots

No response

Originally created by @jotoho on GitHub (Nov 17, 2021). ### Gitea Version 1.15.6 ### Git Version 2.30.2 ### Operating System Raspberry Pi OS + Docker ### How are you running Gitea? Running official docker image (tag: `1.15-linux-arm64`, id: `d7e5e9d96a5d269120a579a887efeae1589afb8d92ba4c03fe61264548e9af7f`) on an up-to-date version of Raspberry Pi OS (based on Debian bullseye). TLS is handled by a Caddy reverse-proxy. ### Database MySQL ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/jotoho/e4813169969a9d0a669cd86169de14e8 ### Description I was attempting to learn how to use the API to download the files in a private repository and attempted using it with a public repo first to avoid needing to provide a token. Unfortunately when I tried to access the archive for `master` via `/api/swagger` or curl, my server threw back a "500 Internal Server Error" message. * Original repository: https://gitea.jotoho.de/jotoho/waituntil * Reproduction repository (mirror): https://try.gitea.io/jotoho/waituntil ### Screenshots _No response_
GiteaMirror added the type/bug label 2025-11-02 07:54:27 -06:00
Author
Owner

@jotoho commented on GitHub (Nov 17, 2021):

Also, please disregard that the post above says "MySQL" - it's actually MariaDB 10.5.13 running in another docker container.

@jotoho commented on GitHub (Nov 17, 2021): Also, please disregard that the post above says "MySQL" - it's actually MariaDB 10.5.13 running in another docker container.
Author
Owner

@lunny commented on GitHub (Nov 17, 2021):

You should use .../archive/master.zip if you want zip file

@lunny commented on GitHub (Nov 17, 2021): You should use .../archive/master.zip if you want zip file
Author
Owner

@jotoho commented on GitHub (Nov 17, 2021):

You should use .../archive/master.zip if you want zip file

Can you download the file from private repository non-interactively (using a script) by doing that? I presumed the API option is there to get the file without needing to access the website from a logged in browser.

@jotoho commented on GitHub (Nov 17, 2021): > You should use .../archive/master.zip if you want zip file ~~Can you download the file from private repository non-interactively (using a script) by doing that? I presumed the API option is there to get the file without needing to access the website from a logged in browser.~~
Author
Owner

@jotoho commented on GitHub (Nov 17, 2021):

Oh, you probably meant adding .zip or something to the URL in the API! I thought you meant the URL normally used to download archives from the browser.

@jotoho commented on GitHub (Nov 17, 2021): Oh, you probably meant adding `.zip` or something to the URL in the API! I thought you meant the URL normally used to download archives from the browser.
Author
Owner

@lunny commented on GitHub (Nov 17, 2021):

Yes, add the extension name .zip, .tar.gz or .bundle.

@lunny commented on GitHub (Nov 17, 2021): Yes, add the extension name `.zip`, `.tar.gz` or `.bundle`.
Author
Owner

@jotoho commented on GitHub (Nov 17, 2021):

@lunny Thanks for the advice and quick bugfix!

@jotoho commented on GitHub (Nov 17, 2021): @lunny Thanks for the advice and quick bugfix!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8121