Description:
I am experiencing issues synchronizing Anki with my self-hosted sync server. The error message suggests replacing “0.0.0.0” with my machine’s IP address, but I am unsure how to proceed. Additionally, I have set the environment variable SYNC_USER1 to user1:1234, but the problem persists. I have also tried the “Check Database” feature in Anki, but the issue remains unresolved. Furthermore, I am encountering an error related to sync/hostKey. Could anyone provide guidance on how to resolve this synchronization problem?
Steps Taken:
Set the environment variable SYNC_USER1 to user1:1234.
Attempted to start the sync server using the command: python -m anki.syncserver.
Encountered the error message: “Replace 0.0.0.0 with your machine’s IP address (perhaps 127.0.1.1)”.
Tried using the “Check Database” feature in Anki, but the issue persists.
Encountered an error related to sync/hostKey.
Additional Information:
The sync server is listening on http://0.0.0.0:8080/sync/.
The server’s hostname is ip-172-26-7-140.
The environment variable SYNC_USER1 is set correctly, as confirmed by running a Python script that prints the value of SYNC_USER1.
I would appreciate any assistance or suggestions to resolve this issue.
I attempted to follow the suggestion of setting the SYNC_HOST environment variable to the server’s IP address, but the problem persists.
Below is the full log of my attempts:
(syncserver) root@ip-172-26-7-140:~# python -m anki.syncserver
Sync server listening on 0.0.0.0:8080/sync/
Replace 0.0.0.0 with your machine’s IP address (perhaps 127.0.1.1)
For more info, see github.com/ankitects/anki/blob/master/docs/syncserver.md
1735042194 192.168.30.201 sync/hostKey
^C(syncserver) root@ip-172-26-7-140:~# export SYNC_HOST=192.168.30.2
(syncserver) root@ip-172-26-7-140:~# python -m anki.syncserver
Sync server listening on 0.0.0.0:8080/sync/
Replace 0.0.0.0 with your machine’s IP address (perhaps 127.0.1.1)
For more info, see github.com/ankitects/anki/blob/master/docs/syncserver.md
1735042221 192.168.30.201 sync/hostKey
^C(syncserver) root@ip-172-26-7-140:~#
Despite setting SYNC_HOST to 0.0.0.0 and then to 192.168.30.2 (the server’s IP address), the sync server always logs sync/hostKey when I attempt a connection from a client.
The Anki client also shows the following error message:
Please use the “Check Database” function under the Tools menu, then try syncing again. If problems persist, please change the sync mode to one-way in the Preferences screen and force a full sync.
Is there something I’m missing in the configuration? Or is there a different step I should follow to resolve this issue? Any help would be appreciated.
I’ve updated both the Anki client and the sync server to the latest version, but unfortunately, the issue persists. Here are the steps I’ve taken:
Set the SYNC_HOST environment variable to the server’s IP address (192.168.30.2).
Verified that the SYNC_USER1 environment variable is correctly configured as user1:1234.
Restarted the server and attempted synchronization from the client.
However, the server logs continue to show the sync/hostKey error, and the client displays a message suggesting database checking or performing a one-way sync.
Could you please clarify the following points?
Are there any known compatibility issues between the latest versions of the client and the server?
Could this issue be caused by networking or firewall settings on the host machine?
I would greatly appreciate any further guidance on resolving this issue. Thank you!
You should not get that error if your server is up-to-date. I suggest you double-check that everything is indeed running the latest version as shown on the Anki website, especially if you’re using a distro-provided version of Anki.