Wiki broken after gitea migration due to old version in update hook #525

Closed
opened 2025-11-02 03:26:43 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @zxcvbn4038 on GitHub (Mar 17, 2017).

I moved from Gitea 1.0.2 to 1.1.0 - the migration process appeared to complete successfully according to details in xorm.log.

Later when trying to add a new wiki page I received a 500 error.

In gitea.log I see this message:

2017/03/16 22:03:45 [...routers/repo/wiki.go:445 NewWikiPost()] [E] AddWikiPage: Push: exit status 1 - remote: hooks/update: line 2: /xx/xx/gitea-1.0.2-darwin-10.6-amd64: No such file or directory
remote: error: hook declined to update refs/heads/master
To /xx/xx/gitea-repositories/xx/xx.wiki.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/xx/xx/gitea-repositories/xx/xx.wiki.git'

Where the problem is that I've removed the binary for the previous version of gittea, however it is still being referenced in the update hook for the wiki git repo.

I did the resync hooks option in the admin panel and it did not resolve the problem. When manually changing the hook to reference the newer version of gitea I received a different 500 error despite the path being correct and executable:

2017/03/16 22:32:44 [...routers/repo/wiki.go:445 NewWikiPost()] [E] AddWikiPage: Push: exit status 1 - remote: No help topic for 'update'
remote: error: hook declined to update refs/heads/master
To /xx/xx/gitea-repositories/xx/xx.wiki.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '/xx/xx/gitea-repositories/xx/xx.wiki.git'

After restoring the 1.0.2 binary to the old location and changing the update hook back to the old version I was able to successfully update the wiki.

I looked at some of my non-wiki repos and the hooks for those had been updated to the 1.1.0 version so this seems to just be isolated to the wiki repos.

Originally created by @zxcvbn4038 on GitHub (Mar 17, 2017). I moved from Gitea 1.0.2 to 1.1.0 - the migration process appeared to complete successfully according to details in xorm.log. Later when trying to add a new wiki page I received a 500 error. In gitea.log I see this message: ``` 2017/03/16 22:03:45 [...routers/repo/wiki.go:445 NewWikiPost()] [E] AddWikiPage: Push: exit status 1 - remote: hooks/update: line 2: /xx/xx/gitea-1.0.2-darwin-10.6-amd64: No such file or directory remote: error: hook declined to update refs/heads/master To /xx/xx/gitea-repositories/xx/xx.wiki.git ! [remote rejected] master -> master (hook declined) error: failed to push some refs to '/xx/xx/gitea-repositories/xx/xx.wiki.git' ``` Where the problem is that I've removed the binary for the previous version of gittea, however it is still being referenced in the update hook for the wiki git repo. I did the resync hooks option in the admin panel and it did not resolve the problem. When manually changing the hook to reference the newer version of gitea I received a different 500 error despite the path being correct and executable: ``` 2017/03/16 22:32:44 [...routers/repo/wiki.go:445 NewWikiPost()] [E] AddWikiPage: Push: exit status 1 - remote: No help topic for 'update' remote: error: hook declined to update refs/heads/master To /xx/xx/gitea-repositories/xx/xx.wiki.git ! [remote rejected] master -> master (hook declined) error: failed to push some refs to '/xx/xx/gitea-repositories/xx/xx.wiki.git' ``` After restoring the 1.0.2 binary to the old location and changing the update hook back to the old version I was able to successfully update the wiki. I looked at some of my non-wiki repos and the hooks for those had been updated to the 1.1.0 version so this seems to just be isolated to the wiki repos.
GiteaMirror added the issue/duplicate label 2025-11-02 03:26:43 -06:00
Author
Owner

@zxcvbn4038 commented on GitHub (Mar 17, 2017):

This might be related to https://github.com/go-gitea/gitea/issues/1250

@zxcvbn4038 commented on GitHub (Mar 17, 2017): This might be related to https://github.com/go-gitea/gitea/issues/1250
Author
Owner

@lunny commented on GitHub (May 4, 2017):

Yes. This should be fixed by #1257. Let's close this and please feel free to reopen it.

@lunny commented on GitHub (May 4, 2017): Yes. This should be fixed by #1257. Let's close this and please feel free to reopen it.
Author
Owner

@gayprogrammer commented on GitHub (May 5, 2017):

For anyone whose wiki broke because of this, the fix after upgrading is:
Enter Gitea admin panel on the UI, run "Resync pre-receive, update and post-receive hooks of all repositories."

@gayprogrammer commented on GitHub (May 5, 2017): For anyone whose wiki broke because of this, the fix after upgrading is: Enter Gitea admin panel on the UI, run "Resync pre-receive, update and post-receive hooks of all repositories."
Author
Owner

@zxcvbn4038 commented on GitHub (May 8, 2017):

@razzintown @lunny Thats great news! Thank you!

@zxcvbn4038 commented on GitHub (May 8, 2017): @razzintown @lunny Thats great news! Thank you!
Author
Owner

@zxcvbn4038 commented on GitHub (May 9, 2017):

@razzintown @lunny Confirmed that the issue is resolved in 1.1.1

@zxcvbn4038 commented on GitHub (May 9, 2017): @razzintown @lunny Confirmed that the issue is resolved in 1.1.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#525