Server Error 500 when creating Pull Request on repo but works on fork or other repos hosted on the same server #13839

Closed
opened 2025-11-02 10:54:46 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @qndrm on GitHub (Dec 17, 2024).

Description

when creating a pull request for my repo i get a Server Error 500 but when i try to create a pull request for a fork of the same repo without any changes i can create a pull request

here is the log:


2024/12/17 14:37:28 ...dules/git/command.go:291:Run() [D] git.Command.RunDir(/var/lib/gitea/data/tmp/local-repo/pull.git680033388): /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-list --count --left-right base...tracking --
2024/12/17 14:37:28 ...dules/git/command.go:291:Run() [D] git.Command.RunDir(/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git): /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= push -f -- /var/lib/gitea/data/gitea-repositories/org/MY-REPO.git bugfix/test:refs/pull/6/head
2024/12/17 14:37:29 ...dules/git/command.go:345:Run() [D] slow git.Command.Run: /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= push -f -- /var/lib/gitea/data/gitea-repositories/org/MY-REPO.git bugfix/test:refs/pull/6/head (1.059424402s)
2024/12/17 14:37:29 ...ervices/pull/pull.go:546:pushToBaseRepoHelper() [E] Unable to push PR head for org/MY-REPO#6 (<Repository 7:org/MY-REPO>:refs/pull/6/head) due to Error: push failed: exit status 1 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'
 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'
 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'

2024/12/17 14:37:29 ...dules/git/command.go:291:Run() [D] git.Command.RunDir(/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git): /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= update-ref --no-deref -d refs/pull/6/head
2024/12/17 14:37:29 ...ers/web/repo/pull.go:1344:CompareAndPullRequestPost() [E] Unexpected error of NewPullRequest: *fmt.wrapError Push: org/MY-REPO:bugfix/test org/MY-REPO:refs/pull/6/head push failed: exit status 1 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'
 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'
 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'

2024/12/17 14:37:29 ...ers/web/repo/pull.go:1345:CompareAndPullRequestPost() [E] CompareAndPullRequest: Push: org/MY-REPO:bugfix/test org/MY-REPO:refs/pull/6/head push failed: exit status 1 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'
 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git'
 - batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
batch request: missing protocol: ""
error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org

Gitea Version

1.22.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.34.1

Operating System

Ubuntu 22.04.5 LTS

How are you running Gitea?

self-hosted

Database

SQLite

Originally created by @qndrm on GitHub (Dec 17, 2024). ### Description when creating a pull request for my repo i get a Server Error 500 but when i try to create a pull request for a fork of the same repo without any changes i can create a pull request here is the log: ``` 2024/12/17 14:37:28 ...dules/git/command.go:291:Run() [D] git.Command.RunDir(/var/lib/gitea/data/tmp/local-repo/pull.git680033388): /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= rev-list --count --left-right base...tracking -- 2024/12/17 14:37:28 ...dules/git/command.go:291:Run() [D] git.Command.RunDir(/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git): /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= push -f -- /var/lib/gitea/data/gitea-repositories/org/MY-REPO.git bugfix/test:refs/pull/6/head 2024/12/17 14:37:29 ...dules/git/command.go:345:Run() [D] slow git.Command.Run: /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= push -f -- /var/lib/gitea/data/gitea-repositories/org/MY-REPO.git bugfix/test:refs/pull/6/head (1.059424402s) 2024/12/17 14:37:29 ...ervices/pull/pull.go:546:pushToBaseRepoHelper() [E] Unable to push PR head for org/MY-REPO#6 (<Repository 7:org/MY-REPO>:refs/pull/6/head) due to Error: push failed: exit status 1 - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' 2024/12/17 14:37:29 ...dules/git/command.go:291:Run() [D] git.Command.RunDir(/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git): /bin/git -c protocol.version=2 -c credential.helper= -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= update-ref --no-deref -d refs/pull/6/head 2024/12/17 14:37:29 ...ers/web/repo/pull.go:1344:CompareAndPullRequestPost() [E] Unexpected error of NewPullRequest: *fmt.wrapError Push: org/MY-REPO:bugfix/test org/MY-REPO:refs/pull/6/head push failed: exit status 1 - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' 2024/12/17 14:37:29 ...ers/web/repo/pull.go:1345:CompareAndPullRequestPost() [E] CompareAndPullRequest: Push: org/MY-REPO:bugfix/test org/MY-REPO:refs/pull/6/head push failed: exit status 1 - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org/MY-REPO.git' - batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" batch request: missing protocol: "" error: failed to push some refs to '/var/lib/gitea/data/gitea-repositories/org ``` ### Gitea Version 1.22.6 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.34.1 ### Operating System Ubuntu 22.04.5 LTS ### How are you running Gitea? self-hosted ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 10:54:46 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Dec 18, 2024):

It seems to be LFS related.

TBH I have no idea, maybe you could check the git repo on the server side (especially to check the "git hooks", or remove the hooks and make Gitea to regenerate on the admin panel)

@wxiaoguang commented on GitHub (Dec 18, 2024): It seems to be LFS related. TBH I have no idea, maybe you could check the git repo on the server side (especially to check the "git hooks", or remove the hooks and make Gitea to regenerate on the admin panel)
Author
Owner

@wxiaoguang commented on GitHub (Dec 18, 2024):

Maybe related to this one:

Git LFS hooks are recreated server-side when the repository has custom hooks #31960

@wxiaoguang commented on GitHub (Dec 18, 2024): Maybe related to this one: Git LFS hooks are recreated server-side when the repository has custom hooks #31960
Author
Owner

@qndrm commented on GitHub (Dec 18, 2024):

Yes i do have a costum update git hook on the gitea repo settings and i also had pre-push,post-checkout,post-commit,post-merge when i looked into ".../MYREPO.git/hooks" on my server side.
I removed them and now it works, i don't know how they got there.

@qndrm commented on GitHub (Dec 18, 2024): Yes i do have a costum update git hook on the gitea repo settings and i also had pre-push,post-checkout,post-commit,post-merge when i looked into ".../MYREPO.git/hooks" on my server side. I removed them and now it works, i don't know how they got there.
Author
Owner

@lunny commented on GitHub (Dec 18, 2024):

Maybe because those repositions are adopted from disk.

@lunny commented on GitHub (Dec 18, 2024): Maybe because those repositions are adopted from disk.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13839