Can`t access Mattermost

Hi!
After updating nethserver-mattermost-1.6.7-1.ns7.x86_64 there is no way to login to Mattermost.
Searching for users via “/opt/bin/mattermost user search” says that there are no such users.
Adding a new user throws an error: “Error: Unable to create user. Error: createUser: Unable to save the account., failed to save User with userId=zdc7wrtjwbb47daw9mysrrmbdy: pq: column “remoteid” of relation “users” does not exist”

Probably the postgres database schema should have been updated?

Maybe this line from the log will help?

{“level”:“info”,“ts”:1621416665.644432,“caller”:“app/server.go:1178”,“msg”:“Server is listening on 127.0.0.1:8065”,“address”:“127.0.0.1:8065”} {“level”:“error”,“ts”:1621416665.6720333,“caller”:“app/migrations.go:318”,“msg”:“(app.App).DoPermissionsMigrations failed”,“error”:“doPermissionsMigration: Unable to
save new role., failed to update Role: pq: value too long for type character varying(4096)”}

@support_team
Can somebody help?

PG logs at the time of the MTM update

2021-05-18 08:46:32.102 MSK [27968] ERROR: relation “idx_fileinfo_name_splitted” does not exist
2021-05-18 08:46:32.102 MSK [27968] STATEMENT: SELECT $1::regclass
2021-05-18 08:46:32.109 MSK [27968] ERROR: relation “idx_sharedchannelusers_user_id” does not exist
2021-05-18 08:46:32.109 MSK [27968] STATEMENT: SELECT $1::regclass
2021-05-18 08:46:32.112 MSK [27968] ERROR: relation “idx_sharedchannelusers_remote_id” does not exist
2021-05-18 08:46:32.112 MSK [27968] STATEMENT: SELECT $1::regclass
2021-05-18 08:46:32.117 MSK [27968] ERROR: relation “remote_clusters_site_url_unique” does not exist
2021-05-18 08:46:32.117 MSK [27968] STATEMENT: SELECT $1::regclass
2021-05-18 08:46:32.237 MSK [27968] ERROR: value too long for type character varying(4096)
2021-05-18 08:46:32.237 MSK [27968] STATEMENT: update “roles” set “id”=$1, “name”=$2, “displayname”=$3, “description”=$4, “createat”=$5, “updateat”=$6, “del
eteat”=$7, “permissions”=$8, “schememanaged”=$9, “builtin”=$10 where “id”=$11;
2021-05-18 08:46:32.574 MSK [27968] ERROR: column u.remoteid does not exist at character 466
2021-05-18 08:46:32.574 MSK [27968] STATEMENT: SELECT u.Id, u.CreateAt, u.UpdateAt, u.DeleteAt, u.Username, u.Password, u.AuthData, u.AuthService, u.Email,
u.EmailVerified, u.Nickname, u.FirstName, u.LastName, u.Position, u.Roles, u.AllowMarketing, u.Props, u.NotifyProps, u.LastPasswordUpdate, u.LastPictureUpdat
e, u.FailedAttempts, u.Locale, u.Timezone, u.MfaActive, u.MfaSecret, b.UserId IS NOT NULL AS IsBot, COALESCE(b.Description, ‘’) AS BotDescription, COALESCE(b
.LastIconUpdate, 0) AS BotLastIconUpdate, u.RemoteId FROM Users u LEFT JOIN Bots b ON ( b.UserId = u.Id ) WHERE Id = $1
2021-05-18 08:46:33.174 MSK [27968] ERROR: column u.remoteid does not exist at character 466

Mattermost was migrated to postgres 12 some time ago, maybe it’s a db migration issue?

Following command lists the databases of postgres 12, does the mattermost db exist?

su - postgres -c "scl enable rh-postgresql12 -- psql --port=55434 -lqt"

Did you try to restore a working DB from a backup?

1 Like

Hi Markus!
There is no backup, this is a 'lab" for demonstrating functions and capabilities.
Small loss, but I would like to understand the problem.

I decided to check the “reverse”.

yum downgrade nethserver-mattermost-1.6.6-1.ns7.x86_64

Everything works without problems.

{“level”:“info”,“ts”:1621492567.9117353,“caller”:“app/server.go:240”,“msg”:“Server is initializing…”,“go_version”:“go1.15.5”}
{“level”:“info”,“ts”:1621492567.9117997,“caller”:“app/web_hub.go:83”,“msg”:“Starting websocket hubs”,“number_of_hubs”:16}
{“level”:“info”,“ts”:1621492567.9131,“caller”:“i18n/i18n.go:93”,“msg”:“Loaded system translations”,“for locale”:“ru”,“from locale”:“/opt/mattermost/i18n/ru.json”}
{“level”:“info”,“ts”:1621492567.9185388,“caller”:“sqlstore/store.go:270”,“msg”:“Pinging SQL”,“database”:“master”}
{“level”:“info”,“ts”:1621492567.928655,“caller”:“sqlstore/store.go:270”,“msg”:“Pinging SQL”,“database”:“migrations”}
{“level”:“info”,“ts”:1621492567.988399,“caller”:“app/license.go:67”,“msg”:“License key from https://mattermost.com required to unlock enterprise features.”}
{“level”:“info”,“ts”:1621492568.0241635,“caller”:“app/server.go:545”,“msg”:“Current version is 5.34.0 (5.34.1/Thu Apr 15 17:04:10 UTC 2021/fd6693ff5da7e0672269ada78c3
e3d408e193e98/2c294523d63cb5947ffa657f2696433772ee9746)”,“current_version”:“5.34.0”,“build_number”:“5.34.1”,“build_date”:“Thu Apr 15 17:04:10 UTC 2021”,“build_hash”:"
fd6693ff5da7e0672269ada78c3e3d408e193e98",“build_hash_enterprise”:“2c294523d63cb5947ffa657f2696433772ee9746”}
{“level”:“info”,“ts”:1621492568.024204,“caller”:“app/server.go:554”,“msg”:“Enterprise Build”,“enterprise_build”:true}
{“level”:“info”,“ts”:1621492568.0242202,“caller”:“app/server.go:560”,“msg”:“Printing current working”,“directory”:“/opt/mattermost”}
{“level”:“info”,“ts”:1621492568.0242302,“caller”:“app/server.go:561”,“msg”:“Loaded config”,“source”:“file:///opt/mattermost/config/config.json”}
{“level”:“info”,“ts”:1621492568.0691445,“caller”:“app/server.go:1019”,“msg”:“Starting Server…”}
{“level”:“info”,“ts”:1621492568.069351,“caller”:“app/server.go:1095”,“msg”:“Server is listening on 127.0.0.1:8065”,“address”:“127.0.0.1:8065”}
{“level”:“info”,“ts”:1621492568.0897224,“caller”:“mlog/log.go:218”,“msg”:“Starting up plugins”}
{“level”:“info”,“ts”:1621492568.089781,“caller”:“app/plugin.go:226”,“msg”:“Syncing plugins from the file store”}
{“level”:“info”,“ts”:1621492568.0971677,“caller”:“app/plugin.go:286”,“msg”:“Syncing plugin from file store”,“bundle”:“plugins/jitsi.tar.gz”}
{“level”:“info”,“ts”:1621492568.8837078,“caller”:“jobs/workers.go:113”,“msg”:“Starting workers”}
{“level”:“info”,“ts”:1621492568.8838782,“caller”:“jobs/schedulers.go:98”,“msg”:“Starting schedulers.”}
{“level”:“info”,“ts”:1621492568.892496,“caller”:“app/license.go:67”,“msg”:“License key from https://mattermost.com required to unlock enterprise features.”}
{“level”:“info”,“ts”:1621492602.0760279,“caller”:“sqlstore/post_store.go:1866”,“msg”:“Post.Message has size restrictions”,“max_characters”:16383,“max_bytes”:65535}

Hi!
Upgrade via version, from nethserver-mattermost-1.6.6-1.ns7.x86_64 to nethserver-mattermost-1.6.8-1.ns7.x86_64. Problem solved!

2 Likes