Problems with Mattermost/Docker installation

Hey Guys,

I can’t get Mattermost to work with docker-compose. Can you please help me?

Here is my setup:

  • Debian 11 Bullseye
  • Docker
  • Docker-Compose
  • Portainer
  • Nginx Proxy Manager

I have installed a few applications within Portainer and Nginx Proxy Manager. The Port 8000 is already used by portainer, and 80 and 443 are already used bei Nginx Proxy Manager.

Now I want to install Mattermost Team-Edition on my setup via docker-compose.

So I went through this Tutorial: Deploy Mattermost on Docker

Here it says I should do this:

sudo apt-get install git
git clone LINK TO MATTERMOST DOCKER
cd mattermost-docker
docker-compose build
mkdir -pv ./volumes/app/mattermost/{data,logs,config,plugins,client-plugins}
sudo chown -R 2000:2000 ./volumes/app/mattermost/
docker-compose up -d

Which I did. The folders are all writeable, and I configured after the “docker-compose build” my docker-compose.yml as it is said, when I want to install the team edition.

Here is my docker-compose.yml:

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=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
      #   - MM_VERSION=5.31
    restart: unless-stopped
    volumes:
      - ./volumes/app/mattermost/config:/mattermost/config:rw
      - ./volumes/app/mattermost/data:/mattermost/data:rw
      - ./volumes/app/mattermost/logs:/mattermost/logs:rw
      - ./volumes/app/mattermost/plugins:/mattermost/plugins:rw
      - ./volumes/app/mattermost/client-plugins:/mattermost/client/plugins:rw
      - /etc/localtime:/etc/localtime:ro
      # When you want to use SSO with GitLab, you have to add the cert pki chain of GitLab inside Alpine
      # to avoid Token request failed: certificate signed by unknown authority (link: https://github.com/mattermost/mattermost-server/issues/13059)
      # - <path_to_your_gitlab_pki>/pki_chain.pem:/etc/ssl/certs/pki_chain.pem:ro
    environment:
      # set same as db credentials and dbname
      - MM_USERNAME=mmuser
      - MM_PASSWORD=mmuser_password
      - MM_DBNAME=mattermost

      # use the credentials you've set above, in the format:
      # MM_SQLSETTINGS_DATASOURCE=postgres://${MM_USERNAME}:${MM_PASSWORD}@db:5432/${MM_DBNAME}?sslmode=disable&connect_timeout=10
      - MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mmuser_password@db:5432/mattermost?sslmode=disable&connect_timeout=10

      # in case your config is not in default location
      #- MM_CONFIG=/mattermost/config/config.json

  web:
    build: web
    ports:
      - "4000:80"
      - "4443: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
    cap_drop:
      - ALL

I changed the ports in the “web”-part to 4000:80 and 4443:443 as the standard ports are already used by other applications.

When I now deploy the docker-compose via “docker-compose up -d” everything starts.

But, when I look into the logs, there are some failiures. And I can’t connect to the Mattermost-Installation.

Here are the logs:

Log from mattermost-docker_app_

No configuration file /mattermost/config/config.json, Creating a new one, Using existing database connection, Starting mattermost, {"level":"error","ts":1636809534.085906,"caller":"sqlstore/store.go:301","msg":"Failed to ping DB","error":"dial tcp 172.29.0.3:5432: connect: connection refused","retrying in seconds":10}, {"level":"error","ts":1636809557.4769206,"caller":"app/server.go:513","msg":"Mail server connection test is failed","error":"SendEmailNotifications is not true","errorVerbose":"SendEmailNotifications is not true\ngithub.com/mattermost/mattermost-server/v5/shared/mail.TestConnection\n\tgithub.com/mattermost/mattermost-server/v5/shared/mail/mail.go:212\ngithub.com/mattermost/mattermost-server/v5/app.NewServer\n\tgithub.com/mattermost/mattermost-server/v5/app/server.go:512\ngithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.runServer\n\tgithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands/server.go:77\ngithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.serverCmdF\n\tgithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands/server.go:61\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v1.1.3/command.go:852\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v1.1.3/command.go:960\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v1.1.3/command.go:897\ngithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands.Run\n\tgithub.com/mattermost/mattermost-server/v5/cmd/mattermost/commands/root.go:14\nmain.main\n\tgithub.com/mattermost/mattermost-server/v5/cmd/mattermost/main.go:31\nruntime.main\n\truntime/proc.go:204\nruntime.goexit\n\truntime/asm_amd64.s:1374"}, {"level":"error","ts":1636809557.4772067,"caller":"app/server.go:517","msg":"SiteURL must be set. Some features will operate incorrectly if the SiteURL is not set. See documentation for details: http://about.mattermost.com/default-site-url"}, {"level":"error","ts":1636809557.5342638,"caller":"app/server.go:1650","msg":"Failed to send notifications to admin users.","error":"NotifyAdminsOfWarnMetricStatus: List of admins is empty., "}, {"level":"error","ts":1636809598.020841,"caller":"mlog/log.go:251","msg":"RPC call OnDeactivate to plugin failed.","plugin_id":"com.mattermost.nps","error":"connection is shut down"}

Log from mattermost-docker_db_1:

2021-11-13 14:19:13.375 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.409 CET [60] ERROR: relation "idx_outgoing_webhook_delete_at" does not exist, 2021-11-13 14:19:13.409 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.474 CET [60] ERROR: relation "idx_command_team_id" does not exist, 2021-11-13 14:19:13.474 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.517 CET [60] ERROR: relation "idx_command_update_at" does not exist, 2021-11-13 14:19:13.517 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.559 CET [60] ERROR: relation "idx_command_create_at" does not exist, 2021-11-13 14:19:13.559 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.634 CET [60] ERROR: relation "idx_command_delete_at" does not exist, 2021-11-13 14:19:13.634 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.708 CET [60] ERROR: relation "idx_command_webhook_create_at" does not exist, 2021-11-13 14:19:13.708 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.767 CET [60] ERROR: relation "idx_preferences_user_id" does not exist, 2021-11-13 14:19:13.767 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.800 CET [60] ERROR: relation "idx_preferences_category" does not exist, 2021-11-13 14:19:13.800 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.834 CET [60] ERROR: relation "idx_preferences_name" does not exist, 2021-11-13 14:19:13.834 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.891 CET [60] ERROR: relation "idx_emoji_update_at" does not exist, 2021-11-13 14:19:13.891 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.934 CET [60] ERROR: relation "idx_emoji_create_at" does not exist, 2021-11-13 14:19:13.934 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:13.967 CET [60] ERROR: relation "idx_emoji_delete_at" does not exist, 2021-11-13 14:19:13.967 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:14.044 CET [60] ERROR: relation "idx_emoji_name" does not exist, 2021-11-13 14:19:14.044 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:14.076 CET [60] ERROR: relation "idx_status_user_id" does not exist, 2021-11-13 14:19:14.076 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:14.134 CET [60] ERROR: relation "idx_status_status" does not exist, 2021-11-13 14:19:14.134 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:14.184 CET [60] ERROR: relation "idx_fileinfo_update_at" does not exist, 2021-11-13 14:19:14.184 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:14.262 CET [60] ERROR: relation "idx_fileinfo_create_at" does not exist, 2021-11-13 14:19:14.262 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:15.901 CET [60] ERROR: relation "idx_fileinfo_delete_at" does not exist, 2021-11-13 14:19:15.901 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:15.959 CET [60] ERROR: relation "idx_fileinfo_postid_at" does not exist, 2021-11-13 14:19:15.959 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.009 CET [60] ERROR: relation "idx_fileinfo_extension_at" does not exist, 2021-11-13 14:19:16.009 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.066 CET [60] ERROR: relation "idx_fileinfo_name_txt" does not exist, 2021-11-13 14:19:16.066 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.084 CET [60] ERROR: relation "idx_fileinfo_name_splitted" does not exist, 2021-11-13 14:19:16.084 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.125 CET [60] ERROR: relation "idx_fileinfo_content_txt" does not exist, 2021-11-13 14:19:16.125 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.143 CET [60] ERROR: relation "idx_uploadsessions_user_id" does not exist, 2021-11-13 14:19:16.143 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.176 CET [60] ERROR: relation "idx_uploadsessions_create_at" does not exist, 2021-11-13 14:19:16.176 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.242 CET [60] ERROR: relation "idx_jobs_type" does not exist, 2021-11-13 14:19:16.242 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.284 CET [60] ERROR: relation "idx_user_access_tokens_token" does not exist, 2021-11-13 14:19:16.284 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.318 CET [60] ERROR: relation "idx_user_access_tokens_user_id" does not exist, 2021-11-13 14:19:16.318 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.375 CET [60] ERROR: relation "idx_notice_views_timestamp" does not exist, 2021-11-13 14:19:16.375 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.418 CET [60] ERROR: relation "idx_notice_views_user_id" does not exist, 2021-11-13 14:19:16.418 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.451 CET [60] ERROR: relation "idx_notice_views_notice_id" does not exist, 2021-11-13 14:19:16.451 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.508 CET [60] ERROR: relation "idx_notice_views_user_notice" does not exist, 2021-11-13 14:19:16.508 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.543 CET [60] ERROR: relation "idx_user_terms_of_service_user_id" does not exist, 2021-11-13 14:19:16.543 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.576 CET [60] ERROR: relation "idx_link_metadata_url_timestamp" does not exist, 2021-11-13 14:19:16.576 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.650 CET [60] ERROR: relation "idx_sharedchannelusers_user_id" does not exist, 2021-11-13 14:19:16.650 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.693 CET [60] ERROR: relation "idx_sharedchannelusers_remote_id" does not exist, 2021-11-13 14:19:16.693 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.743 CET [60] ERROR: relation "idx_groupmembers_create_at" does not exist, 2021-11-13 14:19:16.743 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.793 CET [60] ERROR: relation "idx_usergroups_remote_id" does not exist, 2021-11-13 14:19:16.793 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.924 CET [60] ERROR: relation "idx_usergroups_delete_at" does not exist, 2021-11-13 14:19:16.924 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:16.968 CET [60] ERROR: relation "idx_groupteams_teamid" does not exist, 2021-11-13 14:19:16.968 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.018 CET [60] ERROR: relation "idx_groupchannels_channelid" does not exist, 2021-11-13 14:19:17.018 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.072 CET [60] ERROR: relation "idx_groupteams_schemeadmin" does not exist, 2021-11-13 14:19:17.072 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.142 CET [60] ERROR: relation "idx_groupchannels_schemeadmin" does not exist, 2021-11-13 14:19:17.142 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.193 CET [60] ERROR: relation "idx_schemes_channel_guest_role" does not exist, 2021-11-13 14:19:17.193 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.259 CET [60] ERROR: relation "idx_schemes_channel_user_role" does not exist, 2021-11-13 14:19:17.259 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.301 CET [60] ERROR: relation "idx_schemes_channel_admin_role" does not exist, 2021-11-13 14:19:17.301 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:17.343 CET [60] ERROR: relation "remote_clusters_site_url_unique" does not exist, 2021-11-13 14:19:17.343 CET [60] STATEMENT: SELECT $1::regclass, 2021-11-13 14:19:28.058 CET [78] ERROR: relation "ir_system" does not exist at character 20, 2021-11-13 14:19:28.058 CET [78] STATEMENT: SELECT SValue FROM IR_System WHERE SKey = $1, 2021-11-13 14:19:58.099 CET [68] ERROR: duplicate key value violates unique constraint "users_username_key", 2021-11-13 14:19:58.099 CET [68] DETAIL: Key (username)=(surveybot) already exists., 2021-11-13 14:19:58.099 CET [68] STATEMENT: insert into "users" ("id","createat","updateat","deleteat","username","password","authdata","authservice","email","emailverified","nickname","firstname","lastname","position","roles","allowmarketing","props","notifyprops","lastpasswordupdate","lastpictureupdate","failedattempts","locale","timezone","mfaactive","mfasecret","remoteid") values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26);

Log from mattermost-docker_web_1:

linking plain config `2021/11/13 14:18:53 [notice] 1#1: using the "epoll" event method` 2021/11/13 14:18:53 [notice] 1#1: nginx/1.21.3 `2021/11/13 14:18:53 [notice] 1#1: built by gcc 10.3.1 20210424 (Alpine 10.3.1_git20210424) ` 2021/11/13 14:18:53 [notice] 1#1: OS: Linux 5.10.0-9-amd64 `2021/11/13 14:18:53 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576` 2021/11/13 14:18:53 [notice] 1#1: start worker processes `2021/11/13 14:18:53 [notice] 1#1: start worker process 10` 2021/11/13 14:18:53 [notice] 1#1: start worker process 11 `2021/11/13 14:18:53 [notice] 1#1: start worker process 12` 2021/11/13 14:18:53 [notice] 1#1: start worker process 13 `2021/11/13 14:19:23 [error] 10#10: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://172.29.0.2:8000/", host: "localhost:8080"` 127.0.0.1 - - [13/Nov/2021:14:19:23 +0100] "GET / HTTP/1.1" 502 150 "-" "curl/7.78.0" "-" `127.0.0.1 - - [13/Nov/2021:14:19:53 +0100] "GET / HTTP/1.1" 200 3122 "-" "curl/7.78.0" "-"` 127.0.0.1 - - [13/Nov/2021:14:20:23 +0100] "GET / HTTP/1.1" 200 3122 "-" "curl/7.78.0" "-" `` 127.0.0.1 - - [13/Nov/2021:14:20:54 +0100] "GET / HTTP/1.1" 200 3122 "-" "curl/7.78.0" "-"

So, I can’t connect via Server-IP and any port variation (8000, 4000, 4443) and I can’t connect via subdomain.domain.de which I have configured to point to Server-IP plus Ports (already tried all of the written before).

Is anybody able to help me to get this thing to work? :slight_smile: This would be awesome! Thank you and have a nice weekend!

Greetings from the Black Forest in Germany

Hello @Seelenkontrast! The post you’re referencing has been replaced with GitHub - mattermost/docker: Redesigned mattermost-docker. We’re in the process of updating that post with the new information.

Would you be open to taking a look at the repo and seeing if it helps resolve your problem? :slight_smile:

Yes it totally fixed my problem. It went through with the new docker-compose, I just used the old one from this forum. The new one worked!