Stalled PUT request for /repos/{owner}/{repo}/contents/{filepath} #5116

Closed
opened 2025-11-02 06:14:56 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @claudius108 on GitHub (Mar 25, 2020).

  • Gitea version (or commit ref):
  • Git version: Gitea version 1.12.0+dev-32-gdcaa5643d built with GNU Make 3.81, go1.13.5 : bindata, sqlite, sqlite_unlock_notify
  • Operating system: Ubuntu 14.04.6 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I want to update a file, and the connection looks stalled both from javascript and with CURL.
`curl -v -X PUT “path-to-host-and-file” -H “accept: application/json” -H “Content-Type: application/json” -H “Authorization: token …” -d ‘{“content”:“content in base64 format”,“message”:“Updated file uuid-74f5ca75-7022-4c7c-b5ca-7570225c7c55”,“author”:{“email”:“email”,“name”:“name”}}’ -i

Trying host…
TCP_NODELAY set
Connected to host (host) port 3000 (#0)

PUT /api/v1/repos/path-to-file HTTP/1.1
Host: host:3000
User-Agent: curl/7.58.0
accept: application/json
Content-Type: application/json
Authorization: token …
Content-Length: 6340
Expect: 100-continue

< HTTP/1.1 100 Continue
HTTP/1.1 100 Continue

We are completely uploaded and fine

`

Is there any setting for gitea I should make? Gitea is behind caddy.

Thanks,
Claudius

Originally created by @claudius108 on GitHub (Mar 25, 2020). - Gitea version (or commit ref): - Git version: Gitea version 1.12.0+dev-32-gdcaa5643d built with GNU Make 3.81, go1.13.5 : bindata, sqlite, sqlite_unlock_notify - Operating system: Ubuntu 14.04.6 LTS - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I want to update a file, and the connection looks stalled both from javascript and with CURL. `curl -v -X PUT “path-to-host-and-file” -H “accept: application/json” -H “Content-Type: application/json” -H “Authorization: token …” -d ‘{“content”:“content in base64 format”,“message”:“Updated file uuid-74f5ca75-7022-4c7c-b5ca-7570225c7c55”,“author”:{“email”:“email”,“name”:“name”}}’ -i Trying host… TCP_NODELAY set Connected to host (host) port 3000 (#0) PUT /api/v1/repos/path-to-file HTTP/1.1 Host: host:3000 User-Agent: curl/7.58.0 accept: application/json Content-Type: application/json Authorization: token … Content-Length: 6340 Expect: 100-continue < HTTP/1.1 100 Continue HTTP/1.1 100 Continue We are completely uploaded and fine ` Is there any setting for gitea I should make? Gitea is behind caddy. Thanks, Claudius
GiteaMirror added the type/question label 2025-11-02 06:14:56 -06:00
Author
Owner

@6543 commented on GitHub (Apr 6, 2020):

Hello @claudius108,

Based on your curl comand, your API call is missing the "branch" and the "sha" field both are required.

but if those are missing the api should return Status 422 or 500 (witch is a bug #10982) but not 100.

can you test the api calls without caddy?

@6543 commented on GitHub (Apr 6, 2020): Hello @claudius108, Based on your curl comand, your API call is missing the `"branch"` and the `"sha"` field both are required. but if those are missing the api should return Status 422 or 500 (witch is a bug #10982) but not 100. can you test the api calls without caddy?
Author
Owner

@claudius108 commented on GitHub (Apr 7, 2020):

Hi,

Thank you, looks like the branch was missing (I used the sha, but I did not mentioned it above). From API description I thought branch is optional:
branch (optional) to base this file from. if not given, the default branch is used

Thanks again,
Claudius

@claudius108 commented on GitHub (Apr 7, 2020): Hi, Thank you, looks like the branch was missing (I used the sha, but I did not mentioned it above). From API description I thought branch is optional: `branch (optional) to base this file from. if not given, the default branch is used` Thanks again, Claudius
Author
Owner

@6543 commented on GitHub (Apr 7, 2020):

@claudius108 thansk for the info for the wrong docuentation
I'll make it optionall if i have time to create a pull

issue: #11006

@6543 commented on GitHub (Apr 7, 2020): @claudius108 thansk for the info for the wrong docuentation I'll make it optionall if i have time to create a pull issue: #11006
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5116