Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

duplicate key value violates unique constraint "users_username_key" #198

Open
jwillmer opened this issue Apr 20, 2021 · 1 comment
Open

Comments

@jwillmer
Copy link

Summary

I upgraded Mattermost to 5.34. This also required switching (upgrading) Postgres. Now this app throws the following error on startup:

2021-04-20 21:16:28.272 CEST [34] ERROR:  duplicate key value violates unique constraint "users_username_key"
2021-04-20 21:16:28.272 CEST [34] DETAIL:  Key (username)=(remindbot) already exists.
2021-04-20 21:16:28.272 CEST [34] STATEMENT:  insert into "users" ("id","createat","updateat","deleteat","username","password","authdata","authservice","email","emailverified","nickname","firstname","lastname","position","roles","allowmarketing","props","notifyprops","lastpasswordupdate","lastpictureupdate","failedattempts","locale","timezone","mfaactive","mfasecret") values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25);

Reinstalling the plugin did not help. Since it prevents the start from all other plugins I need to remove this plugin.

Steps to reproduce

Steps to reproduce the behavior:

  1. Upgrade Mattermost and db via script
  2. Start server

Server configuration

Operating system:

Mattermost version: mattermost-team-edition:5.34

Remind version: 0.4.4

Updated from an older Remind bot version or fresh install:
Server upgrade.

@jwillmer
Copy link
Author

I fixed it by:

  1. removing the plugin from Mattermost
  2. converting the (still existing) bot user to a real user
  3. deleting the user
  4. reinstalling the plugin

I leave this bug open. Maybe some dev knows how to prevent this issue in the first place?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant