Upgrading from 16.2.4 to 16.3.0 causes mattermost to not migrate correctly and not start

Hi,

I am doing upgrades on my gitlab server, its a docker instance running on Debian 12

docker version: 24.0.5

Gitlab version installed: 16.2.4
Upgrading to: 16.3.0

Error

{"timestamp":"2023-08-28 13:41:59.098 +02:00","level":"fatal","msg":"Failed to apply database migrations.","caller":"sqlstore/store.go:173","error":"driver: postgres, message: failed to execute migration, command: executing_query, originalError: pq: canceling statement due to statement timeout, query: \n\nALTER TABLE fileinfo ADD COLUMN IF NOT EXISTS channelid varchar(26);\nUPDATE fileinfo SET channelid = posts.channelid FROM posts WHERE fileinfo.channelid IS NULL AND fileinfo.postid = posts.id;\nCREATE INDEX IF NOT EXISTS idx_fileinfo_channel_id_create_at ON fileinfo(channelid, createat);\n\n"}
{"timestamp":"2023-08-28 13:41:59.779 +02:00","level":"info","msg":"Server is initializing...","caller":"platform/service.go:172","go_version":"go1.19.5"}
{"timestamp":"2023-08-28 13:41:59.779 +02:00","level":"info","msg":"EXPERIMENTAL: Starting Bleve","caller":"bleveengine/bleve.go:185"}
{"timestamp":"2023-08-28 13:41:59.791 +02:00","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:246","database":"master","dataSource":"//%2A%2A%2A%2A:%2A%2A%2A%2A@user=gitlab_mattermost%20host=/var/opt/gitlab/postgresql%20port=5432%20dbname=mattermost_production"}
{"timestamp":"2023-08-28 13:42:10.982 +02:00","level":"info","msg":"Server is initializing...","caller":"platform/service.go:172","go_version":"go1.19.5"}
{"timestamp":"2023-08-28 13:42:10.982 +02:00","level":"info","msg":"EXPERIMENTAL: Starting Bleve","caller":"bleveengine/bleve.go:185"}
{"timestamp":"2023-08-28 13:42:11.008 +02:00","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:246","database":"master","dataSource":"//%2A%2A%2A%2A:%2A%2A%2A%2A@user=gitlab_mattermost%20host=/var/opt/gitlab/postgresql%20port=5432%20dbname=mattermost_production"}
{"timestamp":"2023-08-28 13:43:33.880 +02:00","level":"fatal","msg":"Failed to apply database migrations.","caller":"sqlstore/store.go:173","error":"driver: postgres, message: failed to execute migration, command: executing_query, originalError: pq: canceling statement due to statement timeout, query: \n\nALTER TABLE fileinfo ADD COLUMN IF NOT EXISTS channelid varchar(26);\nUPDATE fileinfo SET channelid = posts.channelid FROM posts WHERE fileinfo.channelid IS NULL AND fileinfo.postid = posts.id;\nCREATE INDEX IF NOT EXISTS idx_fileinfo_channel_id_create_at ON fileinfo(channelid, createat);\n\n"}
{"timestamp":"2023-08-28 13:43:34.739 +02:00","level":"info","msg":"Server is initializing...","caller":"platform/service.go:172","go_version":"go1.19.5"}
{"timestamp":"2023-08-28 13:43:34.739 +02:00","level":"info","msg":"EXPERIMENTAL: Starting Bleve","caller":"bleveengine/bleve.go:185"}
{"timestamp":"2023-08-28 13:43:34.758 +02:00","level":"info","msg":"Pinging SQL","caller":"sqlstore/store.go:246","database":"master","dataSource":"//%2A%2A%2A%2A:%2A%2A%2A%2A@user=gitlab_mattermost%20host=/var/opt/gitlab/postgresql%20port=5432%20dbname=mattermost_production"}

Downgrading back to 16.2.4 starts correctly.

1 Like