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

"error decoding response body" on sync in macos #47

Open
arupakaa opened this issue Jan 27, 2022 · 14 comments
Open

"error decoding response body" on sync in macos #47

arupakaa opened this issue Jan 27, 2022 · 14 comments

Comments

@arupakaa
Copy link

Hi,

Thanks for the awesome work with all of this. I just wish I could get it setup properly on my end ... :'(

Any chance a super-noob friendly guide can be thrown out by someone? I am on mac/osx. Docker installed fine. anki-sync-server installed fine to Docker. Cool. And it runs. And the CLI button provides a prompt that allows me to setup an account.

Great.

However, I cannot connect to this server. I am guessing it might have something to do with the directory not being set up properly? But, really, I have no clue. Any chance for a step-by-step -- e.g., the steps to reproduce the "test" mentioned in RM?

Thanks in advance! <3 <3

@VikashKothary
Copy link
Member

Hi @aruberuku, I'll be happy to help. We're always looking for opportunities to improve our documentation to make the set up process as easy as possible.

First question: how you had a look at this existing tutorials?

  1. We should cover how to setup the anki-sync-server: https://ankicommunity.github.io/Tutorials/Docker/Howto/
  2. And how to configure the desktop and Android clients to use the server: https://ankicommunity.github.io/Tutorials/anki_custom_sync_server/

If you can let me know at which part you're getting stuck we can work through it together.

@arupakaa
Copy link
Author

arupakaa commented Jan 28, 2022

Hi @VikashKothary,

I took another look at the guide you provided and managed to successfully setup the server.
However, on synch, I am now getting the "error decoding response body" error described here:

https://forums.ankiweb.net/t/error-decoding-response-body-sync-error/1316/12

edit, here is my console output:

[2022-01-28 07:19:52,460]:INFO:ankisyncd.http:127.0.0.1 "GET / HTTP/1.1" 200 16
[2022-01-28 07:19:56,980]:INFO:ankisyncd.http:172.17.0.1 "GET /msync/begin?k=d45ad3d80c550041d79504988867b640&v=anki%2C2.1.49+%28dc80804a%29%2Cmac%3A10.16 HTTP/1.1" 403 157
[2022-01-28 07:19:57,027]:INFO:ankisyncd.CollectionThread[useraccount]:Running meta(*[], **{'v': 10, 'cv': 'anki,2.1.49 (dc80804a),mac:10.16'})
[2022-01-28 07:19:57,029]:INFO:ankisyncd.http:172.17.0.1 "POST /sync/meta HTTP/1.1" 200 99
[2022-01-28 07:19:57,577]:INFO:ankisyncd.http:127.0.0.1 "GET / HTTP/1.1" 200 16

and, here's a screenshop of what the macos client reports:

image

Any suggestions? Thanks in advance!

@arupakaa arupakaa changed the title noob friendly docker setup guide "error decoding response body" on sync in macos Jan 28, 2022
@VikashKothary
Copy link
Member

Hi @arupakaa, this is a known issue, see: ankicommunity/ankicommunity-sync-server#117 and ankicommunity/ankicommunity-sync-server#56.

Can you confirm you're using the latest develop branch?

@arupakaa
Copy link
Author

arupakaa commented May 16, 2022 via email

@kevinsung
Copy link

@VikashKothary Which docker image should we use? The README links to https://hub.docker.com/r/kuklinistvan/anki-sync-server but that was last updated two yeras ago.

@VikashKothary
Copy link
Member

You can now find the latest docker images here: https://hub.docker.com/r/ankicommunity/anki-sync-server

@kevinsung
Copy link

Thanks, I tried that image, but then the instructions in the README don't seem to apply anymore:
image

Specifically, the line

/app/anki-sync-server # ./ankisyncctl.py --help

is no longer applicable.

@VikashKothary
Copy link
Member

Yes I apologies, that is my mistake. I was refactoring the CLI and broke backward-compatibility. You can see that discussion here: ankicommunity/ankicommunity-sync-server#128.

You can see the same issue about the CLI here: #48

@Zocker1999NET
Copy link
Contributor

Could these be reflected in the README.md? It took me some time to find this issue regarding that the Docker image url changed. I can propose a change myself if you don't have enough time, however I might not have enough knowledge about this project because I started using it an hour ago

@VikashKothary
Copy link
Member

Hi @Zocker1999NET, thank you for bringing this to my attention.

You flagging that information in the README is out-of-date really helps me know where to focus my efforts so it's much appreciated. If you can raise a PR, that would be very welcome. If not, I'll try and update the README when I next have time.

@piotryordanov
Copy link

