Local sync server: collection exceeds size limit

Hello,

I have read the guide on how to set up a local sync server with Anki 2.1.57, thanks for adding this feature.

I have been able to get it syncing with small decks. However, I tried uploading a large deck (~350 MB) after setting the environment variable MAX_SYNC_UPLOAD_MEGS=1000.

I tried doing this two ways, one was with the command to start the server:

SYNC_USER1=user:pass MAX_SYNC_UPLOAD_MEGS=1000 anki --syncserver

The other was by setting the environment variable separately:

export MAX_SYNC_UPLOAD_MEGS=1000

But I get the error message either way. Am I doing something wrong?

Thanks!

The docs are wrong, it should be MAX_SYNC_PAYLOAD_MEGS.

I made the change. It looks like it it passed the check, however I do get a timeout error, can I adjust the timeout in anyway?

Oddly enough, after checking the .syncserver folder, my db is there, and looks to be the right size, although the media folder is empty. The usual log messages didn’t print in the terminal. When I hit sync again, I’m sometimes able to get the rest of the sync going, although other times, the timeout issue happens again.

If you temporarily disable media syncing in the preferences, does the full upload succeed? The file has to be checked after it’s uploaded, and that will take some time with large collections/slower devices. While that’s happening it will block media syncing, which is what could be timing out.

I tried disabling the media sync, but still got a timeout. I’ll try increasing the horsepower of the machine tomorrow to see what happens.

In the meantime, I did try another thing while testing this all out. I added a new user profile and tried to sync, but got some kind of corruption error:

But, then I just tried copying the db files manually from one profile to another, and afterwards I was able to sync stuff normally, like creating decks/cards worked.

The download-failing issue can be worked around for now by setting MAX_SYNC_PAYLOAD_MEGS for the client as well. It wasn’t intended to enforce the limit on the client, and I’ll look into fixing this in the next update.

When you upload, what does elap_ms show in the logs? On a desktop machine with a 500MB test collection, I see about 1800ms.

I upgraded my setup, I’m doing this on a virtual machine with 32GB ram. Without syncing media, I first receive the timeout message:

Then, after hitting “OK”, I see a temp file created when I’m watching the folder, and then the db files appear. Then I see another log message print, elap_ms=157236 for me:

After this, things seem to sync normally for me.

The next update will include an option in the preferences to increase the timeout.

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