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

mac don't start docker gitlab caused by psotgresql , how to solve it #2818

Open
AlfredNing opened this issue Aug 29, 2023 · 8 comments
Open

Comments

@AlfredNing
Copy link

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-1ubuntu122.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

@kkimurak
Copy link
Contributor

kkimurak commented Sep 1, 2023

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

@kianting
Copy link

what is the resolution to this though I am facing the same issue.

@kianting
Copy link

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

@xiaogangwen
Copy link

xiaogangwen commented Sep 29, 2023

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.

@kianting
Copy link

kianting commented Oct 1, 2023

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.

image

@xiaogangwen
Copy link

xiaogangwen commented Oct 3, 2023

It sounds caused by the permission issue of VirtioFS in Docker Desktop.

@llimllib
Copy link

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'

@xiaogangwen
Copy link

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'

You may want to clean up or delete the persistent volumes and start the container from scratch after switching file sharing mode.

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

No branches or pull requests

5 participants