-
I found that the root cause is the missing CGI environment variables required for git-http-backend (the CGI binary that handles Smart HTTP push/fetch) to function properly.
git-http-backendrequires three CGI environment variables to function correctly for push:QUERY_STRING— carriesservice=git-receive-pack, telling the backend which protocol to advertise oninfo/refsREQUEST_METHOD— needed for POST dispatch on the actualgit-receive-packcallCONTENT_TYPE— needed to parse the POST body during push
Go's
cgi.Handlerauto-derives many CGI vars from the incoming request, but when you provide an explicitEnvslice it can't reliably inject all three of the above. They were absent from theEnvslice inGitHTTPHandler.ServeHTTP.Without
QUERY_STRING, git-http-backend sees no service parameter oninfo/refs, produces no output, and returns an empty 200 body. Git interprets an empty Smart HTTP response as Smart HTTP being unavailable and falls back to legacy WebDAV push — which Sztabina doesn't implement — producing theno DAV locking supporterror.Fix: explicitly add
QUERY_STRING,REQUEST_METHOD, andCONTENT_TYPEto theEnvslice passed tocgi.Handler. -
I wasted 2 hours. I don't have a root cause - analysis in https://tigase.dev/sztab/~issues/140#IssueComment-131417 is wrong.
Caddy logs show that git push is not even hitting caddy!
| Type |
Bug
|
| Priority |
Major
|
| Assignee | |
| Version |
1.10.0
|
| Sprints |
n/a
|
| Customer |
n/a
|
Description
Pushing to a Sztab git repository from the command line fails with:
Component
Sztabina
Root Cause
Sztabina's
info/refs?service=git-receive-packendpoint returns HTTP 200 with an empty body instead of the proper Smart HTTP pktline advertisement. Git interprets the empty response as Smart HTTP being unavailable and falls back to WebDAV push, which Sztabina does not support.Impact
Developers cannot push to Sztab git repositories from the command line. UI-based workflows (branch creation, PR merge) are unaffected.
Workaround
None currently. Use Sztab UI for all git operations.
Steps to Reproduce