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

After migrating to 1.1.0 every push has a remote hook-related error #1226

Closed
2 of 7 tasks
milanaleksic opened this issue Mar 12, 2017 · 4 comments
Closed
2 of 7 tasks
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@milanaleksic
Copy link

  • Gitea version (or commit ref): 1.1.0
  • Git version: 2.1.4
  • Operating system: linux arm
  • 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:
milan@phobos ~/SourceCode/chef-repo → g p
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.08 KiB | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: ls: cannot access <REPOLOCATION>chef-repo.git/hooks/pre-receive.d/pre-receive.d: No such file or directory
remote: ls: cannot access <REPOLOCATION>chef-repo.git/hooks/post-receive.d/post-receive.d: No such file or directory
To <GITSERVER>/milanaleksic/chef-repo.git
   f5c53b8..efd304e  master -> master

Description

After the installation of the new version (1.0.1 -> 1.1.0) has been completed I seem to have the issue as explained above.

Is this a migration went bad? If so, may I just update in postgre the version to some other value and hope this to be fixed automatically? If not, can you give me a fix please?

This is not critical since push ends up being in the repository, but very annoying

@lunny
Copy link
Member

lunny commented Mar 12, 2017

This is a warning and will not let your push failed. This may because you have executed the migrations twice. You can edit this repo's hooks on settings and let pre-receive and post-receive blank. then it should resolved your problem.

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Mar 12, 2017
@milanaleksic
Copy link
Author

milanaleksic commented Mar 12, 2017

I have fixed this locally using:

find -type f -wholename '*pre-receive.d/pre-receive' | xargs -I{} sudo rm {}
find -type f -wholename '*post-receive.d/post-receive' | xargs -I{} sudo rm {}

I don't get warnings/errors any more, but is this a correct solution? All pre-receive.d and post-receive.d folders had similar files, like this:

#!/usr/bin/env bash
ORI_DIR=`pwd`
SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
cd "$ORI_DIR"
for i in `ls "$SHELL_FOLDER/post-receive.d"`; do
    sh "$SHELL_FOLDER/post-receive.d/$i"
done

It seems to me that only gitea should've been copied into the subfolder, not also this wrapper script hook.

And yes, because of issue #1225 it might be multiple startups caused multiple migration runs, although I don't have that proof.

In theory, if migrations were made idempotent this couldn't happen

@lunny
Copy link
Member

lunny commented Mar 12, 2017

You did the right things! #1225 is another problem.

@lunny
Copy link
Member

lunny commented Mar 12, 2017

I have sent #1194 to avoid migrate hooks twice.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

2 participants