I have no idea why, my Mattermost instance was working fine just fine, and then stopped working with error messages like those:
[error] 18#18: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: , request: "GET /api/v4/websocket?connection_id=mkp3yo7sitdxuny1a9ec4ei8ao&sequence_number=294 HTTP/1.1", upstream: "http://172.19.0.4:8000/api/v4/websocket?connection_id=mkp3yo7sitdxuny1a9ec4ei8ao&sequence_number=294", host: "mattermost.dsimb.inserm.fr"
I was manipulating some iptables rules concerning another program a bit but I have no idea what I messed up about mattermost…
Here are the logs of the app, web and db when I launch the docker-compose:
APP
$ docker-compose logs -f app
Attaching to mattermost_app_1
app_1 | Using existing config file /mattermost/config/config.json
app_1 | Using existing database connection
app_1 | Starting mattermost
app_1 | info [2023-02-03 10:38:26.622 +01:00] Server is initializing... caller="platform/service.go:165" go_version=go1.18.1
app_1 | info [2023-02-03 10:38:26.622 +01:00] EXPERIMENTAL: Starting Bleve caller="bleveengine/bleve.go:185"
app_1 | info [2023-02-03 10:38:26.630 +01:00] Pinging SQL caller="sqlstore/store.go:238" database=master
app_1 | info [2023-02-03 10:38:26.721 +01:00] Starting websocket hubs caller="platform/web_hub.go:95" number_of_hubs=16
app_1 | info [2023-02-03 10:38:26.725 +01:00] Loaded system translations caller="i18n/i18n.go:93" for locale=fr from locale=/mattermost/i18n/fr.json
app_1 | info [2023-02-03 10:38:26.738 +01:00] Current version is 7.7.1 (7.7.1/Thu Jan 19 00:47:45 UTC 2023/63149c4869898f8c1d3a94ea728370ec4a07575f/none) caller="app/server.go:395" current_version=7.7.1 build_number=7.7.1 build_date="Thu Jan 19 00:47:45 UTC 2023" build_hash=63149c4869898f8c1d3a94ea728370ec4a07575f build_hash_enterprise=none
app_1 | info [2023-02-03 10:38:26.738 +01:00] Team Edition Build caller="app/server.go:406" enterprise_build=false
app_1 | info [2023-02-03 10:38:26.738 +01:00] Printing current working caller="app/server.go:410" directory=/mattermost
app_1 | info [2023-02-03 10:38:26.738 +01:00] Loaded config caller="app/server.go:411" source="file:///mattermost/config/config.json"
app_1 | info [2023-02-03 10:38:26.745 +01:00] Starting workers caller="jobs/workers.go:48"
app_1 | info [2023-02-03 10:38:26.745 +01:00] Starting schedulers. caller="jobs/schedulers.go:47"
app_1 | error [2023-02-03 10:38:26.749 +01:00] License key from https://mattermost.com required to unlock enterprise features. caller="platform/license.go:106" error="resource: License id: "
app_1 | info [2023-02-03 10:38:26.895 +01:00] Starting up plugins caller="app/plugin.go:213"
app_1 | info [2023-02-03 10:38:26.895 +01:00] Syncing plugins from the file store caller="app/plugin.go:294"
app_1 | info [2023-02-03 10:38:26.932 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/memes.tar.gz
app_1 | info [2023-02-03 10:38:26.932 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.github.scottleedavis.mattermost-plugin-remind.tar.gz
app_1 | info [2023-02-03 10:38:26.932 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/focalboard.tar.gz
app_1 | info [2023-02-03 10:38:26.933 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/playbooks.tar.gz
app_1 | info [2023-02-03 10:38:26.933 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.draw-plugin.tar.gz
app_1 | info [2023-02-03 10:38:26.933 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.calls.tar.gz
app_1 | info [2023-02-03 10:38:26.933 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.matthewdorner.mattermost-plugin-chess.tar.gz
app_1 | info [2023-02-03 10:38:26.933 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.welcomebot.tar.gz
app_1 | info [2023-02-03 10:38:26.934 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/mattermost-autolink.tar.gz
app_1 | info [2023-02-03 10:38:26.934 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.copy-post-plugin.tar.gz
app_1 | info [2023-02-03 10:38:26.934 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/channel-notes.tar.gz
app_1 | info [2023-02-03 10:38:26.935 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.github.moussetc.mattermost.plugin.diceroller.tar.gz
app_1 | info [2023-02-03 10:38:26.945 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.github.matterpoll.matterpoll.tar.gz
app_1 | info [2023-02-03 10:38:26.945 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.github.moussetc.mattermost.plugin.giphy.tar.gz
app_1 | info [2023-02-03 10:38:26.945 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.custom-attributes.tar.gz
app_1 | info [2023-02-03 10:38:26.955 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.agenda.tar.gz
app_1 | info [2023-02-03 10:38:26.956 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/com.mattermost.plugin-todo.tar.gz
app_1 | info [2023-02-03 10:38:26.957 +01:00] Syncing plugin from file store caller="app/plugin.go:364" bundle=plugins/github.tar.gz
app_1 | warn [2023-02-03 10:38:27.872 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.welcomebot
app_1 | warn [2023-02-03 10:38:28.257 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=memes
app_1 | warn [2023-02-03 10:38:28.258 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.custom-attributes
app_1 | warn [2023-02-03 10:38:28.828 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=mattermost-autolink
app_1 | warn [2023-02-03 10:38:28.908 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.github.moussetc.mattermost.plugin.giphy
app_1 | error [2023-02-03 10:38:29.949 +01:00] Failed to sync plugin from file store caller="app/plugin.go:366" bundle=plugins/channel-notes.tar.gz error="installExtractedPlugin: Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name., destination already exists"
app_1 | warn [2023-02-03 10:38:30.437 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.github.scottleedavis.mattermost-plugin-remind
app_1 | info [2023-02-03 10:38:30.547 +01:00] Post.Message has size restrictions caller="sqlstore/post_store.go:2483" max_characters=16383 max_bytes=65535
app_1 | warn [2023-02-03 10:38:30.614 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.agenda
app_1 | error [2023-02-03 10:38:30.723 +01:00] Failed to sync plugin from file store caller="app/plugin.go:366" bundle=plugins/com.github.matterpoll.matterpoll.tar.gz error="installExtractedPlugin: Unable to move plugin from temporary directory to final destination. Another plugin may be using the same directory name., destination already exists"
app_1 | warn [2023-02-03 10:38:30.839 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.calls
app_1 | info [2023-02-03 10:38:31.071 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.071 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.072 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.072 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.073 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.073 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.074 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | info [2023-02-03 10:38:31.074 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | warn [2023-02-03 10:38:31.324 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=playbooks
app_1 | warn [2023-02-03 10:38:32.143 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=focalboard
app_1 | info [2023-02-03 10:38:32.207 +01:00] connectDatabase caller="app/plugin_api.go:973" plugin_id=focalboard dbType=postgres
app_1 | error [2023-02-03 10:38:32.222 +01:00] Table creation / migration failed caller="app/plugin_api.go:976" plugin_id=focalboard error=""pq: column "dirty" does not exist in line 0: SELECT version, dirty FROM "public"."focalboard_schema_migrations" LIMIT 1""
app_1 | info [2023-02-03 10:38:32.225 +01:00] plugin process exited caller="plugin/hclog_adapter.go:61" plugin_id=focalboard wrapped_extras=path/mattermost/plugins/focalboard/server/dist/plugin-linux-amd64pid126
app_1 | error [2023-02-03 10:38:32.248 +01:00] Failed to sync plugin from file store caller="app/plugin.go:366" bundle=plugins/focalboard.tar.gz error="installExtractedPlugin: Unable to restart plugin on upgrade., error initializing the DB: pq: column "dirty" does not exist in line 0: SELECT version, dirty FROM "public"."focalboard_schema_migrations" LIMIT 1"
app_1 | warn [2023-02-03 10:38:33.706 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.plugin-channel-export
app_1 | info [2023-02-03 10:38:33.926 +01:00] plugin process exited caller="plugin/hclog_adapter.go:61" plugin_id=playbooks wrapped_extras=path/mattermost/plugins/playbooks/server/dist/plugin-linux-amd64pid113
app_1 | info [2023-02-03 10:38:34.293 +01:00] rtc: server was shutdown caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:84"
app_1 | warn [2023-02-03 10:38:34.703 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.apps
app_1 | info [2023-02-03 10:38:34.873 +01:00] plugin process exited caller="plugin/hclog_adapter.go:61" plugin_id=com.mattermost.calls wrapped_extras=path/mattermost/plugins/com.mattermost.calls/server/dist/plugin-linux-amd64pid102
app_1 | info [2023-02-03 10:38:34.949 +01:00] activated caller="app/plugin_api.go:973" plugin_id=com.mattermost.apps
app_1 | warn [2023-02-03 10:38:35.491 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=playbooks
app_1 | info [2023-02-03 10:38:35.748 +01:00] registered collection and topic type caller="app/collection.go:33" plugin_id=playbooks collection_type=run topic_type=status
app_1 | info [2023-02-03 10:38:35.748 +01:00] registered collection and topic type caller="app/collection.go:33" plugin_id=playbooks collection_type=run topic_type=task
app_1 | warn [2023-02-03 10:38:36.655 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=com.mattermost.calls
app_1 | warn [2023-02-03 10:38:36.707 +01:00] plugin configured with a nil SecureConfig caller="plugin/hclog_adapter.go:72" plugin_id=focalboard
app_1 | info [2023-02-03 10:38:36.768 +01:00] connectDatabase caller="app/plugin_api.go:973" plugin_id=focalboard dbType=postgres
app_1 | info [2023-02-03 10:38:36.795 +01:00] {"level":"info","msg":"Pinging SQL","fields":{"database":"master"}}
app_1 | caller="io/io.go:428" plugin_id=focalboard source=plugin_stderr
app_1 | info [2023-02-03 10:38:36.836 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.837 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.837 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.838 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.838 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.839 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.839 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.840 +01:00] rtc: server is listening on udp 8443 caller="app/plugin_api.go:973" plugin_id=com.mattermost.calls origin="main.(*logger).Info log.go:90"
app_1 | info [2023-02-03 10:38:36.871 +01:00] Initialized notification backend caller="app/plugin_api.go:973" plugin_id=focalboard name=notifyMentions
app_1 | info [2023-02-03 10:38:36.872 +01:00] Initialized notification backend caller="app/plugin_api.go:973" plugin_id=focalboard name=notifySubscriptions
app_1 | info [2023-02-03 10:38:36.872 +01:00] Initialized notification backend caller="app/plugin_api.go:973" plugin_id=focalboard name=notifyLogger
app_1 | info [2023-02-03 10:38:36.888 +01:00] FocalBoard Server caller="app/plugin_api.go:973" plugin_id=focalboard version=7.7.0 edition=plugin build_number=3856523067 build_date=""Fri Jan 6 15:51:58 UTC 2023"" build_hash=938e7f1c82c7af00115248e284f302c28557f040
app_1 | info [2023-02-03 10:38:36.888 +01:00] Server.Start caller="app/plugin_api.go:973" plugin_id=focalboard
app_1 | info [2023-02-03 10:38:36.908 +01:00] Boards product successfully started. caller="app/plugin_api.go:973" plugin_id=focalboard
app_1 | info [2023-02-03 10:38:36.958 +01:00] Starting Server... caller="app/server.go:878"
app_1 | info [2023-02-03 10:38:36.958 +01:00] RateLimiter is enabled caller="app/server.go:912"
app_1 | info [2023-02-03 10:38:36.959 +01:00] Server is listening on [::]:8065 caller="app/server.go:950" address="[::]:8065"
DB
$ docker-compose logs -f db
Attaching to mattermost_db_1
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.
db_1 |
db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1 |
db_1 | 2023-02-03 09:38:25.059 UTC [14] LOG: starting PostgreSQL 13.2 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, 64-bit
db_1 | 2023-02-03 09:38:25.059 UTC [14] LOG: listening on IPv4 address "0.0.0.0", port 5432
db_1 | 2023-02-03 09:38:25.059 UTC [14] LOG: listening on IPv6 address "::", port 5432
db_1 | 2023-02-03 09:38:25.062 UTC [14] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1 | 2023-02-03 09:38:25.096 UTC [29] LOG: database system was interrupted; last known up at 2023-02-03 09:34:47 UTC
db_1 | 2023-02-03 09:38:25.137 UTC [29] LOG: database system was not properly shut down; automatic recovery in progress
db_1 | 2023-02-03 09:38:25.139 UTC [29] LOG: redo starts at 8/AC83E28
db_1 | 2023-02-03 09:38:25.139 UTC [29] LOG: invalid record length at 8/AC8C0A8: wanted 24, got 0
db_1 | 2023-02-03 09:38:25.139 UTC [29] LOG: redo done at 8/AC8C080
db_1 | 2023-02-03 09:38:25.152 UTC [14] LOG: database system is ready to accept connections
db_1 | 2023-02-03 09:38:30.548 UTC [44] ERROR: duplicate key value violates unique constraint "users_email_key"
db_1 | 2023-02-03 09:38:30.548 UTC [44] DETAIL: Key (email)=(remindbot@localhost) already exists.
db_1 | 2023-02-03 09:38:30.548 UTC [44] STATEMENT: INSERT INTO Users
db_1 | (Id, CreateAt, UpdateAt, DeleteAt, Username, Password, AuthData, AuthService,
db_1 | Email, EmailVerified, Nickname, FirstName, LastName, Position, Roles, AllowMarketing,
db_1 | Props, NotifyProps, LastPasswordUpdate, LastPictureUpdate, FailedAttempts,
db_1 | Locale, Timezone, MfaActive, MfaSecret, RemoteId)
db_1 | VALUES
db_1 | ($1, $2, $3, $4, $5, $6, $7, $8,
db_1 | $9, $10, $11, $12, $13, $14, $15, $16,
db_1 | $17, $18, $19, $20, $21,
db_1 | $22, $23, $24, $25, $26)
db_1 | 2023-02-03 09:38:32.221 UTC [46] ERROR: column "dirty" does not exist at character 17
db_1 | 2023-02-03 09:38:32.221 UTC [46] STATEMENT: SELECT version, dirty FROM "public"."focalboard_schema_migrations" LIMIT 1
WEB (truncated)
$ docker-compose logs -f web
Attaching to mattermost_web_1
web_1 | linking plain config
web_1 | 2023/02/03 10:38:25 [error] 18#18: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: , request: "GET /api/v4/websocket?connection_id=mkp3yo7sitdxuny1a9ec4ei8ao&sequence_number=294 HTTP/1.1", upstream: "http://172.19.0.4:8000/api/v4/websocket?connection_id=mkp3yo7sitdxuny1a9ec4ei8ao&sequence_number=294", host: "mattermost.dsimb.inserm.fr"
My docker-compose.yaml
file:
version: "3"
services:
db:
build: db
read_only: true
restart: unless-stopped
volumes:
- ./volumes/db/13/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
environment:
- POSTGRES_USER=mmuser
- POSTGRES_PASSWORD=mmuser_password
- POSTGRES_DB=mattermost
app:
build:
context: app
# uncomment following lines for team edition or change UID/GID
args:
- edition=team
- PUID=2179
- PGID=2000
ports:
- "8443:8443/udp"
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/bleveindexes:/mattermost/bleveindexes: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
# For websocket
- MM_SERVICESETTINGS_ENABLERELIABLEWEBSOCKETS=true
# 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
web:
build: web
ports:
- "8065:8080"
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