mattermost-docker
mattermost-docker copied to clipboard
Getting "standard_init_linux.go:207: exec user process caused "permission denied"" inside docker container for mattermost_app
Hi, I followed every instruction from the readme and everything seemed to work fine. I'll show you the exact commands I made in case someone sees something odd.
Step 1) My docker-compose.yml
version: "2"
services:
db:
build: db
read_only: true
restart: unless-stopped
volumes:
- /srv/docker/db/var/lib/postgresql/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_USER=mmuser
- POSTGRES_PASSWORD=mmuser_password
- POSTGRES_DB=mattermost
# uncomment the following to enable backup
# - AWS_ACCESS_KEY_ID=XXXX
# - AWS_SECRET_ACCESS_KEY=XXXX
# - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
# - AWS_REGION=us-east-1
app:
build:
context: app
# uncomment following lines for team edition or change UID/GID
args:
- edition=team
# - PUID=1000
# - PGID=1000
restart: unless-stopped
volumes:
- /srv/docker/mattermost/config:/mattermost/config:rw
- /srv/docker/mattermost/data:/mattermost/data:rw
- /srv/docker/mattermost/logs:/mattermost/logs:rw
- /srv/docker/mattermost/plugins:/mattermost/plugins:rw
- /srv/docker/mattermost/client-plugins:/mattermost/client/plugins:rw
- /etc/localtime:/etc/localtime:ro
environment:
# set same as db credentials and dbname
- MM_USERNAME=mmuser
- MM_PASSWORD=mmuser_password
- MM_DBNAME=mattermost
# in case your config is not in default location
#- MM_CONFIG=srv/docker/mattermost/config/config.json
Step 2) docker-compose build
[root@Services mattermost]# sudo docker-compose build
Building db
Step 1/9 : FROM postgres:9.4-alpine
---> 2ae8b40b46ba
Step 2/9 : ENV DEFAULT_TIMEZONE UTC
---> Using cache
---> 809432053715
Step 3/9 : RUN apk add --no-cache build-base curl libc6-compat libffi-dev linux-headers python-dev py-pip py-cryptography && pip --no-cache-dir install 'wal-e<1.0.0' envdir && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
---> Using cache
---> 09dfa519d897
Step 4/9 : COPY setup-wale.sh /docker-entrypoint-initdb.d/
---> Using cache
---> cda3a31b6167
Step 5/9 : HEALTHCHECK CMD pg_isready -U $POSTGRES_USER -d $POSTGRES_DB || exit 1
---> Using cache
---> fc400a70dab4
Step 6/9 : COPY entrypoint.sh /
---> Using cache
---> 6d07469eb0f3
Step 7/9 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> 0159df721fdc
Step 8/9 : CMD ["postgres"]
---> Using cache
---> a1b721c2631f
Step 9/9 : VOLUME ["/var/run/postgresql", "/usr/share/postgresql/", "/var/lib/postgresql/data", "/tmp", "/etc/wal-e.d/env"]
---> Using cache
---> 294684934a74
Successfully built 294684934a74
Successfully tagged mattermost_db:latest
Building app
Step 1/17 : FROM alpine:3.9
---> 055936d39205
Step 2/17 : ENV PATH="/mattermost/bin:${PATH}"
---> Using cache
---> 9d6a0fffdb84
Step 3/17 : ENV MM_VERSION=5.12.1
---> Using cache
---> b6dc01a9e98a
Step 4/17 : ARG edition=enterprise
---> Using cache
---> 6dae4885d74f
Step 5/17 : ARG PUID=2000
---> Using cache
---> 718dda2298ff
Step 6/17 : ARG PGID=2000
---> Using cache
---> 805ed0b45d0f
Step 7/17 : ARG MM_BINARY=
---> Using cache
---> c0620b13375e
Step 8/17 : RUN apk add --no-cache ca-certificates curl jq libc6-compat libffi-dev linux-headers mailcap netcat-openbsd xmlsec-dev tzdata && rm -rf /tmp/*
---> Using cache
---> 3353b0e9a425
Step 9/17 : RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins && if [ ! -z "$MM_BINARY" ]; then curl $MM_BINARY | tar -xvz ; elif [ "$edition" = "team" ] ; then curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; else curl https://releases.mattermost.com/$MM_VERSION/mattermost-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; fi && cp /mattermost/config/config.json /config.json.save && rm -rf /mattermost/config/config.json && addgroup -g ${PGID} mattermost && adduser -D -u ${PUID} -G mattermost -h /mattermost -D mattermost && chown -R mattermost:mattermost /mattermost /config.json.save /mattermost/plugins /mattermost/client/plugins
---> Using cache
---> bc1e025d5b83
Step 10/17 : USER mattermost
---> Using cache
---> 900623daede4
Step 11/17 : HEALTHCHECK CMD curl --fail http://localhost:8000 || exit 1
---> Using cache
---> da6a00a99ac8
Step 12/17 : COPY entrypoint.sh /
---> Using cache
---> 734204ff7588
Step 13/17 : ENTRYPOINT ["/entrypoint.sh"]
---> Using cache
---> a109c66adddd
Step 14/17 : WORKDIR /mattermost
---> Using cache
---> 5592fa2cd167
Step 15/17 : CMD ["mattermost"]
---> Using cache
---> 094b696a4be5
Step 16/17 : EXPOSE 8000
---> Using cache
---> aabdc40197c3
Step 17/17 : VOLUME ["/mattermost/data", "/mattermost/logs", "/mattermost/config", "/mattermost/plugins", "/mattermost/client/plugins"]
---> Using cache
---> 5e0df1de442c
Successfully built 5e0df1de442c
Successfully tagged mattermost_app:latest
Step 3) Create volumes
[root@organisationServices mattermost]# mkdir -p /srv/docker/mattermost/{data,logs,config,plugins}
Step 4) Give permissions to volumes
[root@organisationServices mattermost]# sudo chown -R 2000:2000 /srv/docker/mattermost/
Step 5) docker-compose up
[root@organisationServices mattermost]# sudo docker-compose up -d
Starting mattermost_db_1 ... done
Starting mattermost_app_1 ... done
Everything seems fine up to here. Also, I am root user, so the permission steps was optional but I did it anyways.
Here's what happens when I log the mattermost_app_1
container:
[root@organisationServices mattermost]# docker container logs mattermost_app_1
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
standard_init_linux.go:207: exec user process caused "permission denied"
I can't find a way to get more logging information about this container. Also, this is the status for both containers:
[root@organisationServices mattermost]# docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
119f95d8275a mattermost_app "/entrypoint.sh matt…" 39 hours ago Restarting (1) 17 seconds ago mattermost_app_1
b3a1b116cf12 mattermost_db "/entrypoint.sh post…" 39 hours ago Up About a minute (healthy) 5432/tcp
So the container keeps restarting with the same error logs. Does anyone have any idea how to fix this and what is the issue?
Also, I am new to Docker. I want to host my database in my own postgres
database without creating one with Mattermost. My only issue is understanding what would be the host for said database when adding it in docker-compose
. What is the host of a database inside a docker container so I can add it in the docker-compose
?
Thanks!
I decided to run docker-compose build
with a verbose flag to see if that can help:
[root@organisationServices mattermost]# docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.utils.config.find_config_file: Trying paths: ['/root/.docker/config.json', '/root/.dockercfg']
docker.utils.config.find_config_file: No config file found
docker.utils.config.find_config_file: Trying paths: ['/root/.docker/config.json', '/root/.dockercfg']
docker.utils.config.find_config_file: No config file found
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/version HTTP/1.1" 200 580
compose.cli.command.get_client: docker-compose version 1.24.0, build 0aa59064
docker-py version: 3.7.2
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
compose.cli.command.get_client: Docker base_url: http+docker://localhost
compose.cli.command.get_client: Docker version: Platform={'Name': 'Docker Engine - Community'}, Components=[{'Name': 'Engine', 'Version': '18.09.5', 'Details': {'ApiVersion': '1.39', 'Arch': 'amd64', 'BuildTime': '2019-04-11T04:13:40.000000000+00:00', 'Experimental': 'false', 'GitCommit': 'e8ff056', 'GoVersion': 'go1.10.8', 'KernelVersion': '3.10.0-957.10.1.el7.x86_64', 'MinAPIVersion': '1.12', 'Os': 'linux'}}], Version=18.09.5, ApiVersion=1.39, MinAPIVersion=1.12, GitCommit=e8ff056, GoVersion=go1.10.8, Os=linux, Arch=amd64, KernelVersion=3.10.0-957.10.1.el7.x86_64, BuildTime=2019-04-11T04:13:40.000000000+00:00
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('mattermost_default')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/networks/mattermost_default HTTP/1.1" 200 447
compose.cli.verbose_proxy.proxy_callable: docker inspect_network -> {'Attachable': False,
'ConfigFrom': {'Network': ''},
'ConfigOnly': False,
'Containers': {},
'Created': '2019-07-07T16:15:02.066710476-04:00',
'Driver': 'bridge',
'EnableIPv6': False,
'IPAM': {'Config': [{'Gateway': '172.31.8.1', 'Subnet': '172.31.8.0/24'}],
'Driver': 'default',
'Options': None},
...
compose.cli.verbose_proxy.proxy_callable: docker info <- ()
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/info HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker info -> {'Architecture': 'x86_64',
'BridgeNfIp6tables': False,
'BridgeNfIptables': False,
'CPUSet': True,
'CPUShares': True,
'CgroupDriver': 'cgroupfs',
'ClusterAdvertise': '',
'ClusterStore': '',
'ContainerdCommit': {'Expected': 'bb71b10fd8f58240ca47fbb579b9d1028eea7c84',
'ID': 'bb71b10fd8f58240ca47fbb579b9d1028eea7c84'},
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- ('mattermost_default')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/networks/mattermost_default HTTP/1.1" 200 447
compose.cli.verbose_proxy.proxy_callable: docker inspect_network -> {'Attachable': False,
'ConfigFrom': {'Network': ''},
'ConfigOnly': False,
'Containers': {},
'Created': '2019-07-07T16:15:02.066710476-04:00',
'Driver': 'bridge',
'EnableIPv6': False,
'IPAM': {'Config': [{'Gateway': '172.31.8.1', 'Subnet': '172.31.8.0/24'}],
'Driver': 'default',
'Options': None},
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 3
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.service=db', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['postgres'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['postgres'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['POSTGRES_USER=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.service=app', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.service%3Dapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 1873
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mattermost_db')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/images/mattermost_db/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['postgres'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mattermost_app')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/images/mattermost_app/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.service=db', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mattermost_db')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/images/mattermost_db/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['postgres'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['postgres'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['postgres'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['POSTGRES_USER=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.service=app', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=1&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.service%3Dapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 1873
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mattermost_app')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/images/mattermost_app/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.parallel.feed_queue: Pending: {<Service: app>, <Service: db>}
compose.parallel.feed_queue: Starting producer thread for <Service: app>
Starting mattermost_app_1 ...
compose.parallel.feed_queue: Starting producer thread for <Service: db>
Starting mattermost_db_1 ...
compose.parallel.feed_queue: Pending: {<Container: mattermost_app_1 (8b1536)>}
compose.parallel.feed_queue: Pending: {<Container: mattermost_db_1 (e5e420)>}
compose.parallel.feed_queue: Starting producer thread for <Container: mattermost_app_1 (8b1536)>
compose.parallel.feed_queue: Starting producer thread for <Container: mattermost_db_1 (e5e420)>
compose.cli.verbose_proxy.proxy_callable: docker attach <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389', stdout=True, stderr=True, stream=True)
compose.cli.verbose_proxy.proxy_callable: docker attach <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8', stdout=True, stderr=True, stream=True)
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/attach?logs=0&stdout=1&stderr=1&stream=1 HTTP/1.1" 101 0
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker attach -> <docker.types.daemon.CancellableStream object at 0x7f04473d5978>
compose.cli.verbose_proxy.proxy_callable: docker start <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/attach?logs=0&stdout=1&stderr=1&stream=1 HTTP/1.1" 101 0
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker attach -> <docker.types.daemon.CancellableStream object at 0x7f0446b736d8>
compose.cli.verbose_proxy.proxy_callable: docker start <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8')
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/start HTTP/1.1" 204 0
compose.cli.verbose_proxy.proxy_callable: docker start -> None
Starting mattermost_db_1 ... done
compose.parallel.feed_queue: Pending: set()
compose.parallel.parallel_execute_iter: Finished processing: <Service: db>
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/start HTTP/1.1" 204 0
Starting mattermost_app_1 ... done
compose.parallel.parallel_execute_iter: Finished processing: <Container: mattermost_app_1 (8b1536)>
compose.parallel.feed_queue: Pending: set()
compose.parallel.parallel_execute_iter: Finished processing: <Service: app>
compose.parallel.feed_queue: Pending: set()
Attaching to mattermost_db_1, mattermost_app_1
compose.cli.verbose_proxy.proxy_callable: docker events <- (filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.oneoff=False']}, decode=True)
app_1 | standard_init_linux.go:207: exec user process caused "permission denied"
db_1 | AWS_ACCESS_KEY_ID is required for Wal-E but not set. Skipping Wal-E setup.
db_1 | AWS_SECRET_ACCESS_KEY is required for Wal-E but not set. Skipping Wal-E setup.
db_1 | WALE_S3_PREFIX is required for Wal-E but not set. Skipping Wal-E setup.
db_1 | AWS_REGION is required for Wal-E but not set. Skipping Wal-E setup.
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/events?filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker events -> <docker.types.daemon.CancellableStream object at 0x7f04473dde48>
db_1 | LOG: database system was shut down at 2019-07-09 17:25:14 UTC
db_1 | LOG: MultiXact member wraparound protections are now enabled
db_1 | LOG: database system is ready to accept connections
db_1 | LOG: autovacuum launcher started
compose.cli.verbose_proxy.proxy_callable: docker wait <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker attach <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389', stdout=True, stderr=True, stream=True)
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/attach?logs=0&stdout=1&stderr=1&stream=1 HTTP/1.1" 101 0
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker attach -> <docker.types.daemon.CancellableStream object at 0x7f0446b92048>
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker wait <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/wait HTTP/1.1" 200 30
compose.cli.verbose_proxy.proxy_callable: docker wait -> {'Error': None, 'StatusCode': 1}
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
mattermost_app_1 exited with code 1
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker attach <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389', stdout=True, stderr=True, stream=True)
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/wait HTTP/1.1" 200 30
compose.cli.verbose_proxy.proxy_callable: docker wait -> {'Error': None, 'StatusCode': 1}
mattermost_app_1 exited with code 1
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/attach?logs=0&stdout=1&stderr=1&stream=1 HTTP/1.1" 409 None
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
Exception in thread Thread-7:
Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 261, in _raise_for_status
File "site-packages/requests/models.py", line 940, in raise_for_status
requests.exceptions.HTTPError: 409 Client Error: Conflict for url: http+docker://localhost/v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/attach?logs=0&stdout=1&stderr=1&stream=1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "threading.py", line 916, in _bootstrap_inner
File "threading.py", line 864, in run
File "compose/cli/log_printer.py", line 233, in watch_events
File "compose/container.py", line 215, in attach_log_stream
File "compose/container.py", line 307, in attach
File "compose/cli/verbose_proxy.py", line 55, in proxy_callable
File "site-packages/docker/utils/decorators.py", line 19, in wrapped
File "site-packages/docker/api/container.py", line 61, in attach
File "site-packages/docker/api/client.py", line 400, in _read_from_socket
File "site-packages/docker/api/client.py", line 311, in _get_raw_response_socket
File "site-packages/docker/api/client.py", line 263, in _raise_for_status
File "site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
docker.errors.APIError: 409 Client Error: Conflict ("b'container 8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389 is restarting, wait until the container is running'")
^CGracefully stopping... (press Ctrl+C again to force)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={'label': ['com.docker.compose.project=mattermost', 'com.docker.compose.oneoff=False']})
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Dmattermost%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 2 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['mattermost'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['mattermost'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['MM_USERNAME=mmuser',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {'AppArmorProfile': '',
'Args': ['postgres'],
'Config': {'ArgsEscaped': True,
'AttachStderr': False,
'AttachStdin': False,
'AttachStdout': False,
'Cmd': ['postgres'],
'Domainname': '',
'Entrypoint': ['/entrypoint.sh'],
'Env': ['POSTGRES_USER=mmuser',
...
Stopping mattermost_app_1 ...
Stopping mattermost_db_1 ...
compose.parallel.feed_queue: Pending: {<Container: mattermost_db_1 (e5e420)>, <Container: mattermost_app_1 (8b1536)>}
compose.parallel.feed_queue: Starting producer thread for <Container: mattermost_db_1 (e5e420)>
compose.cli.verbose_proxy.proxy_callable: docker stop <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8', timeout=10)
compose.parallel.feed_queue: Starting producer thread for <Container: mattermost_app_1 (8b1536)>
compose.cli.verbose_proxy.proxy_callable: docker stop <- ('8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389', timeout=10)
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/8b15369324ee9c39e15921b1f64d2c4860404db718518356dc9dbf2431cd4389/stop?t=10 HTTP/1.1" 204 0
Stopping mattermost_app_1 ... done
compose.parallel.parallel_execute_iter: Finished processing: <Container: mattermost_app_1 (8b1536)>
compose.parallel.feed_queue: Pending: set()
compose.parallel.feed_queue: Pending: set()
compose.cli.verbose_proxy.proxy_callable: docker wait <- ('e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8')
compose.parallel.feed_queue: Pending: set()
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/stop?t=10 HTTP/1.1" 204 0
compose.cli.verbose_proxy.proxy_callable: docker stop -> None
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.22/containers/e5e420cd3af83d3f5b9160a2894197747e4d4f1b94631126acd0476a584b16c8/wait HTTP/1.1" 200 30
compose.cli.verbose_proxy.proxy_callable: docker wait -> {'Error': None, 'StatusCode': 0}
Stopping mattermost_db_1 ... done
compose.parallel.feed_queue: Pending: set()
Very surprising, can you just paste the result of ls -la /srv/docker/mattermost
to ensure permissions are OK ? I'm pretty sure they should be OK with the command you ran but it seems to be a permissions issue.
@pichouk Thanks for replying! Here's the result:
[root@organisationServices mattermost]# ls -la
total 0
drwxr-xr-x. 7 2000 2000 81 Jul 9 14:16 .
drwxr-xr-x. 11 root root 142 Jul 9 14:16 ..
drwxr-xr-x. 2 2000 2000 6 Jul 9 14:16 client-plugins
drwxr-xr-x. 2 2000 2000 6 Jul 9 14:16 config
drwxr-xr-x. 2 2000 2000 6 Jul 9 14:16 data
drwxr-xr-x. 2 2000 2000 6 Jul 9 14:16 logs
drwxr-xr-x. 2 2000 2000 6 Jul 9 14:16 plugins
I don't know, it should be ok.... i'll try to ping a Mattermost developer to find what trigger this specific log message, maybe we can figure out then.
@pichouk If you managed to get a hold of a developer that would be great! I also don't understand why this isn't working. The problems seem to stem from the container itself, so I wonder if the image is the problem. I also noticed that even if I gave arguments such as team edition in the docker-compose, the image built is enterprise edition.
That doesn't look like an error that would come from Mattermost. standard_init_linux.go
seems to be part of Docker itself.
Gosh you're right @hmhealey this is a Docker error...
@JigsawCorp Is your Docker installation working for other container ? Are you able to run docker run hello-world
? What is the output of docker info
?
I found several issues about this on Github :
- https://github.com/docker-library/hello-world/issues/19
- https://github.com/grafana/grafana/issues/14854
Did you do the "chown"?
mkdir -p ./volumes/app/mattermost/{data,logs,config,plugins}
chown -R 2000:2000 ./volumes/app/mattermost/
docker-compose start
@egandro I changed the permissions but I'm having the exact same issue when using CentOS, so it seems to be a permissions issue specifically to do with CentOS (possibly SELinux?)
@pichouk You might want to look at the difference in permissions between Ubuntu and CentOS with and without SELinux
I tried this fix with no avail
I've attached some extra info for troubleshooting
OS version:
CentOS Linux release 7.7.1908 (Core)
Docker and dockerCE versions:
Docker version 19.03.2, build 6a30dfc
docker-compose version 1.24.0, build 0aa59064
sudo ls -la volumes/app/mattermost/
outputs:
total 0
drwx------. 7 2000 2000 81 Oct 3 05:24 .
drwx------. 3 xxxx xxxx 24 Oct 3 05:24 ..
drwx------. 2 2000 2000 6 Oct 3 05:24 client-plugins
drwx------. 2 2000 2000 6 Oct 3 05:24 config
drwx------. 2 2000 2000 6 Oct 3 05:24 data
drwx------. 2 2000 2000 6 Oct 3 05:24 logs
drwx------. 2 2000 2000 6 Oct 3 05:24 plugins
Docker logs [container_id]
for app container outputs:
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
standard_init_linux.go:211: exec user process caused "permission denied"
.
.
.
My current docker-compose.yml
file is as following: essentially unchanged except for passwords, SSL enabling, and changing the volumes' rw
in the app container to Z
(I get the same error with rw
)
version: "3"
services:
db:
build: db
read_only: true
restart: unless-stopped
volumes:
- ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_USER=not_mmuser
- POSTGRES_PASSWORD=super_secure_password
- POSTGRES_DB=mattermost
# uncomment the following to enable backup
# - AWS_ACCESS_KEY_ID=XXXX
# - AWS_SECRET_ACCESS_KEY=XXXX
# - WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
# - AWS_REGION=us-east-1
app:
build:
context: app
# uncomment following lines for team edition or change UID/GID
# args:
# - edition=team
# - PUID=1000
# - PGID=1000
restart: unless-stopped
volumes:
- ./volumes/app/mattermost/config:/mattermost/config:Z
- ./volumes/app/mattermost/data:/mattermost/data:Z
- ./volumes/app/mattermost/logs:/mattermost/logs:Z
- ./volumes/app/mattermost/plugins:/mattermost/plugins:Z
- ./volumes/app/mattermost/client-plugins:/mattermost/client/plugins:Z
- /etc/localtime:/etc/localtime:ro
environment:
# set same as db credentials and dbname
- MM_USERNAME=not_mmuser
- MM_PASSWORD=super_secure_password
- MM_DBNAME=mattermost
# in case your config is not in default location
#- MM_CONFIG=/mattermost/config/config.json
web:
build: web
ports:
- "80:80"
- "443:443"
read_only: true
restart: unless-stopped
volumes:
# This directory must have cert files if you want to enable SSL
- ./volumes/web/cert:/cert:ro
- /etc/localtime:/etc/localtime:ro
# Uncomment for SSL
environment:
- MATTERMOST_ENABLE_SSL=true
Temporary and unsafe fix
Change the user in the app container to root. This is really not recommended as it is not safe to run a container as root, but it gets the app working if you need it to:
.
.
app:
user: root
build:
context: app
# uncomment following lines for team edition or change UID/GID
# args:
# - edition=team
# - PUID=1000
# - PGID=1000
restart: unless-stopped
volumes:
.
.
.
I came across this error for an entirely different service, apache airflow on docker (the puckel image), and what worked in my case was deleting previous docker volumes that were somehow overloading the namespace even though I had moved the build files to a new location and had been trying to mount entirely different volumes to the container.
I also encountered this issue in a totally different service*. In my case, the base image I used was Alpine Linux, and my Entrypoint file had the shebang line #!/bin/bash
. By replacing it with #!/bin/sh
, I got past the error message. It should have been an obvious fix, but the error message didn't really help me find it.
*My issue had nothing to do with mattermost, but at time the of writing, this issue was the top Google hit when I searched the text of the error message. Hopefully this comment will help others facing the same issue, whether or not they're using mattermost.