Troubleshoot trusted servers address book sync
Trusted servers / Federation allows you to connect Nextcloud instances and exchange address books. This makes it easier to share files since users can be autocompleted.
Problem 1: Address Book Not Fully Synced
Issue: The address book is not completely synced, and some users are not visible for autocompletion on the federated instance.
Next Steps:
Check logs for any errors related to the sync process. For example by grepping the nextcloud log for fed-sync and federation. Tip: Append |jq to format the log lines
grep '"app":"fed-sync"' data/nextcloud.log
grep '"app":"federation"' data/nextcloud.log
Manually trigger a sync to verify if the issue persists.
occ federation:sync-addressbooks
Problem 2: Sync Timeout Error
Issue: Encountering the error "Error while syncing https://example.org : cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received" when running "occ federation:sync-addressbooks".
Explanation: The remote server did not respond to the sync request within 30 seconds. This can occur in installations with many users, where collecting all address book changes takes longer.
Solution:
Since Nextcloud 31, it is possible to set a higher timeout for sync requests. You can do this via the command line:
php occ config:system:set --type integer --value 120 carddav_sync_request_timeout
Or by editing the config.php file:
'carddav_sync_request_timeout' => 120,
Problem 3: Internal Server Error on Remote
Issue: Encountering the error "Error while syncing https://example.org : Server error: REPORT https://example.org/remote.php/dav/addressbooks/system/system/system resulted in a 500 Internal Server Error response" when running "occ federation:sync-addressbooks".
Explanation: The remote server responded with an internal server error.
Solution:
- Contact the administrator of the remote instance and ask them to check their logs for errors.
- A common problem is that the memory limit is set too low, often indicated by an error like "Allowed memory size of xyz bytes exhausted". The administrator should try increasing the memory limit.
Problem 4: Connection Interruption During Sync
Issue: Encountering the error "Error while syncing https://example.org: cURL error 56: Recv failure: Connection reset by peer" when running "occ federation:sync-addressbooks".
Explanation: The network connection was interrupted during the update of vcards.
Solution:
Rerunning the command "occ federation:sync-addressbooks" is usually sufficient to resolve this problem.
Problem 5: Allowed memory size exhausted
Issue: Encounter an error like "Allowed memory size of xyz bytes exhausted in sabre/vobject/lib/Parser/MimeDir.php" (the message was shortened for brevity) when running "occ federation:sync-addressbooks".
Explanation: The local instance, that initiated the sync, ran out of memory while processing the result. That can happen with larger user directories.
Solution:
Increase the memory limit. For occ commands and background jobs executed through the system's cron daemon, php's configuration file for cli is usually the right place to do so.
It's also possible to only increase the memory limit temporarily for running occ commands, but keep in mind there's also an automated background job, running the sync that also needs a higher memory limit.
php -d memory_limit=2048M /path/to/nextcloud/occ federation:sync-addressbooks
Subscriber exclusive content
A Nextcloud Enterprise Subscription provides unlimited access to our knowledge base articles and direct access to Nextcloud engineers.