Ankimobile Self Sync Server failure (the one bundled in Version 2.1.60-qt6)

I’ve recently setup an sync server on my desktop machine as per the instructions in Self-Hosted Sync Server in the Anki Manual.

I’m running Ubuntu 22.04LTS on the desktop machine (server) and have enabled the firewall to all local traffic. (e.g. sudo ufw allow from 192.168.0.0/24). The server is working. I am able to sync to it from the desktop running the server as well as my Microsoft Surface 7 running Ubuntu 20.04LTS on the same LAN.

The issue I am having is with my iphone 13 (iOS 15.5) running Ankimobile 2.0.90(20090.2). When I try to sync using the same settings as my Surface which works (e.g. Self-hosted sync server: http://192.168.0.211:8080/ ) my sync fails with the following message (typed out verbatim):

Error A network error occurred. Error details: error sending request for url (): error trying to connect: tcp connect error: No route to host (os error 65)

My server launch command is: SYNC_HOST=192.168.0.211 SYNC_USER1=Ben:test anki --syncserver

Server is at the static IP of: 192.168.0.211

ss -tulpn on the server gives:
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
tcp LISTEN 0 128 192.168.0.211:8080 0.0.0.0:* users:((“anki”,pid=3612,fd=12))

sudo ufw status on the server gives:
To Action From


8080 ALLOW 192.168.0.0/24
8080/tcp ALLOW Anywhere
Anywhere ALLOW 192.168.0.0/24
8080/tcp (v6) ALLOW Anywhere (v6)

It seems the issue is with my iphone (since the Surface running Ubuntu is correctly syncing with the current server settings on the other Ubuntu machine). Has anyone had similar trouble getting Ankimobile to sync over a LAN? Is there some setting on the iphone that needs to be enabled/disabled to allow it to communicate out to the LAN as one would expect?

I tend to do the majority of my reviewing on my phone, so any feedback would be greatly appreciated!

What happens if you temporarily enable airplane mode and turn wifi back on? Your settings look correct, and local network syncing works on a test device here.

What happens if you run ‘python -m http.server’ on the server, then visit 192.168.0.211:8000 in Safari?

Thanks for getting back to me Damien.

Airplane mode + turning the wifi back on yielded no further results. I then ran ‘python3.11 -m http.server’ on the server and was able to see the contents of my /home directory (of the server) within safari (on the iphone.) I tried removing then re-installing Anki on the iphone. After doing this when trying to sync, my phone prompted me to (I forget the message verbatim, but something along the lines of) “Give anki access to local area network.” This still didn’t work. I then went to setting>Anki on the iphone and turned off “Allow Anki to access local network” then turned it back on. The iphone then successfully synced with the server.

I wrote out that long winded set of steps, just in case someone else encounters a similar situation (and to be honest, I’m not entirely sure which steps helped/didn’t help.) It is however now successfully syncing! Thank again for the suggestions. Your app has changed my life.

Cheers

1 Like

Glad to hear you were able to resolve the issue; I’ve added a note about this to the syncing docs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.