Upgrading from 10-9 to 1x-xx fails on DSM devices: DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
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.
Why not try chmod 750 path/to/mounted/var/lib/postgresql/11/main ?
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
Had the same problem.
Comment out this line and build the PostgreSQL image by yourself. Worked for me!
Best regards
Met same issue chmod: missing operand after '0600' during upgrade to gitlab 12, any suggestions here?
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 .
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. [email protected]**
- GITLAB_EMAIL_SUBJECT_SUFFIX=**Create a email suffix to GitLab system mails*
- GITLAB_EMAIL_ENABLED=true
- GITLAB_EMAIL=**Insert a SMTP email sender, ex. [email protected]**
- GITLAB_EMAIL_REPLY_TO=**Insert a SMTP email sender, ex. [email protected]**
- GITLAB_INCOMING_EMAIL_ADDRESS=**Insert a system email receiver, ex. [email protected]**
- SMTP_ENABLED=true
- SMTP_USER=**Insert a SMTP email sender, ex. [email protected]**
- 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. [email protected]**
- IMAP_PORT=**Insert your HOSTs IMAP port**
- IMAP_USER=**Insert a IMAP email sender, ex. [email protected]**
- IMAP_PASS=**Insert IMAP email password**
––––
The fix of lynic didn't work for me...
Anyone end up finding a fix for this?
@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
I managed to get it work somehow:
- stop the postgresql container
- delete postgresql local folder
- recreate the folder and chmod 0700
- docker-compose up -d
Just make sure the main folder is created. If the folder itself is missing, you will get the invalid permission error