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

Upgrading from 10-9 to 1x-xx fails on DSM devices: DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750). #2224

Open
Anqueta opened this issue Sep 3, 2020 · 10 comments

Comments

@Anqueta
Copy link

Anqueta commented Sep 3, 2020

I'm running gitlab on an Synology box running the latest version of DSM (6.2.3-25426 Update 2). Also I've recreated this issue on multiple different boxes of Synology and I'm not sure how to resolve this. I've tried different version of postgresql and the only reason really why I've tried updating is because gitlab requires it with version 13.xx and on.

It stays stuck in this loop:

Initializing datadir...
Initializing certdir...
Initializing logdir...
Initializing rundir...
Setting resolv.conf ACLs...
setfacl: /etc/resolv.conf: Operation not supported
Initializing database...
‣ Migrating PostgreSQL 10 data to 11...
‣ Installing PostgreSQL 10...
2020-09-03 12:14:43.264 UTC [402] FATAL:  data directory "/var/lib/postgresql/11/main" has invalid permissions
2020-09-03 12:14:43.264 UTC [402] DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
child process exited with exit code 1
initdb: removing data directory "/var/lib/postgresql/11/main"

Any help with this would be appreciated.
Thank you.

@cwildfoerster
Copy link
Contributor

Why not try chmod 750 path/to/mounted/var/lib/postgresql/11/main ?

@Anqueta
Copy link
Author

Anqueta commented Sep 3, 2020

I run into the following issue when I do that:

2020-09-03 21:36:17 stderr Try 'chmod --help' for more information.
2020-09-03 21:36:17 stderr chmod: missing operand after '0600'

I also tried doing:
sudo chown -R 101:103 path/to/mounted/var/lib/postgresql/11/main

@cblochi
Copy link

cblochi commented Jan 30, 2021

Had the same problem.

Comment out this line and build the PostgreSQL image by yourself. Worked for me!

Best regards

@lynic
Copy link

lynic commented Jul 31, 2021

Met same issue chmod: missing operand after '0600' during upgrade to gitlab 12, any suggestions here?

@lynic
Copy link

lynic commented Jul 31, 2021

okay.... I figure out a way to solve it, first create 11/main folder with correct owner , then create an empty file under 11/main, it will workaround chmod 0600 failure, during log shows Installing PG 10, remove the previously created empty file, otherwise it will fail again during db migration saying that main folder is not empty .

@m-si
Copy link

m-si commented Sep 28, 2021

DSM 6.2.4-25556 Update 2
Docker 20.10.3-0554

First of all thank you all for shareing your experiences and Tips. I followed docker-compose setup of this excellent tutorial and can confirm

UTC [402] FATAL: data directory "/var/lib/postgresql/12/main" has invalid permissions

Error. I setup folders like this
root:root personal
|- 1000:1000 gitlab
|- 101:103 postgresql
|- 101:103 redis

with this docker compose
––––
version: '2.3'

services:
redis:
restart: always
image: redis:6.2
container_name: gitlab-redis
command:
- --loglevel warning
volumes:
- /volume1/docker/personal/gitlab/redis:/var/lib/redis

postgresql:
restart: always
image: sameersbn/postgresql:12-20200524
container_name: gitlab-postgresql
volumes:
- /volume1/docker/personal/gitlab/postgresql:/var/lib/postgresql
environment:
- DB_USER=Create Database user
- DB_PASS=Create Database password
- DB_NAME=Create Database name
- DB_EXTENSION=pg_trgm,btree_gist

gitlab:
image: sameersbn/gitlab:14.2.4
container_name: gitlab
links:
- redis
- postgresql
ports:
- "8080:80"
- "8022:22"
- "8443:443"
volumes:
- /volume1/docker/personal/gitlab/gitlab/config:/etc/gitlab
- /volume1/docker/personal/gitlab/gitlab/logs:/var/log/gitlab
- /volume1/docker/personal/gitlab/gitlab/data:/home/git/data
- /volume1/docker/personal/gitlab/gitlab/opt:/var/opt/gitlab
environment:
- DB_ADAPTER=postgresql
- DB_HOST=postgresql
- DB_PORT=5432
- DB_USER=Insert Database user
- DB_PASS=Insert Database password
- DB_NAME=Insert Database name

- REDIS_HOST=redis
- REDIS_PORT=6379

- TZ=**Insert your timezone ex. Europe/Oslo**
- GITLAB_TIMEZONE=**Insert your timezone ex. Europe/Oslo**
- GITLAB_SECRETS_DB_KEY_BASE=**Create a long random string 50-70 characters)
- GITLAB_SECRETS_SECRET_KEY_BASE=**Create a long random string 50-70 characters)
- GITLAB_SECRETS_OTP_KEY_BASE=**Create a long random string 50-70 characters)

- GITLAB_HTTPS=true
- GITLAB_SSH_PORT=8022
- GITLAB_HOST=**Insert your domain ex. - sub.domain.name repo.gitlab.com**
- GITLAB_ROOT_PASSWORD=**Create your GitLab root password**
- GITLAB_ROOT_EMAIL=**Create your GitLab root email - this is roots username**

- GITLAB_EMAIL_DISPLAY_NAME=**Insert a SMTP email sender, ex. noreply@domain.com**
- GITLAB_EMAIL_SUBJECT_SUFFIX=**Create a email suffix to GitLab system mails*
- GITLAB_EMAIL_ENABLED=true
- GITLAB_EMAIL=**Insert a SMTP email sender, ex. noreply@domain.com**
- GITLAB_EMAIL_REPLY_TO=**Insert a SMTP email sender, ex. noreply@domain.com**
- GITLAB_INCOMING_EMAIL_ADDRESS=**Insert a system email receiver, ex. reply@domain.com**

- SMTP_ENABLED=true
- SMTP_USER=**Insert a SMTP email sender, ex. noreply@domain.com**
- SMTP_PASS=**Insert SMTP email password**
- SMTP_DOMAIN=**Insert SMTP domain**
- SMTP_HOST=**Insert SMTP HOST for your domain**
- SMTP_PORT=**Insert your HOSTs SMTP port**
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=plain

- IMAP_ENABLED=true
- IMAP_HOST=**Insert a IMAP email sender, ex. noreply@domain.com**
- IMAP_PORT=**Insert your HOSTs IMAP port**
- IMAP_USER=**Insert a IMAP email sender, ex. noreply@domain.com**
- IMAP_PASS=**Insert IMAP email password**

––––

The fix of lynic didn't work for me...

@vkarps
Copy link

vkarps commented Dec 26, 2021

Anyone end up finding a fix for this?

@moutonjeremy
Copy link

@vkarps I'm currently deploy gitlab on synology too and it's working.

I see a difference with your volume mount, the :Z option at the end of line is missing.
https://github.com/sameersbn/docker-gitlab/blob/master/docker-compose.yml

@jinixx
Copy link

jinixx commented Feb 28, 2022

I managed to get it work somehow:

  1. stop the postgresql container
  2. delete postgresql local folder
  3. recreate the folder and chmod 0700
  4. docker-compose up -d

@jrikhof
Copy link

jrikhof commented Aug 16, 2023

Just make sure the main folder is created. If the folder itself is missing, you will get the invalid permission error

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

9 participants