-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
error 500 on "create branch" with pre-receive hook active #10460
Comments
I've tried with 1.11.3 but unfortunately there is still the issue. I've updated the description on top. |
Could you please check your error log? There should be some error entries ([E]) related to that action that could be useful. |
Sure @guillep2k.
|
Sanitizing the error message to avoid exposing system internals is difficult and something we're still struggling to manage properly. 🙁 Maybe we could enable some kind of regexp white list for these cases? |
Ah! We're not handling the case of a remote rejected err in create branch! |
* Handle push rejections and push out-of-date in branch creation and file upload. * Remove the duplicated sanitize from services/pull/merge * Move the errors Err(Merge)PushOutOfDate and ErrPushRejected to modules/git * Handle errors better in the upload file dialogs Errors still need to be better handled in the API and the wiki but these can wait for another time. Fix go-gitea#10460 Signed-off-by: Andrew Thornton <[email protected]>
* Handle push rejections and push out-of-date in branch creation and file upload. * Remove the duplicated sanitize from services/pull/merge * Move the errors Err(Merge)PushOutOfDate and ErrPushRejected to modules/git * Handle errors better in the upload file dialogs Fix #10460 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: guillep2k <[email protected]>
I've tried with 1.12 dev-152, that merged this issue and it's OK.
Even if it in error, in the Pull Request page I found the PR number 19 opened but, is not possible to go to it because Gitea go in error 500:
It's possible to fix this collateral problem? Thanks in advance |
@mbarinc That kind of reference exists since long ago and is central to our PR system: https://github.com/go-gitea/gitea/blame/master/models/pull.go#L317 I'm afraid you'll have to update your hook to accept this kind of reference. If I'm not mistaken, users won't be able to push such references themselves anyway. |
@guillep2k thanks for the clarification, it was useful to me. |
@mbarinc You may also want to check |
[x]
):Description
I've implement the following pre-receive Git hook in order to have a standard prefix naming convention of branches: lab/* (for POC or demo) - develop/* (for any developments) - release/* (for stable feature):
This Git hook is working fine, from shell I haven't problem.
But when I create a branch from Gitea, if the prefix is not respected, Gitea retung an error 500.
It's possible to manage the error code and print the hook message instead the HTML error 500 that is bad to see?
For example, I've implement another pre-receive Git hook in order to accept only commit message with specific sintax, in this case, if the git hook is triggered, Gitea print the $msgError not a error 500.
thank in advance
The text was updated successfully, but these errors were encountered: