docker-gitlab
docker-gitlab copied to clipboard
mac don't start docker gitlab caused by psotgresql , how to solve it
2023-08-29_03:21:56.76573 LOG: starting PostgreSQL 13.11 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, 64-bit 2023-08-29_03:21:56.76817 LOG: could not set permissions of file "/var/opt/gitlab/postgresql/.s.PGSQL.5432": Invalid argument 2023-08-29_03:21:56.76835 WARNING: could not create Unix-domain socket in directory "/var/opt/gitlab/postgresql" 2023-08-29_03:21:56.76846 FATAL: could not create any Unix-domain sockets 2023-08-29_03:21:56.77111 LOG: database system is shut down 2023-08-29_03:21:58.02704 LOG: starting PostgreSQL 13.11 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, 64-bit 2023-08-29_03:21:58.03004 LOG: could not set permissions of file "/var/opt/gitlab/postgresql/.s.PGSQL.5432": Invalid argument 2023-08-29_03:21:58.03025 WARNING: could not create Unix-domain socket in directory "/var/opt/gitlab/postgresql" 2023-08-29_03:21:58.03037 FATAL: could not create any Unix-domain sockets 2023-08-29_03:21:58.03365 LOG: database system is shut down 2023-08-29_03:21:59.27062 LOG: starting PostgreSQL 13.11 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, 64-bit 2023-08-29_03:21:59.27307 LOG: could not set permissions of file "/var/opt/gitlab/postgresql/.s.PGSQL.5432": Invalid argument 2023-08-29_03:21:59.27323 WARNING: could not create Unix-domain socket in directory "/var/opt/gitlab/postgresql" 2023-08-29_03:21:59.27335 FATAL: could not create any Unix-domain sockets 2023-08-29_03:21:59.27592 LOG: database system is shut down
From the message /var/opt/gitlab/postgresql/.s.PGSQL.5432
, I think you are using official gitlab/gitlab-ce
or gitlab/gitlab-ee
image. If so, this is not the right place to ask for help.
Please ask on https://gitlab.com/gitlab-org/omnibus-gitlab
what is the resolution to this though I am facing the same issue.
The issue I am facing is similar
2023-09-21_00:48:26.29829 LOG: starting PostgreSQL 13.11 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, 64-bit 2023-09-21_00:48:26.30008 LOG: could not set permissions of file "/var/opt/gitlab/postgresql/.s.PGSQL.5432": Invalid argument 2023-09-21_00:48:26.30029 WARNING: could not create Unix-domain socket in directory "/var/opt/gitlab/postgresql" 2023-09-21_00:48:26.30050 FATAL: could not create any Unix-domain sockets 2023-09-21_00:48:26.30305 LOG: database system is shut down
I believe you are using a recent version of Docker Desktop which enables VirtioFS for file sharing by default. This blocks the embedded PostgreSQL from booting up. Changing it back to gRPC Fuse mode could help to work it around.
This has bothered me for a day on a new laptop. I recall it was working on an old laptop of M1 so it might be running an old version of Docker Desktop. Then I tried some old versions of Docker Desktop and 4.19.0 happened to work which does not have VirtioFS turned on yet but later versions made it default since 4.21.0.
Still don't know the root cause yet. I may explore it a bit further to see if I can find some time over the weekend.
I believe you are using a recent version of Docker Desktop which enables VirtioFS for file sharing by default. This blocks the embedded PostgreSQL from booting up. Changing it back to gRPC Fuse mode could help to work it around.
This has bothered me for a day on a new laptop. I recall it was working on an old laptop of M1 so it might be running an old version of Docker Desktop. Then I tried some old versions of Docker Desktop and 4.19.0 happened to work which does not have VirtioFS turned on yet but later versions made it default since 4.21.0.
Still don't know the root cause yet. I may explore it a bit further if I can find some time over the weekend.
Yes you are right changing it back to gRPC Fuse got it working again.
It sounds caused by the permission issue of VirtioFS in Docker Desktop.
I got the same failure under VirtioFS
, but switching to gRPC FUSE
just gets me a different permissions error:
permissions error details
* ruby_block[directory resource: /var/opt/gitlab/git-data] action run[2023-10-25T15:18:25+00:00] INFO: ruby_block[directory resource: /var/opt/gitlab/git-data] called
- execute the ruby block directory resource: /var/opt/gitlab/git-data
* storage_directory[/var/opt/gitlab/git-data/repositories] action create
* ruby_block[directory resource: /var/opt/gitlab/git-data/repositories] action run
================================================================================
Error executing action `run` on resource 'ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Failed asserting that mode permissions on "/var/opt/gitlab/git-data/repositories" is 2770
---- Begin output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ----
STDOUT:
STDERR: + + grepreadlink -o ....$
-f /var/opt/gitlab/git-data/repositories
+ stat --printf=%04a /var/opt/gitlab/git-data/repositories
+ [ 0770 = 2770 ]
---- End output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ----
Ran set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] returned 1
Cookbook Trace: (most recent call first)
----------------------------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:125:in `validate_command'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:113:in `block in validate'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `each_index'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `validate'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:87:in `validate!'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:45:in `block (3 levels) in class_from_file'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:36:in `block in class_from_file'
I got the same failure under
VirtioFS
, but switching togRPC FUSE
just gets me a different permissions error:permissions error details
* ruby_block[directory resource: /var/opt/gitlab/git-data] action run[2023-10-25T15:18:25+00:00] INFO: ruby_block[directory resource: /var/opt/gitlab/git-data] called - execute the ruby block directory resource: /var/opt/gitlab/git-data * storage_directory[/var/opt/gitlab/git-data/repositories] action create * ruby_block[directory resource: /var/opt/gitlab/git-data/repositories] action run ================================================================================ Error executing action `run` on resource 'ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Failed asserting that mode permissions on "/var/opt/gitlab/git-data/repositories" is 2770 ---- Begin output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ---- STDOUT: STDERR: + + grepreadlink -o ....$ -f /var/opt/gitlab/git-data/repositories + stat --printf=%04a /var/opt/gitlab/git-data/repositories + [ 0770 = 2770 ] ---- End output of set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] ---- Ran set -x && [ "$(stat --printf='%04a' $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o '....$')" = '2770' ] returned 1 Cookbook Trace: (most recent call first) ---------------------------------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:125:in `validate_command' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:113:in `block in validate' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `each_index' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `validate' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:87:in `validate!' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:45:in `block (3 levels) in class_from_file' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:36:in `block in class_from_file'
You may want to clean up or delete the persistent volumes and start the container from scratch after switching file sharing mode.