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

Pushing to new repository does not change it to non-empty #9365

Closed
1 of 7 tasks
mschoettle opened this issue Dec 15, 2019 · 9 comments
Closed
1 of 7 tasks

Pushing to new repository does not change it to non-empty #9365

mschoettle opened this issue Dec 15, 2019 · 9 comments

Comments

@mschoettle
Copy link
Contributor

  • Gitea version (or commit ref): 1.10.1
  • Git version: 2.22.2
  • Operating system: Raspian Buster (10)
  • 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:
[Macaron] 2019-12-15 19:32:42: Started GET /user/test.git/info/refs?service=git-receive-pack for 192.168.1.119
[Macaron] 2019-12-15 19:32:42: Completed GET /user/test.git/info/refs?service=git-receive-pack 401 Unauthorized in 12.255841ms
[Macaron] 2019-12-15 19:32:42: Started GET /user/test.git/info/refs?service=git-receive-pack for 192.168.1.119
[Macaron] 2019-12-15 19:32:43: Completed GET /user/test.git/info/refs?service=git-receive-pack 200 OK in 410.181919ms
[Macaron] 2019-12-15 19:32:43: Started POST /user/test.git/git-receive-pack for 192.168.1.119
[Macaron] 2019-12-15 19:32:43: Completed POST /user/test.git/git-receive-pack 200 OK in 381.062007ms
[Macaron] 2019-12-15 19:32:50: Started GET /user/test for 192.168.1.119
[Macaron] 2019-12-15 19:32:50: Completed GET /user/test 200 OK in 41.880096ms

Description

I created a new repo and pushed a local repository. I tried it both with --all (it has two branches) and without (pushed only master). Either way the repository is not changed to non-empty. I did it manually in the DB to set the is_empty column to 0 which fixed the problem.

Steps to reproduce

  1. Create a new repo
  2. Take an existing repo on your machine and add the new repo as a remote test
  3. git push -u test
@timonegk
Copy link
Contributor

I am experiencing the same problem with PostgreSQL, Debian Buster and Gitea 1.10.1.

@zeripath
Copy link
Contributor

OK, so I don't see any hooks firing in that log gist.

  • Are your gitea repositories mounted on a non-exec partition?
  • Are the hooks marked executable?
  • Have you run the admin resynchronize hooks tool? (Please note this tool does not mark hooks as being executable if they are present but not executable - you will have to do that yourself.)

@timonegk
Copy link
Contributor

Oh, I think the problem is the noexec flag. I am using podman for virtualization which mounts volumes with noexec by default. The corresponding issue seems to be fixed already, but my release does not contain the fix yet. I will try again with the current release and report the results here.

@timonegk
Copy link
Contributor

Yes, that was the problem. Thank you for the quick response!

@timonegk
Copy link
Contributor

Well I don't know if this works for @mschoettle too

@zeripath
Copy link
Contributor

Hmm I think I'll leave it closed unless they write back to say that doesn't explain their problem

@mschoettle
Copy link
Contributor Author

Thanks.

I had user in my mount options which implies noexec. Without it it works now.

However, I think there should be some indication (in the logs or somewhere else) that the hooks are not executable.

@iwzoo
Copy link

iwzoo commented Dec 22, 2019

I'm having exact the same problem here. I run gitea + sqlite docker container on debian.

@mschoettle
Copy link
Contributor Author

@iwzoo: Did you check this comment?

I connected to the container and tried to execute a hook manually (for example: /data/git/repositories/<user>/<repo>/hooks/post.receive.d/gitea) which gave me "permission denied". That way I knew it was the problem described above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants