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

docker-compose local volume: /app/data/secret: Permission denied #1121

Closed
xerenahmed opened this issue Jun 10, 2021 · 7 comments
Closed

docker-compose local volume: /app/data/secret: Permission denied #1121

xerenahmed opened this issue Jun 10, 2021 · 7 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@xerenahmed
Copy link

I get this error when I say docker compose up, it didn't happen on my own mac os computer, but it happens on another linux computer.

...
database_1  | 2021-06-10 11:58:55.397 UTC [1] LOG:  database system is ready to accept connections
weblate_1   | /app/bin/start: 31: /app/bin/start: cannot create /app/data/secret: Permission denied
weblate_1   | Starting...
weblate_1   | Generating Django secret...
weblate_weblate_1 exited with code 2
....

-->

Server configuration and status

docker-compose.yml

version: "3"

services:
  weblate:
    image: weblate/weblate
    tmpfs:
      - /app/cache
    volumes:
      - ./data/weblate-data:/app/data
    env_file:
      - ./environment
    restart: always
    depends_on:
      - database
      - cache
    ports:
      - 80:8080

  database:
    image: postgres:13-alpine
    env_file:
      - ./environment
    volumes:
      - ./data/postgres-data:/var/lib/postgresql/data
    restart: always

  cache:
    image: redis:6-alpine
    restart: always
    command: ["redis-server", "--appendonly", "yes"]
    volumes:
      - redis-data:/data

volumes:
  redis-data: {}

Directory Tree: (tree -L 3)

.
├── Makefile
├── README.rst
├── data
│   ├── postgres-data
│   │   ├── PG_VERSION
│   │   ├── base
│   │   ├── global
│   │   ├── pg_commit_ts
│   │   ├── pg_dynshmem
│   │   ├── pg_hba.conf
│   │   ├── pg_ident.conf
│   │   ├── pg_logical
│   │   ├── pg_multixact
│   │   ├── pg_notify
│   │   ├── pg_replslot
│   │   ├── pg_serial
│   │   ├── pg_snapshots
│   │   ├── pg_stat
│   │   ├── pg_stat_tmp
│   │   ├── pg_subtrans
│   │   ├── pg_tblspc
│   │   ├── pg_twophase
│   │   ├── pg_wal
│   │   ├── pg_xact
│   │   ├── postgresql.auto.conf
│   │   ├── postgresql.conf
│   │   └── postmaster.opts
│   └── weblate-data
├── docker-compose.yml
└── environment

20 directories, 10 files

ll data

-rw-r--r--  1 root root   13 Jun 10 11:45 .gitignore
drwx------ 19   70 root 4096 Jun 10 11:58 postgres-data/
drwxr-xr-x  2 root root 4096 Jun 10 11:58 weblate-data/
@nijel
Copy link
Member

nijel commented Jun 10, 2021

data/weblate-data is not writable by the user inside the container (UID 1000).

@nijel nijel transferred this issue from WeblateOrg/weblate Jun 10, 2021
nijel added a commit that referenced this issue Jun 10, 2021
@nijel nijel added the question This is more a question for the support than an issue. label Jun 10, 2021
@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger. In case your question is already answered, making a donation is the right way to say thank you!

@xerenahmed
Copy link
Author

So, how can I fix it?

@nijel
Copy link
Member

nijel commented Jun 11, 2021

Something like sudo chown 1000:1000 data/weblate-data.

@xerenahmed
Copy link
Author

Is the number 1000 fixed or if there is such an error at another time, how can I learn this number?

@nijel
Copy link
Member

nijel commented Jun 12, 2021

It is fixed:

docker/Dockerfile

Lines 186 to 188 in 32ec6e5

# Numerical value is needed for OpenShift S2I, see
# https://docs.openshift.com/container-platform/latest/openshift_images/create-images.html
USER 1000

nijel added a commit to WeblateOrg/weblate that referenced this issue Jun 12, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

@github-actions github-actions bot added the wontfix Nobody will work on this. label Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants