No description
  • PHP 98.4%
  • Makefile 1.6%
Find a file
Cristian Scheid ae8694edc5
Merge pull request #184 from nextcloud/fix/182/duplicate-users
fix: add unique constraint for users.federationId and cleanup scripts for existing installations
2026-06-25 09:30:38 -03:00
.github chore: Fix psalm and lint-php workflows 2026-06-25 10:40:25 +02:00
doc 1.1.3 2026-01-20 11:16:24 -01:00
LICENSES ci(reuse): Add reuse check 2024-12-13 12:12:27 +01:00
logs LoggerService 2025-12-17 17:51:42 -01:00
server chore: Add basic workflows 2026-06-24 15:53:24 +02:00
sql fix: add unique constraint for users.federationId and cleanup scripts for existing installations 2026-06-25 06:56:37 -03:00
.gitignore LoggerService 2025-12-17 17:51:42 -01:00
AUTHORS.md docs(reuse): Add SPDX header 2024-12-13 12:12:27 +01:00
COPYING docs(reuse): Add SPDX header 2024-12-13 12:12:27 +01:00
Makefile 1.1.3.1 2026-02-17 12:01:08 -01:00
mysql.dmp fix: add unique constraint for users.federationId and cleanup scripts for existing installations 2026-06-25 06:56:37 -03:00
README.md fix: add unique constraint for users.federationId and cleanup scripts for existing installations 2026-06-25 06:56:37 -03:00
REUSE.toml chore: Fix psalm and lint-php workflows 2026-06-25 10:40:25 +02:00

Nextcloud Lookup-Server

REUSE status

What is Lookup-Server?

The Lookup-Server is a server component that can be run independently from an Nextcloud Server. This Lookup-Server can be used by Nextcloud to find remote users that can be used for federated sharing. This is useful for autocompletion in the sharing dialog to get the federation ID. Users can optionally decide to publish their sharing ID to be found by others. Think about it as a kind of public sharing telephone book.

Documentation

Please look into the doc directory for more information.

Duplicate federationId entries on users table

In some cases, due to race condition, duplicate entries may have been inserted into the users table, meaning more than one row with the same federationId. While this does not cause any critical issues, it can lead to unnecessary database growth over time.

Since this was reported, a UNIQUE KEY constraint has been added to users.federationId in mysql.dmp, preventing this from happening on new installations.

If your installation was set up before this change, two SQL scripts are available under sql/ to help you fix this:

  1. sql/cleanup_duplicate_users.sql - removes entries with duplicated federationId, keeping the most recent one
  2. sql/add_unique_federationId.sql - adds the unique constraint on users.federationId

cleanup_duplicate_users.sql should be run before add_unique_federationId.sql, since the unique constraint cannot be added while duplicates exist.

Scripts can be run like:

mysql -h database_host -u username -p database_name < sql/cleanup_duplicate_users.sql

Even though data in these tables is regenerated upon new user creation/login, it is advised to back up your database before running the scripts.

License

This code is licensed as AGPL v3 or later.

Contribute

If you want to contribute please open a pull request here on github. Every improvement is welcome.

Author

Frank Karlitschek frank@nextcloud.com