Skip to content

Authentication failed for nonexistent user None. #164

@p-curtis

Description

@p-curtis

Hope this is the right forum. First time leaving an issue on GitHub.
Edit: Originally posted on Tsudoko's repo but realized he hasn't answered in any issues in a couple of years.

Long story short, I've set up a docker container (kuklinistvan/anki-sync-server) for Anki-Sync-Server (AnkiSS) and when attempting to use the Anki Desktop client to sync, I'm receiving the "AnkiWeb ID or password was incorrect; please try again." error. When looking at the server logs it says "Authentication failed for nonexistent user None.".

AnkiSS is on a Linux Server and the Anki Desktop is on a Linux Client.
The Anki Desktop client is v2.1.66.

To go over set up & troubleshooting steps:
On the AnkiSS host, I've ran the ./ankisyncctl.py adduser command, as noted in the linked documentation.

Troubleshooting output is shown below:

  1. Docker-Compose config
  2. The wireshark output as observed on the client
  3. As well as the docker logs from the running conainer showing that it receives the request (first line)
  4. The in-container AnkiSS output that shows the user exists.

My goal is to identify (as shown in # 3) why a user of NONE is observed on the server, even after I've explicitly created one and validated that one exists. Also, I would like to know if there is anything in general I am missing or misunderstanding about the Sync Server's purpose/configuration.

I have an nginx proxy, but I tried with both FQDN and just IP and the result is the same.

01. Docker Compose:

version: "3.8"

services:
  anki-sync-server:
    image: kuklinistvan/anki-sync-server:latest
    container_name: anki-sync-server
    restart: unless-stopped
    ports:
    - "1257:27701"
    volumes:
    - ./data/sync_server:/app/data
    logging:
      options:
        max-size: "10m"
        max-file: "3"

02. Wireshark HTTP Stream:

---- POST ----

POST /sync/hostKey HTTP/1.1
anki-sync: {"v":11,"k":"","c":"2.1.66,70506aeb,linux","s":"dVi2Fn"}
content-type: application/octet-stream
accept: */*
host: 192.168.50.61:1257
transfer-encoding: chunked

(./..X...{"u":"bob","p":"1234"}

---- RESPONSE ----

HTTP/1.0 403 Forbidden
Date: Fri, 22 Sep 2023 15:39:29 GMT
Server: WSGIServer/0.2 CPython/3.7.0
Content-Length: 161
Content-Type: text/html; charset=UTF-8

<html>
 <head>
  <title>403 Forbidden</title>
 </head>
 <body>
  <h1>403 Forbidden</h1>
  Access was denied to this resource.<br /><br />
null


 </body>
</html>

03. Docker Log Output:

Error output:

anki-sync-server    | [2023-09-22 15:39:29,385]:INFO:ankisyncd.users:Authentication failed for nonexistent user None.
anki-sync-server    | [2023-09-22 15:39:29,386]:INFO:ankisyncd.http:192.168.55.10 "POST /sync/hostKey HTTP/1.1" 403 161

A successful connection looks like:

anki-sync-server    | [2023-09-22 15:48:29,386]:INFO:ankisyncd.http:127.0.0.1 "GET / HTTP/1.1" 200 16 

04. Container Output:

/app/anki-sync-server # ./ankisyncctl.py lsuser
bob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions