Media sync fails

Hello, I have been experiencing some issues with syncing media to ankiserver. I can download media from Anki server without any problem on both Ankidroid and anki desktop, but when I try to UPLOAD media to ankiserver, I get various errors on both devices. This happens even when I add just one small image to one card. I have tried many solutions such as changing network, clearing proxies and using VPNs, but none of them worked. I can upload images and audios to other websites without any problem, but I can’t sync(upload media) with anki anymore.

I wonder if there is something wrong with anki servers or their data transfer methods that needs to be fixed. I would appreciate it if you could look into this issue and resolve it.

P.S. I have checked packet loss for a few sites that I upload images and audios to, and even though there is some packet loss with them, I can still upload to them successfully. So I don’t think packet loss is the main cause of this problem. Thank you for your attention and assistance.

Could you add some error details as well?

Anki is a bit shy when it comes to explaining its errors :smile:

error

error2

debug info
Anki 2.1.64 (581f82c5) Python 3.9.15 Qt 5.15.2 PyQt 5.15.5
Platform: Windows-10-10.0.19045
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-05-27 10:59:10

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
Anki-redesign ['308574457', 2023-02-04T22:13, 'None', mod]
Customize Keyboard Shortcuts ['24411424', 2022-09-14T12:42, 'None', mod]
Editor Live Preview ['1960039667', 2023-03-24T20:05, 'None', mod]
HTML Colored-Section- Details- and List-Buttons ['211947030', 2022-03-20T19:52, 'None', '']
Just Mono ['1667271833', 2021-02-19T02:35, 'None', '']
Life Drain ['715575551', 2022-09-18T14:12, 'None', mod]
Mini Format Pack ['295889520', 2018-07-24T21:15, 'None', '']
Quick Colour Changing ['2491935955', 2022-07-24T07:59, 'None', mod]
Review Heatmap ['1771074083', 2022-06-30T05:13, 'None', '']
ZzLegacy Spelling Police ['1410276506', 2020-03-03T05:43, 'None', mod]

===IDs of active AnkiWeb add-ons===
1410276506 1667271833 1771074083 1960039667 211947030 24411424 2491935955 295889520 308574457 715575551

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

I guess you have no self hosted sync server?
Also, if both devices are similar set up, is there a firewall blocking uploads or similar?
Else it would be useful to know if the errors are the same on both devices at all times.

You could also try to check the database or media, but I don’t think it will solve this.

1 Like

No, I am not even familiar with using a self-hosted server.

I have inspected my firewall settings and found no indication of Anki being blocked.

I make my cards on Anki desktop and synchronize them with Ankidroid, only the cards themselves are synced without their corresponding media files. After following this procedure, AnkiDroid does not display any errors while syncing. However, upon accessing cards containing media, an error similar to the following error is displayed:
ankidroid_error

Despite my effort to try these, it did not prove to be helpful in resolving the issue.

In a scenario where there are no unused or missing files and the database has been checked, even adding a small image to any card and then checking media and database, any attempt to sync media will fail. Similarly, adding a new card with a small image and following the same procedure will result in semi_successful syncing: new card will be upload but it’s media will not.

There are a few scenarios I can imagine with that:

  • An Addon is interfering with the media upload
  • Something else is blocking the media upload. If the media upload is to a different IP Address than the card upload, what I don’t know, it could be also blocked by your router or something else.
  • Your media file system is corrupted. The solution here would be to do a remove sync, so all media is removed from the sync server, then check your media again for full correctness
  • Your anki installation is corrupted

But keep in mind I just have some programming experience and have only developed small things on addons, so my imagination on this is far less than that of an anki developer.

  1. Despite opening Anki in safe mode, the issue still persists.

  2. I attempted to resolve the problem by uninstalling Anki and deleting all addons folder, and any file related to Anki in drive C. After reinstalling Anki, this time with the latest version, I tried to sync media before adding any addons. Unfortunately, I was unable to sync successfully.

Although your statement may be accurate, it does not apply to my media. I performed a full backup of my data and sent it to a friend who lives in another city. He installed Anki on his computer, logged into my account, imported the backup files, and forced fullsync upload to Ankiweb. This resulted in successful media synchronization. Therefore, if the IP issue you mentioned, was the cause of the problem with my collection, he couldn’t sync because he use the exact same collection.

I suspected that it could be the issue at hand, and therefore I created a new profile as well as a fresh Anki profile using a different email. Next, I proceeded to create a single card with a small image and attempted to sync media, but unfortunately, it failed. Since this was a completely separate collection with only one tiny image, I concluded that the problem is not related to file corruption.

I encountered issues with version 2.1.54, attempted to resolve them by upgrading to versions 2.1.63, and then downgrading to 2.1.55, and 2.1.52 in succession. Despite these attempts, I continued to experience problems uploading media to Anki servers. Eventually, I resorted to a complete uninstallation and deletion of relevant files (which I mentioned before) before installing the latest version, 2.1.64, which also failed to upload media to Anki servers.

Many thanks to @FileX for affording me the opportunity to share the intensive efforts I put in over a period of 5-6 days to overcome this issue. Initially, I had planned to include these details in my previous message but I didn’t want to make it excessively long and tedious for anyone to read.

Intermittent timeouts are likely caused by an unreliable connection between your machine and AnkiWeb’s servers. There’s no magic solution for this I’m afraid - you could try increasing the timeout in the preferences screen to a higher value, but if that doesn’t help and the issue doesn’t resolve itself for weeks, you may be best off hosting your own server.

https://docs.ankiweb.net/sync-server.html

Thank you for your reply. I still think that the problem might be related to the Anki server, because I have never experienced this with any other service that requires uploading files. Is there any way you could put me in touch with the specialists of Anki in this area, so that I can explain what I experienced and maybe give them some clues to find the root cause and the possible solutions?

I tried and it didn’t help.

I appreciate your suggestion, but I am not very familiar with servers. I tried to look for a step-by-step guide that would suit my level of experience, but I could not find any. Do you happen to know where I can find such a guide?

Your success with other sites is covered in this FAQ: Syncing failed: Connection timed out errors when syncing - Frequently Asked Questions. I’m afraid I do not think there is anything I can do on AnkiWeb’s end to resolve this for you.

I’m afraid I do not. A less technical but more cumbersome alternative is to use the export/import feature to export a colpkg from one device and import it into the other, each time you wish to switch between devices.

1 Like

Thank you for sharing this page with me. That page was the source of my mention of packet loss. Unfortunately, the suggestions did not solve my issue.

I would appreciate it if someone could create a step-by-step guide on hosting our own server for people like me who have limited server knowledge.

I have been following this method lately.

I guess the link he posted is pretty much easy (Sync Server - Anki Manual). The only things that seem not to be mentioned are how you open the Command Line, which is just to search for cmd in windows, the other thing is how to get your IP address, which is ipconfig in the command line and IPv4 Address. I have not tried it myself but it shouldn’t be that hard. Also, if you run into any problems with it or got any further questions, just ask them.

“If you use this, the expectation is you can resolve any setup/network/firewall issues you run into yourself, and use of this is entirely at your own risk.”

Normal things such as syncing are not as scary as this :sweat_smile: and you remember how easy that normal thing was with me!

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