-
Previous Value Current Value Many errors on startup and during push
git diff errors on startup and during push
-
Please check directory
/media/storage/docker_configs/onedev/site/projects. Seems that it contains some directory not expecting to be a valid OneDev project directory. A valid project directory contains a validgitsub directory. -
They all have a git directory with what looks like valid contents.
$ ls -l **/git 1/git: Permissions Size User Group Date Modified Name drwxr-xr-x - jsimon jsimon 2022-08-09 21:12 branches/ drwxr-xr-x - jsimon jsimon 2022-08-09 21:12 hooks/ drwxr-xr-x - jsimon jsimon 2022-08-09 21:12 logs/ drwxr-xr-x - jsimon jsimon 2022-08-09 21:15 objects/ drwxr-xr-x - jsimon jsimon 2022-08-09 21:12 refs/ .rw-r--r-- 162 jsimon jsimon 2022-08-09 21:12 config .rw-r--r-- 21 jsimon jsimon 2022-08-09 21:15 HEAD 2/git: Permissions Size User Group Date Modified Name drwxr-xr-x - jsimon jsimon 2022-08-09 22:09 branches/ drwxr-xr-x - jsimon jsimon 2022-08-09 22:09 hooks/ drwxr-xr-x - jsimon jsimon 2022-08-09 22:09 logs/ drwxr-xr-x - jsimon jsimon 2023-05-31 14:36 objects/ drwxr-xr-x - jsimon jsimon 2022-08-09 22:09 refs/ .rw-r--r-- 162 jsimon jsimon 2022-08-09 22:09 config .rw-r--r-- 23 jsimon jsimon 2022-08-09 22:09 HEAD 3/git: Permissions Size User Group Date Modified Name drwxr-xr-x - jsimon jsimon 2022-08-22 13:26 branches/ drwxr-xr-x - jsimon jsimon 2022-08-22 13:26 hooks/ drwxr-xr-x - jsimon jsimon 2022-08-22 13:26 logs/ drwxr-xr-x - jsimon jsimon 2022-08-22 13:27 objects/ drwxr-xr-x - jsimon jsimon 2022-08-22 13:26 refs/ .rw-r--r-- 162 jsimon jsimon 2022-08-22 13:26 config .rw-r--r-- 21 jsimon jsimon 2022-08-22 13:27 HEAD 4/git: Permissions Size User Group Date Modified Name drwxr-xr-x - jsimon jsimon 2022-09-01 13:55 branches/ drwxr-xr-x - jsimon jsimon 2022-09-01 13:55 hooks/ drwxr-xr-x - jsimon jsimon 2022-09-01 13:55 logs/ drwxr-xr-x - jsimon jsimon 2023-06-06 22:21 objects/ drwxr-xr-x - jsimon jsimon 2022-09-01 13:55 refs/ .rw-r--r-- 162 jsimon jsimon 2022-09-01 13:55 config .rw-r--r-- 21 jsimon jsimon 2022-09-01 13:56 HEAD 5/git: Permissions Size User Group Date Modified Name drwxr-xr-x - jsimon jsimon 2022-12-17 13:17 branches/ drwxr-xr-x - jsimon jsimon 2022-12-17 13:17 hooks/ drwxr-xr-x - jsimon jsimon 2022-12-17 13:17 lfs/ drwxr-xr-x - jsimon jsimon 2022-12-17 13:17 logs/ drwxr-xr-x - jsimon jsimon 2023-05-31 20:34 objects/ drwxr-xr-x - jsimon jsimon 2022-12-17 13:17 refs/ .rw-r--r-- 162 jsimon jsimon 2022-12-17 13:17 config .rw-r--r-- 21 jsimon jsimon 2022-12-17 13:18 HEAD -
Please edit
/media/storage/docker_configs/onedev/conf/logback.xmlto add below logger:<logger name="io.onedev.commons.utils.command.Commandline" level="TRACE"/>Then restart OneDev to see the command execution details including working directory. You can then run that command directly in that directory to see if it reports the same error.
-
Here is a snippet of what I got:
2023-06-09 02:51:38,298 DEBUG [pool-3-thread-2] i.o.c.utils.command.Commandline Executing command: git diff --numstat --no-renames e2cae04b8a96d8da7699c2ae7fd63fb86e65646b..e2cae04b8a96d8da7699c2ae7fd63fb86e65646b 2023-06-09 02:51:38,301 TRACE [pool-3-thread-2] i.o.c.utils.command.Commandline Command working directory: /opt/onedev/site/projects/4/git 2023-06-09 02:51:38,302 TRACE [pool-3-thread-2] i.o.c.utils.command.Commandline Command execution environments: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin WRAPPER_PID=115 WRAPPER_WORKING_DIR=/opt/onedev/boot WRAPPER_JAVA_VERSION_MINOR=0 WRAPPER_OS=linux WRAPPER_HOSTNAME=9eab8c492a10 LANG=en_US.UTF-8 WRAPPER_BITS=64 WRAPPER_BIN_DIR=/opt/onedev/boot WRAPPER_VERSION=3.5.51 WRAPPER_BASE_NAME=wrapper WRAPPER_HOST_NAME=9eab8c492a10 WRAPPER_CONF_DIR=/opt/onedev/conf WRAPPER_LANG=en WRAPPER_JAVA_VENDOR=OpenJDK PWD=/ WRAPPER_FILE_SEPARATOR=/ _=/opt/onedev/boot/wrapper-linux-x86-64 ONEDEV_COMMAND_EXECUTION_UUID=d969d4bc-f9fa-44d1-a874-f3d279ad9f1f LANGUAGE=en_US:en WRAPPER_INIT_DIR=/ WRAPPER_PATH_SEPARATOR=: WRAPPER_EDITION=Standard HOSTNAME=9eab8c492a10 WRAPPER_JAVA_VERSION_MAJOR=11 LC_ALL=en_US.UTF-8 WRAPPER_JAVA_VERSION_REVISION=19 WRAPPER_RUN_MODE=console WRAPPER_ARCH=x86 WRAPPER_JAVA_VERSION=11.0.19 SHLVL=0 HOME=/rootIf I manually go to
/media/storage/docker_configs/onedev/site/projects/4/git(which corresponds to/opt/onedev/site/projects/4/git) and executegit diff --numstat --no-renames e2cae04b8a96d8da7699c2ae7fd63fb86e65646b..e2cae04b8a96d8da7699c2ae7fd63fb86e65646b, it exits0and has no output.ETA: For clarity, later in the log, that thread emitted the same error as mentioned in the OP.
-
Please exec into onedev container, and run the same command in directory
/opt/onedev/site/projects/4/gitto see what happens. -
Aha!
When inside the container, I get the error that is listed in the logs. My gut says permissions issue so I added
environment: - PUID=1000 - PGID=1000to the compose and
chowned the whole directory to my host user. It had no effect on the outcome. -
OneDev needs to run as root inside the container. Please change all files under
/opt/onedevto be owned by root (this directory can be owned by normal user, but that needs docker to run in rootless mode, which is another topic). -
And there you have it, I can now push. Thank you for the support!
-
Previous Value Current Value Open
Closed
-
Config issue, all fixed thanks to @robin
| Type |
Question
|
| Priority |
Normal
|
| Assignee |
I'm running the docker container. Here is my compose.
On container startup, I get a bunch of errors where
git diffis being misused (according to the error).etc
I get the same error when I try to push commits and client side see this (replaced my repo uri)
I can upload the whole log if necessary, it's quite large.
FWIW, I can clone projects without issue so the data is seemingly fine.