Cannot Create New Files In Habitat Image #2539

Closed
opened 2025-11-02 04:39:48 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @TheDarkula on GitHub (Nov 16, 2018).

  • Gitea version (or commit ref): 1.5.3 and 1.6.0-rc2
  • Git version: 2.18.0
  • Operating system: linux 64-bit
  • Database:
    • PostgreSQL
  • Can you reproduce the bug at https://try.gitea.io:
    • No
  • Log gist:

Description

I'm working on a habitat plan for gitea. I've gotten it to successfully build and export the docker image. Gitea runs correctly, but when I add files/push to a repository, I get:

Failed to update/create file 'test' with error: git push origin master: exit status 1 - fatal: cannot run hooks/pre-receive: No such file or directory To /hab/svc/gitea/var/lib/gitea/repos/meade/brewstillery.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '/hab/svc/gitea/var/lib/gitea/repos/meade/brewstillery.git'

I have tapped into the running docker image and verified that the path does exist:

/ # ls -la /hab/svc/gitea/var/lib/gitea/repos/meade/brewstillery.git
total 44
drwxr-xr-x    7 git      git           4096 Nov 16 04:00 .
drwxr-xr-x    3 git      git           4096 Nov 16 04:00 ..
-rw-r--r--    1 git      git             23 Nov 16 04:00 HEAD
drwxr-xr-x    2 git      git           4096 Nov 16 04:00 branches
-rw-r--r--    1 git      git            101 Nov 16 04:00 config
-rw-r--r--    1 git      git             73 Nov 16 04:00 description
drwxr-xr-x    5 git      git           4096 Nov 16 04:00 hooks
drwxr-xr-x    2 git      git           4096 Nov 16 04:00 info
drwxr-xr-x    4 git      git           4096 Nov 16 04:00 objects
-rw-r--r--    1 git      git           1887 Nov 16 04:00 packed-refs
drwxr-xr-x    4 git      git           4096 Nov 16 04:00 refs

Screenshots

gitea

Originally created by @TheDarkula on GitHub (Nov 16, 2018). - Gitea version (or commit ref): 1.5.3 and 1.6.0-rc2 - Git version: 2.18.0 - Operating system: linux 64-bit - Database: - [x] PostgreSQL - Can you reproduce the bug at https://try.gitea.io: - [x] No - Log gist: ## Description I'm working on a [habitat](https://habitat.sh) plan for gitea. I've gotten it to successfully build and export the docker image. Gitea runs correctly, but when I add files/push to a repository, I get: ``` Failed to update/create file 'test' with error: git push origin master: exit status 1 - fatal: cannot run hooks/pre-receive: No such file or directory To /hab/svc/gitea/var/lib/gitea/repos/meade/brewstillery.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '/hab/svc/gitea/var/lib/gitea/repos/meade/brewstillery.git' ``` I have tapped into the running docker image and verified that the path does exist: ``` / # ls -la /hab/svc/gitea/var/lib/gitea/repos/meade/brewstillery.git total 44 drwxr-xr-x 7 git git 4096 Nov 16 04:00 . drwxr-xr-x 3 git git 4096 Nov 16 04:00 .. -rw-r--r-- 1 git git 23 Nov 16 04:00 HEAD drwxr-xr-x 2 git git 4096 Nov 16 04:00 branches -rw-r--r-- 1 git git 101 Nov 16 04:00 config -rw-r--r-- 1 git git 73 Nov 16 04:00 description drwxr-xr-x 5 git git 4096 Nov 16 04:00 hooks drwxr-xr-x 2 git git 4096 Nov 16 04:00 info drwxr-xr-x 4 git git 4096 Nov 16 04:00 objects -rw-r--r-- 1 git git 1887 Nov 16 04:00 packed-refs drwxr-xr-x 4 git git 4096 Nov 16 04:00 refs ``` ## Screenshots ![gitea](https://user-images.githubusercontent.com/24402552/48598086-10527280-e959-11e8-80d4-f081271228ce.png)
Author
Owner

@TheDarkula commented on GitHub (Nov 21, 2018):

I figured it out. The gitea git hooks have the shebang line #!/usr/bin/env bash and habitat has the env binary in /bin/env. I fixed it by adding a symlink from /bin/env to /usr/bin/env`.

@TheDarkula commented on GitHub (Nov 21, 2018): I figured it out. The gitea git hooks have the shebang line `#!/usr/bin/env bash` and habitat has the `env` binary in `/bin/env`. I fixed it by adding a symlink from `/bin/env` to /usr/bin/env`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2539