[Solved] PostgreSQL error after Mattermost upgrade from 3.2.0 to 3.4.0: some relation does not exist

This is my PostgreSQL error when I upgrade Mattermost from 3.2.0 to 3.4.0:

Creating mattermostdocker2_db_1
Creating mattermostdocker2_app_1
Creating mattermostdocker2_web_1
Attaching to mattermostdocker2_db_1, mattermostdocker2_app_1, mattermostdocker2_web_1
db_1   | AWS_ACCESS_KEY_ID is required for Wal-E but not set. Skipping Wal-E setup.
db_1   | LOG:  database system was interrupted; last known up at 2016-10-26 22:41:31 CEST
db_1   | LOG:  incomplete startup packet
app_1  | Configure database connection...SKIP
db_1   | LOG:  database system was not properly shut down; automatic recovery in progress
app_1  | Wait until database db:5432 is ready...
db_1   | LOG:  redo starts at 128/74000090
db_1   | LOG:  record with zero length at 128/74005968
db_1   | LOG:  redo done at 128/74005938
db_1   | LOG:  last completed transaction was at log time 2016-10-26 22:41:35.588616+02
db_1   | LOG:  MultiXact member wraparound protections are now enabled
db_1   | LOG:  autovacuum launcher started
db_1   | LOG:  database system is ready to accept connections
web_1  | Starting Nginx
app_1  | Starting platform
db_1   | ERROR:  relation "idx_oauthaccessdata_client_id" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_oauthaccessdata_user_id" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_oauthaccessdata_refresh_token" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_status_user_id" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_status_status" does not exist
db_1   | STATEMENT:  SELECT $1::regclass

After upgrade, all user account are unknown.

What is my mistake ?

Best regards,
Stéphane

Hi Stephane,

I had some trouble doing a direct upgrade aswell.
My problem was fixed by first upgrading to 3.3 and then to 3.4.

Same error when I upgrade from 3.2.0 to 3.3.0:

root@santa-maria:~/mattermost-docker2# docker-compose up
Starting mattermostdocker2_db_1
Recreating mattermostdocker2_app_1
Recreating mattermostdocker2_web_1
Attaching to mattermostdocker2_db_1, mattermostdocker2_app_1, mattermostdocker2_web_1
app_1  | Configure database connection...SKIP
app_1  | Wait until database db:5432 is ready...
db_1   | AWS_ACCESS_KEY_ID is required for Wal-E but not set. Skipping Wal-E setup.
db_1   | LOG:  database system was interrupted; last known up at 2016-10-26 21:52:01 CEST
web_1  | Starting Nginx
db_1   | LOG:  database system was not properly shut down; automatic recovery in progress
db_1   | LOG:  redo starts at 128/71000090
db_1   | LOG:  record with zero length at 128/730000B8
db_1   | LOG:  redo done at 128/73000088
db_1   | LOG:  last completed transaction was at log time 2016-10-26 21:54:08.393664+02
db_1   | LOG:  MultiXact member wraparound protections are now enabled
db_1   | LOG:  database system is ready to accept connections
db_1   | LOG:  autovacuum launcher started
db_1   | LOG:  incomplete startup packet
app_1  | Starting platform
db_1   | ERROR:  relation "idx_oauthaccessdata_client_id" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_oauthaccessdata_user_id" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_oauthaccessdata_refresh_token" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_status_user_id" does not exist
db_1   | STATEMENT:  SELECT $1::regclass
db_1   | ERROR:  relation "idx_status_status" does not exist
db_1   | STATEMENT:  SELECT $1::regclass

I don’t understand, I’ve always this error but now all work great :slight_smile: