Docker mattermost on EC2 + postgres RDS instances here…
When trying to upgrade to 6.4, 6.7, 7.0 or 7.1, in all cases I get the error:
docker-compose -f docker-compose.yml -f docker-compose.without-nginx.yml up
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Creating network "mattermost_default" with the default driver
Pulling mattermost (mattermost/mattermost-team-edition:7.0)...
7.0: Pulling from mattermost/mattermost-team-edition
Digest: sha256:e8b7c441dafa159ff75ad40ef43e5377f20d0e3d0063b18d624568f3dbb1a1ac
Status: Downloaded newer image for mattermost/mattermost-team-edition:7.0
Creating mattermost_mattermost_1 ...
Attaching to mattermost_mattermost_1
mattermost_1 | {"timestamp":"2022-07-27 16:44:27.109 Z","level":"info","msg":"Server is initializing...","caller":"app/server.go:258","go_version":"go1.18.1"}
mattermost_1 | {"timestamp":"2022-07-27 16:44:27.109 Z","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:225","database":"master"}
mattermost_1 | {"timestamp":"2022-07-27 16:44:27.136 Z","level":"fatal","msg":"Failed to apply database migrations.","caller":"sqlstore/store.go:162","error":"driver: postgres, message: failed to execute migration, command: executing_query, originalError: pq: multiple primary keys for table \"reactions\" are not allowed, query: \n\nCREATE TABLE IF NOT EXISTS reactions(\n userid VARCHAR(26) NOT NULL,\n postid VARCHAR(26) NOT NULL,\n emojiname VARCHAR(64) NOT NULL,\n createat bigint\n);\n\nALTER TABLE reactions ADD COLUMN IF NOT EXISTS updateat bigint;\nALTER TABLE reactions ADD COLUMN IF NOT EXISTS deleteat bigint;\n\nDO $$\n<<alter_pk>>\nDECLARE\n existing_index text;\nBEGIN\n SELECT string_agg(a.attname, ',') INTO existing_index\n FROM pg_constraint AS c\n CROSS JOIN\n (SELECT unnest(conkey) FROM pg_constraint WHERE conrelid = 'reactions'::regclass AND contype='p') AS cols(colnum)\n INNER JOIN pg_attribute AS a ON a.attrelid = c.conrelid AND cols.colnum = a.attnum\n WHERE c.contype = 'p'\n AND c.conrelid = 'reactions'::regclass;\n\n IF COALESCE (existing_index, '') <> text('postid,userid,emojiname') THEN\n ALTER TABLE reactions\n DROP CONSTRAINT IF EXISTS reactions_pkey,\n ADD PRIMARY KEY (postid, userid, emojiname);\n END IF;\nEND alter_pk $$;\n\nALTER TABLE reactions ADD COLUMN IF NOT EXISTS remoteid VARCHAR(26);\n\n"}
mattermost_1 | {"timestamp":"2022-07-27 16:44:28.594 Z","level":"info","msg":"Server is initializing...","caller":"app/server.go:258","go_version":"go1.18.1"}
mattermost_1 | {"timestamp":"2022-07-27 16:44:28.594 Z","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:225","database":"master"}
mattermost_1 | {"timestamp":"2022-07-27 16:44:28.623 Z","level":"fatal","msg":"Failed to apply database migrations.","caller":"sqlstore/store.go:162","error":"driver: postgres, message: failed to execute migration, command: executing_query, originalError: pq: multiple primary keys for table \"reactions\" are not allowed, query: \n\nCREATE TABLE IF NOT EXISTS reactions(\n userid VARCHAR(26) NOT NULL,\n postid VARCHAR(26) NOT NULL,\n emojiname VARCHAR(64) NOT NULL,\n createat bigint\n);\n\nALTER TABLE reactions ADD COLUMN IF NOT EXISTS updateat bigint;\nALTER TABLE reactions ADD COLUMN IF NOT EXISTS deleteat bigint;\n\nDO $$\n<<alter_pk>>\nDECLARE\n existing_index text;\nBEGIN\n SELECT string_agg(a.attname, ',') INTO existing_index\n FROM pg_constraint AS c\n CROSS JOIN\n (SELECT unnest(conkey) FROM pg_constraint WHERE conrelid = 'reactions'::regclass AND contype='p') AS cols(colnum)\n INNER JOIN pg_attribute AS a ON a.attrelid = c.conrelid AND cols.colnum = a.attnum\n WHERE c.contype = 'p'\n AND c.conrelid = 'reactions'::regclass;\n\n IF COALESCE (existing_index, '') <> text('postid,userid,emojiname') THEN\n ALTER TABLE reactions\n DROP CONSTRAINT IF EXISTS reactions_pkey,\n ADD PRIMARY KEY (postid, userid, emojiname);\n END IF;\nEND alter_pk $$;\n\nALTER TABLE reactions ADD COLUMN IF NOT EXISTS remoteid VARCHAR(26);\n\n"}
mattermost_mattermost_1 exited with code 1