Skip to content
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

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

Closed
jotoho opened this issue Nov 17, 2021 · 6 comments · Fixed by #17691
Closed

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

jotoho opened this issue Nov 17, 2021 · 6 comments · Fixed by #17691
Labels

Comments

@jotoho
Copy link

jotoho commented 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

@jotoho
Copy link
Author

jotoho commented Nov 17, 2021

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

@lunny
Copy link
Member

lunny commented Nov 17, 2021

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

@jotoho
Copy link
Author

jotoho commented 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
Copy link
Author

jotoho commented 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.

@lunny
Copy link
Member

lunny commented Nov 17, 2021

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

@jotoho
Copy link
Author

jotoho commented Nov 17, 2021

@lunny Thanks for the advice and quick bugfix!

@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants