-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Git Hooks (pre-receive) with fail check drops Gitea to 502 Error #26129
Comments
Don't 502 error comes from nginx? |
The same behaviour when connecting directly to Gitea |
@CaiCandong Initially i used gitea with nginx reverse proxy, when 502 error happened. After that i used direct connection to host and got the same behaviour as you posted. |
@CaiCandong on gitea 1.19 the same hook worked a bit different. Gitea did not show 500 error and show git remote message in log, instead gitea showed this git remote message on Gitea web-page before creating PR. And this was good solution, as i can see the reason of error and fix it. |
I've located the problem and will fix it soon |
…ea#26259) Fix go-gitea#26129 Replace go-gitea#26258 This PR will introduce a transaction on creating pull request so that if some step failed, it will rollback totally. And there will be no dirty pull request exist. --------- Co-authored-by: Giteabot <teabot@gitea.io>
Description
I have faced a situation where Git Hook drops Gitea to 502 Error.
Git Hook checks commits for some naming templates and raise error if check is not completed. All commits/PRs are blocked if check is failing.
Issue:
Gitea executes Git Hook on PR with non 0 error code. After receiving exit code 1 it drops to 502 Error
Expected behavior:
Show page with git console and error code from git. Do not drop to 502.
How to reproduce:
feature/jira-123_some_text
and push to giteafeature/jira-123_some_text
--> masterI expect, that it will show
$error_msg_branch >&2
from bash script in hook redirected to git log (How it is done on client side, if hook failes), but not prop to 502 ErrorIf i change
branch_name_format='^master|^main|^develop|^release\/RC_.*|^feature\/[a-zA-Z0-9,\.\_\-]+-[0-9]+.*|^hotfix\/.*|^bugfix\/.*'
tobranch_name_format='pull|^master|^main|^develop|^release\/RC_.*|^feature\/[a-zA-Z0-9,\.\_\-]+-[0-9]+.*|^hotfix\/.*|^bugfix\/.*' the check will not fail and PR working
Gitea Version
1.20.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
No response
Operating System
linux
How are you running Gitea?
docker
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: