Skip to content
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 when updating githooks on mirrored repositories #3696

Closed
2 of 7 tasks
johanhugg opened this issue Mar 20, 2018 · 10 comments · Fixed by #8782
Closed
2 of 7 tasks

Error 500 when updating githooks on mirrored repositories #3696

johanhugg opened this issue Mar 20, 2018 · 10 comments · Fixed by #8782
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@johanhugg
Copy link

  • Gitea version (or commit ref): 1.5.0-dev
  • Git version:
  • Operating system: Windows 10 x64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Since try.gitea.io isn't working at the time of this writing I couldn't test it. But after looking at the code the issue should exist there too.

When creating a migration, and the repository is a mirror, the code doesn't seem to create the git hook repositories that it expects to find, resulting in a file not found error. Image 1 shows a newly created repository that isn't a mirror. There we can see three folders that contain the three sample hooks that are presented in the Gitea Web GUI (Image 2). A newly created repository that is a mirror, doesn't create these folders (Image 3).

Is this intended? Is there a reason why you shouldn't be able to create git hooks for mirrored repositories?

Screenshots

Image 1

image

Image 2

image

Image 3

image

@rixx
Copy link

rixx commented Jun 18, 2018

Seconding this issue/question. I'd love to use a gitea mirror to execute git hooks on my git server host – having git hooks available would be very helpful.

@lunny lunny added the type/bug label Jun 19, 2018
@lunny
Copy link
Member

lunny commented Jun 19, 2018

@rixx any logs?

@rixx
Copy link

rixx commented Jun 19, 2018

There aren't really any logs – while the frontend shows a large "500", the logs show a 404, which happens when gitea tries to access the non-existing hook directory (usually there is a post-receive.d).

But that's not really the point – I have manually created a post-receive.d, and while I can edit the post receive hook after that, naturally, it doesn't get triggered when the mirror repository gets updated from the upstream repository.

(Motivation: It would be really cool if this was possible – this would allow to do stuff like continuous delivery from your own servers with very little effort for repositories you can't or won't move away from other platforms.)

If I can provide more help, please tell me – unfortunately the mirror update doesn't seem to log anything to the syslog on my machine, so I can't tell you if it has any issues. Mirror updates definitely happen correctly as before.

@MirisWisdom
Copy link

Can confirm that this issue appears on 1.5.2 -- both in a Docker and normal environment. Only one relevant line pops up in the log:

2018/10/16 06:07:52 [...ters/repo/setting.go:647 GitHooksEditPost()] [E] hook.Update: open /data/git/repositories/org/project.git/hooks/post-receive.d/post-receive: no such file or directory

@stale
Copy link

stale bot commented Jan 6, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 6, 2019
@rixx
Copy link

rixx commented Jan 6, 2019

Regardless, this issue still occurs.

@stale stale bot removed the issue/stale label Jan 6, 2019
@Multipixelone
Copy link

Can confirm I'm also getting this issue on Gitea version 1.5.3

@stale
Copy link

stale bot commented Mar 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Mar 18, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Mar 18, 2019
@rixx
Copy link

rixx commented Mar 18, 2019

Regardless, this issue still occurs.

@fbrinker
Copy link

Yep found out about the same error today. I wanted to start build jobs of another repository, using a mirrored repository since the webhooks can't send custom post parameters

To bad this doesn't work either :(

@lunny lunny added this to the 1.9.6 milestone Nov 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
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants