harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.96k stars 2.79k forks source link

Cannot create repository when using an external drive #3466

Closed Saul-BT closed 6 months ago

Saul-BT commented 6 months ago

Context

I am using a machine with little space only to run programs via Docker, I save the data on an external disk using volumes. Trying to do this with Gitness I get an error when creating a repository.

Using the internal storage, there is no problem, but linking the volume to a directory on the external disk is a problem.

This should not be a permissions issue, as some files and directories have been generated by Gitness.

Current behavior

When I try to create a repository, I get the following error:

UI: image

Container logs:

gitness  | {"level":"warn","time":"2024-01-21T21:18:02.925943609Z","message":"operation resulted in user facing error. Internal details: error creating repository on git: failed to create repo on: failed to setup symlink for hook 'pre-receive' ('/data/repos/k0/ln/is9pe61py0t4119hm2setelm3knohdtie2t5rw.git/hooks/pre-receive' -> '/app/gitness'): %!s(MISSING)"}

Expected behavior

The repository is created normally.

Additional info

Gitness version: v2.22.0 Docker version: 20.10.12

johannesHarness commented 6 months ago

Hey @Saul-BT, thanks for helping to improve Gitness 🚀

It seems like we don't properly log the root cause of the linking error, we'll be working on fixing the logs in the next release version so in future runs we'll get the full error details.

In the meanwhile, let's try to manually investigate why the linking doesn't work. Could you connect to the docker container and try to manually test creating a symlink in /data dir that points to /app/gitness (e.g. ln -s /app/gitness /data/ln-app-gitness).

Saul-BT commented 6 months ago

Hi @johannesHarness, I found the problem, the link was trying to be created on the disk, but the disk is formatted in exFAT, so it is not supported.

I changed the container volume so that it now points to a disk (EXT4 format), and everything works correctly (no errors).

I find this project very interesting, congratulations on the idea and the great work.

PS: It would be great to be able to use SSH keys for repos management. I'll keep an eye on #3392 . And maybe in the future I will contribute :)

johannesHarness commented 6 months ago

Glad to hear you were able to resolve the problem! Hopefully it'll help others in the future that might run into similar issues, too.

PS: I'm trying to get someone to respond on the SSH feature request.