Board Plugin is not started

For feature requests, please see: http://www.mattermost.org/feature-requests/.

For troubleshooting questions, please post in the following format:

Summary

Installation
Mattermost 7.4.0 (upgraded in one step from Mattermost 6.x.x version number not exactly known.)
Postgres 10.22
nginx 1.18.10
Client: Safari, Mattermost Client OSX

The error message
originalError: pq: cannot delete from scalar

can be found once in this forum, but the topic here is a migration from MariaDB to Postgres

Steps to reproduce

see observed behavior. Installation is on a production machine, do not have a second machine to test in more detail.

Expected behavior

Can use standard Board Plugin after upgrade to 7.4 first time.

Observed behavior
I upgraded from 6.x to 7.4.
I tried to use the Board plugin (first time) but i did not find it.
(i do not know wether board plugin was running with the 6.x)
Board Plugin is enabled in the system console.

The logfile states the following migration error

{
  "timestamp": "2022-11-01 12:08:11.866 +01:00",
  "level": "error",
  "msg": "Unable to activate plugin",
  "caller": "app/plugin.go:165",
  "plugin_id": "focalboard",
  "error": "cannot activate plugin: error initializing the DB: driver: postgres, 
  message: failed to execute migration, 
  command: executing_query, 
  originalError: pq: cannot delete from scalar, 
  query: \n\n\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'welcomePageViewed', replace((Props->'focalboard_welcomePageViewed')::varchar, '\"', '') FROM Users WHERE Props->'focalboard_welcomePageViewed' IS NOT NULL ON CONFLICT DO NOTHING;\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'hiddenBoardIDs', replace(replace(replace((Props->'hiddenBoardIDs')::varchar, '\"[', '['), ']\"', ']'), '\\\"', '\"') FROM Users WHERE Props->'hiddenBoardIDs' IS NOT NULL ON CONFLICT DO NOTHING;\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'tourCategory', replace((Props->'focalboard_tourCategory')::varchar, '\"', '') FROM Users WHERE Props->'focalboard_tourCategory' IS NOT NULL ON CONFLICT DO NOTHING;\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'onboardingTourStep', replace((Props->'focalboard_onboardingTourStep')::varchar, '\"', '') FROM Users WHERE Props->'focalboard_onboardingTourStep' IS NOT NULL ON CONFLICT DO NOTHING;\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'onboardingTourStarted', replace((Props->'focalboard_onboardingTourStarted')::varchar, '\"', '') FROM Users WHERE Props->'focalboard_onboardingTourStarted' IS NOT NULL ON CONFLICT DO NOTHING;\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'version72MessageCanceled', replace((Props->'focalboard_version72MessageCanceled')::varchar, '\"', '') FROM Users WHERE Props->'focalboard_version72MessageCanceled' IS NOT NULL ON CONFLICT DO NOTHING;\n        INSERT INTO Preferences (UserId, Category, Name, Value) SELECT Id, 'focalboard', 'lastWelcomeVersion', replace((Props->'focalboard_lastWelcomeVersion')::varchar, '\"', '') FROM Users WHERE Props->'focalboard_lastWelcomeVersion' IS NOT NULL ON CONFLICT DO NOTHING;\n\n        UPDATE Users SET props = (props - 'focalboard_welcomePageViewed' - 'hiddenBoardIDs' - 'focalboard_tourCategory' - 'focalboard_onboardingTourStep' - 'focalboard_onboardingTourStarted' - 'focalboard_version72MessageCanceled' - 'focalboard_lastWelcomeVersion');\n    \n\n    \n\n    \n\n\n"
}

1 Like

@TheFive: This looks more and more like a bug in either Mattermost, Mattermost Boards or a preceeding DM migration script to me…

The workaround with the manual UPDATE command mentioned in the thread you linked should help.

Nevertheless, you should add a bug report for this on GitHub. This seems to bite quite a few MM self-hosting users which use PostgreSQL…

Thank you, the mentioned SQL statement worked.

The Bug Report can be found here:

JFYI, this was fixed by make sure users.props contains a hash! by oetiker · Pull Request #4029 · mattermost/focalboard · GitHub.