while upgrading to 3.1.0.beta4 I got the following error
I, [2023-04-19T00:02:26.057232 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-04-19T00:02:27.340128 #1] INFO -- : discourse-adplugin is already at latest compatible version
discourse-cakeday is already at latest compatible version
discourse-formatting-toolbar is already at latest compatible version
discourse-whos-online is already at latest compatible version
docker_manager is already at latest compatible version
vbulletin-bbcode is already at latest compatible version
I, [2023-04-19T00:02:27.340368 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
2023-04-19 00:02:30.080 UTC [634] discourse@discourse ERROR: duplicate key value violates unique constraint "index_users_on_username"
2023-04-19 00:02:30.080 UTC [634] discourse@discourse DETAIL: Key (username)=(xxx) already exists.
2023-04-19 00:02:30.080 UTC [634] discourse@discourse STATEMENT: UPDATE users SET password_algorithm = '$pbkdf2-sha256$i=64000,l=32$'
WHERE id IN (
SELECT id FROM users
WHERE users.password_hash IS NOT NULL
AND users.password_algorithm IS NULL
LIMIT 5000
)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_users_on_username"
DETAIL: Key (username)=(xxx) already exists.
After fixing the duplicate users, I get again new ones.
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(mhm) is duplicated.
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(ahmedhafez) is duplicated.
CONTEXT: parallel worker
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(hany) is duplicated.
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(eng_ali) is duplicated.
CONTEXT: parallel worker
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(saad_saad) is duplicated.
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(eng_ali) is duplicated.
CONTEXT: parallel worker
discourse=# REINDEX TABLE users;
ERROR: could not create unique index "index_users_on_username_lower"
DETAIL: Key (username_lower)=(mostafa11) is duplicated.
CONTEXT: parallel worker