I wouldn’t ignore this error message, as it could raise errors in the future.
If you run the following command:
sudo sqlite3 /home/user-data/owncloud/owncloud.db "SELECT * FROM oc_users_external;"
you’ll see there are duplicate users in the database.
user1@domain.tld|{127.0.0.1:993/imap/ssl/novalidate-cert}|
user2@domain.tld|{127.0.0.1:993/imap/ssl/novalidate-cert}|
user3@domain.tld|{127.0.0.1:993/imap/ssl/novalidate-cert}|
user4@domain.tld|{127.0.0.1:993/imap/ssl/novalidate-cert}|
user5@domain.tld|{127.0.0.1:993/imap/ssl/novalidate-cert}|
...
user1@domain.tld|127.0.0.1|
user2@domain.tld|127.0.0.1|
user3@domain.tld|127.0.0.1|
user4@domain.tld|127.0.0.1|
user5@domain.tld|127.0.0.1|
If you don’t see duplicates, then maybe the error is related to something else,
but if you do see duplicates then let’s fix this error, since the solution is simple.
- Make a backup copy of the database:
sudo cp /home/user-data/owncloud/owncloud.db /home/user-data/owncloud/owncloud.db.backup
- Find and remove the duplicate entries:
sudo sqlite3 /home/user-data/owncloud/owncloud.db "DELETE FROM oc_users_external WHERE EXISTS (SELECT 1 FROM oc_users_external p2 WHERE oc_users_external.uid = p2.uid AND oc_users_external.rowid > p2.rowid);"
- Replace the {127.0.0.1:993/imap/ssl/novalidate-cert} with 127.0.0.1:
sudo sqlite3 /home/user-data/owncloud/owncloud.db "UPDATE oc_users_external SET backend='127.0.0.1';"
- Check if all duplicates are gone and the “backend” column is set to 127.0.0.1:
sudo sqlite3 /home/user-data/owncloud/owncloud.db "SELECT * FROM oc_users_external;"
- Just in case, we’ll restart php8.0-fpm.service (not sure if necessary).
sudo systemctl restart php8.0-fpm.service
If all goes well, you’ll now end up with a clean database with no duplicate entries that could raise errors in the future.