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

"IndexError: list index out of range" when syncing from Anki Desktop #170

Open
TMason11095 opened this issue Dec 29, 2023 · 1 comment
Open

Comments

@TMason11095
Copy link

Pretty new to all this, so sorry if I overlooked anything basic.

Hit sync on the Anki Desktop v23.12.1, typed in the user/password that I set from ./ankisyncctl.py, and got the error: AnkiWeb encountered a problem. Please try again in a few minutes.. Then opened up the Docker container logs and see this:

2023-12-29 15:41:39 [2023-12-29 21:41:39,240]:INFO:ankisyncd:ankisyncd [unknown version] (https://github.com/ankicommunity/anki-sync-server.git)
2023-12-29 15:41:39 [2023-12-29 21:41:39,240]:INFO:ankisyncd.config:Loaded config from /ankisyncd.conf
2023-12-29 15:41:39 [2023-12-29 21:41:39,240]:INFO:ankisyncd.users:Found auth_db_path in config, using SqliteUserManager for auth
2023-12-29 15:41:39 [2023-12-29 21:41:39,240]:INFO:ankisyncd.sessions:Found session_db_path in config, using SqliteSessionManager for auth
2023-12-29 15:41:39 [2023-12-29 21:41:39,241]:INFO:ankisyncd.server:Serving HTTP on 0.0.0.0 port 27701...
2023-12-29 15:43:49 Traceback (most recent call last):
2023-12-29 15:43:49 File "/usr/local/lib/python3.10/wsgiref/handlers.py", line 137, in run
2023-12-29 15:43:49 self.result = application(self.environ, self.start_response)
2023-12-29 15:43:49 File "/ankisyncd/sync_app.py", line 585, in call
2023-12-29 15:43:49 w = self.wrapped(*args, **kwargs)
2023-12-29 15:43:49 File "/ankisyncd/sync_app.py", line 686, in call
2023-12-29 15:43:49 req.params = req.parse
2023-12-29 15:43:49 File "/ankisyncd/sync_app.py", line 508, in parse
2023-12-29 15:43:49 boundary = others[0]
2023-12-29 15:43:49 IndexError: list index out of range
2023-12-29 15:43:49 [2023-12-29 21:43:49,430]:INFO:ankisyncd.http:172.17.0.1 "POST /sync/hostKey HTTP/1.1" 500 59

Here's all the steps I took:

  1. Cloned the repo into VS Code.
  2. Updated the Dockerfile.
  • Added RUN apt-get update && \ apt-get install dos2unix && \ apt-get clean after RUN cd /src \ && pip install -r requirements.txt \ && pip install -e .. (was getting /usr/bin/env: ‘python3\r’: No such file or directory error when running ankisyncctl.py in the container).
  • Added EXPOSE 27701 before CMD ["python", "-m", "ankisyncd"]. (Docker wasn't showing anything in the Port(s) section of the container).
  1. Built image from Dockerfile.
  2. Ran a new container from the image with Host Port 27701. (Docker now shows 27701:27701 in the Port(s) section).
  3. Ran dos2unix ./ankisyncd_cli/ankisyncctl.py inside the container.
  4. Ran ./ankisyncd_cli/ankisyncctl.py adduser TMason inside the container and then entered a password when prompted.
  5. In Anki Desktop, I went to Tools > Preferences > Syncing and set Self-hosted sync server to http://localhost:27701/. (The custom sync server redirector addon mentioned in the README wouldn't connect to the sever for me (no logs in the Docker container)).
@LuckyTurtleDev
Copy link
Contributor

see #158

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

2 participants