Summary
Error during installation over existant database
Steps to reproduce
mattermost-omnibus/jammy 10.6.1-0 amd64
Observed behavior
I am a very happy user of mattermost which was installed since many years with tgz
Unfortunatly, my server crashes with a RAID issue.
Il restore the backuped databases including mattermost but the software mattermost was not backuped.
So, I install the package from my distribution Ubuntu 22.04 (mattermost-omnibus/jammy 10.6.1-0 amd64
), setup with my config.json but during the setup, I have the following error message
Apr 05 18:26:06 2D17911 systemd[1]: Starting Mattermost...
Apr 05 18:26:06 2D17911 mattermost[268182]: {"timestamp":"2025-04-05 18:26:06.519 +02:00","level":"info","msg":"Successfully connected to cache backend","caller":"platform/service.go:193","backend":"lru","result":"OK"}
Apr 05 18:26:06 2D17911 mattermost[268182]: {"timestamp":"2025-04-05 18:26:06.519 +02:00","level":"info","msg":"Server is initializing...","caller":"platform/service.go:196","go_version":"go1.22.6"}
Apr 05 18:26:06 2D17911 mattermost[268182]: {"timestamp":"2025-04-05 18:26:06.520 +02:00","level":"info","msg":"Pinging SQL","caller":"sql/sql_utils.go:68","database":"master","dataSource":"postgres://%2A%2A%2A%2A:%2A%2A%2A%2A@127.0.0.1:5432/mattermost?connect_timeout=10&sslmode=disable"}
Apr 05 18:26:06 2D17911 mattermost[268182]: Error: failed to initialize platform: cannot create store: failed to apply database migrations: driver: postgres, message: failed to execute migration, command: executing_query, originalError: pq: type "outgoingoauthconnections_granttype" already exists, query:
Apr 05 18:26:06 2D17911 mattermost[268182]: CREATE TYPE outgoingoauthconnections_granttype AS ENUM ('client_credentials', 'password');
Apr 05 18:26:06 2D17911 mattermost[268182]: CREATE TABLE IF NOT EXISTS outgoingoauthconnections (
Apr 05 18:26:06 2D17911 mattermost[268182]: id varchar(26) PRIMARY KEY,
Apr 05 18:26:06 2D17911 mattermost[268182]: name varchar(64),
Apr 05 18:26:06 2D17911 mattermost[268182]: creatorid VARCHAR(26),
Apr 05 18:26:06 2D17911 mattermost[268182]: createat bigint,
Apr 05 18:26:06 2D17911 mattermost[268182]: updateat bigint,
Apr 05 18:26:06 2D17911 mattermost[268182]: clientid varchar(255),
Apr 05 18:26:06 2D17911 mattermost[268182]: clientsecret varchar(255),
Apr 05 18:26:06 2D17911 mattermost[268182]: credentialsusername varchar(255),
Apr 05 18:26:06 2D17911 mattermost[268182]: credentialspassword varchar(255),
Apr 05 18:26:06 2D17911 mattermost[268182]: oauthtokenurl text,
Apr 05 18:26:06 2D17911 mattermost[268182]: granttype outgoingoauthconnections_granttype DEFAULT 'client_credentials',
Apr 05 18:26:06 2D17911 mattermost[268182]: audiences VARCHAR(1024)
Apr 05 18:26:06 2D17911 mattermost[268182]: );
Apr 05 18:26:06 2D17911 mattermost[268182]: CREATE INDEX IF NOT EXISTS idx_outgoingoauthconnections_name ON outgoingoauthconnections (name);
Apr 05 18:26:06 2D17911 mattermost[268182]: {"timestamp":"2025-04-05 18:26:06.586 +02:00","level":"error","msg":"failed to initialize platform: cannot create store: failed to apply database migrations: driver: postgres, message: failed to execute migration, command: executing_query, originalError: pq: type \"outgoingoauthconnections_granttype\" already exists, query: \n\nCREATE TYPE outgoingoauthconnections_granttype AS ENUM ('client_credentials', 'password');\n\nCREATE TABLE IF NOT EXISTS outgoingoauthconnections (\n id varchar(26) PRIMARY KEY,\n name varchar(64),\n creatorid VARCHAR(26),\n createat bigint,\n updateat bigint,\n clientid varchar(255),\n clientsecret varchar(255),\n credentialsusername varchar(255),\n credentialspassword varchar(255),\n oauthtokenurl text,\n granttype outgoingoauthconnections_granttype DEFAULT 'client_credentials',\n audiences VARCHAR(1024)\n);\n\nCREATE INDEX IF NOT EXISTS idx_outgoingoauthconnections_name ON outgoingoauthconnections (name);\n\n","caller":"commands/server.go:75"}
How can I solve the issue ?
thanks for your tips,