@VikashKothary in the meantime, could you tell us how to make it run?
unfortunately, the current configuration doesn't even run :(

cc: @Zocker1999NET

@michojel
Copy link

@piotryordanov Although far from ideal, my current work-around is this: https://github.com/michojel/NixOS/blob/master/michowps/ankisyncd.nix#L76

@piotryordanov
Copy link

@michojel thx for the link. However, could you help me run this script? I never worked with nix os before! 🙈

@michojel
Copy link

Here is the generated /etc/systemd/system/docker-ankisyncd.service:

[Unit]
After=docker.service
Description=Anki Sync Server
Requires=docker.service

[Service]
Environment="LOCALE_ARCHIVE=/nix/store/r4jm7wfirgdr84zmsnq5qy7hvv14c7l7-glibc-locales-2.34-210/lib/locale/locale-archive"
Environment="PATH=/nix/store/7jr7pr4c6yb85xpzay5xafs5zlcadkhz-coreutils-9.0/bin:/nix/store/140f6s4nwiawrr3xyxarmcv2mk62m62y-findutils-4.9.0/bin:/nix/store/qd9jxc0q00cr7fp30y6jbbww20gj33lg-gnugrep-3.7/bin:/nix/store/lgvd2fh4cndlv8mnyy49jp1nplpml3xp-gnused-4.8/bin:/nix/store/k5blnxr0jrna87aig0pfjz0afkf9b3w9-systemd-250.4/bin:/nix/store/7jr7pr4c6yb85xpzay5xafs5zlcadkhz-coreutils-9.0/sbin:/nix/store/140f6s4nwiawrr3xyxarmcv2mk62m62y-findutils-4.9.0/sbin:/nix/store/qd9jxc0q00cr7fp30y6jbbww20gj33lg-gnugrep-3.7/sbin:/nix/store/lgvd2fh4cndlv8mnyy49jp1nplpml3xp-gnused-4.8/sbin:/nix/store/k5blnxr0jrna87aig0pfjz0afkf9b3w9-systemd-250.4/sbin"
Environment="TZDIR=/nix/store/n83qx7m848kg51lcjchwbkmlgdaxfckf-tzdata-2022a/share/zoneinfo"



ExecStart=/nix/store/4c571rkjks3llinrrk58v1qzipsygwq3-unit-script-docker-ankisyncd-start/bin/docker-ankisyncd-start 
ExecStartPre=/nix/store/qiiljpn9cigl7ang4fxs47xiwfgwckga-unit-script-docker-ankisyncd-pre-start/bin/docker-ankisyncd-pre-start
ExecStop=/nix/store/6z9ixsrsa9vjwlhlg01xrpy5vznxvmsb-unit-script-docker-ankisyncd-pre-stop/bin/docker-ankisyncd-pre-stop
Restart=always
TimeoutStartSec=30

ExecStart script:

#!/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash
set -e
# TODO: fix protobof issues instead of using python implementation
# TODO: set PYTHONPATH on the image
/nix/store/1dvhsx6l4mjx4nk4hs9l6yf8is26b800-docker-20.10.17/bin/docker run -u 62384:62384 --rm --name ankisyncd \
    -v /var/lib/private/ankisyncd:/srv/ankisyncd:rw \
    -v /nix/store/p76davgdny7ihvzk5dvz34ps4146mc0j-ankisyncd.conf:/opt/ankisyncd/ankisyncd.conf:ro \
    -e PYTHONPATH=/opt/ankisyncd \
    -e PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python \
    -e ANKISYNCD_SESSION_DB_PATH=/srv/ankisyncd/session.db \
    -e ANKISYNCD_AUTH_DB_PATH=/srv/ankisyncd/auth.db \
    -p 27701:27701 \
    docker.io/michojel/anki-sync-server:latest

ExecPreStart:

#!/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash
set -e
/nix/store/1dvhsx6l4mjx4nk4hs9l6yf8is26b800-docker-20.10.17/bin/docker stop ankisyncd 2>/dev/null ||:
/nix/store/1dvhsx6l4mjx4nk4hs9l6yf8is26b800-docker-20.10.17/bin/docker rm   ankisyncd 2>/dev/null ||:
/nix/store/1dvhsx6l4mjx4nk4hs9l6yf8is26b800-docker-20.10.17/bin/docker pull docker.io/michojel/anki-sync-server:latest

ExecStop:

#!/nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16/bin/bash
set -e
/nix/store/1dvhsx6l4mjx4nk4hs9l6yf8is26b800-docker-20.10.17/bin/docker stop ankisyncd ||:

You may want to replace docker.io/michojel/anki-sync-server:latest with the official one or the one built by you.

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

6 participants