Skip to content

Error 500 when creating pull request #6460

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

Closed
2 of 7 tasks
bkodre opened this issue Mar 28, 2019 · 11 comments
Closed
2 of 7 tasks

Error 500 when creating pull request #6460

bkodre opened this issue Mar 28, 2019 · 11 comments

Comments

@bkodre
Copy link

bkodre commented Mar 28, 2019

  • Gitea version: 1.7.4
  • Git version: 2.16.2.windows.1
  • Operating system: Windows server 2012 R2
  • Database :
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

2019/03/28 13:21:58 [...routers/repo/pull.go:912 CompareAndPullRequestPost()] [E] PushToBaseRepo: Push: exit status 1 - warning: failed to restrict file handles (2)

@zeripath
Copy link
Contributor

@bkodre
Copy link
Author

bkodre commented Mar 28, 2019

Git version is 2.16.2.windows.1
I will update git to the latest version.

@bkodre
Copy link
Author

bkodre commented Mar 29, 2019

Now I have different error:

2019/03/29 09:39:15 [...routers/repo/pull.go:912 CompareAndPullRequestPost()] [E] PushToBaseRepo: Push: exit status 1 - error: cannot spawn hooks/pre-push: No such file or directory
error: waitpid for hooks/pre-push failed: No child processes

@zeripath
Copy link
Contributor

I think you need to Regenerate hooks from the admin panel on Gitea

@bkodre
Copy link
Author

bkodre commented Mar 30, 2019

I tried to regenerate hooks from command line (gitea admin regenerate hooks), but it didn't make any difference. I still get the same error.

@mrsdizzie
Copy link
Member

pre-push is a client hook: I guess for the the obvious first -- does the pre-push hook exist in this repo locally and seem OK? If so, is sh.exe in your PATH? I think on newer versions of git for windows it is in C:\Program Files\Git\bin (or something similar depending on where git has been installed)

@bkodre
Copy link
Author

bkodre commented Apr 1, 2019

pre-push file on gitea server was empty so i removed it and successfully created new pull request .
It is ok to remove pre-push file in repository on gitea server?

On my local pc pre-push file is not empty, but has this code:

#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
git lfs pre-push "$@"

@mrsdizzie
Copy link
Member

OK great, and interesting.

Gitea itself doesn't create/manage/add pre-push hooks at all, so how an empty version would end up on the server isn't clear.

You might have a global pre-push hook on the server that is empty? That would get added to any new repos created by gitea, including when doing temporary clones for various tasks. Is it possible to check that? Perhaps the server user has git-lfs installed and it generated an empty hook somehow -- though again that isn't anything gitea itself manages. I've never used Windows or git-lfs so not very helpful beyond that :( If it repeats itself, I'd bet one of the two things above is the cause.

As for the local hook, presumably you need that or don't depending on git lfs use (as it says).

@bkodre
Copy link
Author

bkodre commented Apr 1, 2019

Only this project has pre-push hook, other project are without pre-push hook. On the project without pre-push hook creating pull request is working ok.

Server has git-lfs installed, could this be a problem?

@mrsdizzie
Copy link
Member

@bkodre It wouldn't be possible for anyone here to be sure how that empty hook file got there, the above suggestions are just possibilities that you or your server/git administrator could look into if it is a reoccurring problem. In any case, it doesn't appear to be an issue with Gitea itself here but glad the particular issue with using Gitea was fixed.

@bkodre
Copy link
Author

bkodre commented Apr 2, 2019

Deleting pre-push solved issue for me so i will close this issue.

Thanks for your help.

@bkodre bkodre closed this as completed Apr 2, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants