Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medias don't sync with anki 2.1.26 #58

Closed
smartlitchi opened this issue Dec 2, 2020 · 2 comments
Closed

Medias don't sync with anki 2.1.26 #58

smartlitchi opened this issue Dec 2, 2020 · 2 comments

Comments

@smartlitchi
Copy link

smartlitchi commented Dec 2, 2020

Hello, I followed the instructions on the README.md and everything works fine except medias. There is no sync error on anki 2.1.26 but when I open the media log, I see this :

Wed Dec  2 21:19:34 2020: Media sync starting...
Wed Dec  2 21:19:34 2020: Please check your internet connection.

Error details: ⁨error sending request for url (): error trying to connect: dns error: 
failed to lookup address information: Name or service not known⁩

As previously stated, the cards are synced, only the medias are missing.

Here is my nginx reverse proxy :

server {
        server_name <url>;
                location / {
                proxy_http_version 1.0;
                proxy_pass http://localhost:27701/;
            }
    client_max_body_size 10M;

    listen 443 ssl; # managed by Certbot
    <ssl certificate via Certbot>
}

Edit : The problem seems to occur only with the desktop version (2.1.26), the media sync works with ankidroid (14.1)

@smartlitchi smartlitchi changed the title Medias don't sync on fresh anki-sync-server install Medias don't sync with anki 2.1.26 Dec 3, 2020
@smartlitchi
Copy link
Author

After further investigation, the error seems to come from the __init__.py of the ankisyncd addon given in README.md. I followed the instructions here : tsudoko/anki-sync-server#63 and added this line aqt.mediasync.SYNC_BASE = "%s" + addr

import anki.sync, anki.hooks, aqt

addr = "http://127.0.0.1:27701/" # put your server address here
anki.sync.SYNC_BASE = "%s" + addr
aqt.mediasync.SYNC_BASE = "%s" + addr
def resetHostNum():
    aqt.mw.pm.profile['hostNum'] = None
anki.hooks.addHook("profileLoaded", resetHostNum)

There is some progress in what I see in the Media Log but the issue is not fixed yet :

Thu Dec  3 17:22:30 2020: Media sync starting...
Thu Dec  3 17:22:30 2020: A network error occurred.

Error details: ⁨builder error: relative URL without a base⁩

@smartlitchi
Copy link
Author

I am closing this since I am no longer using anki 2.1.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant