Anki 2.33 Will Not Start

I’m trying to run 2.33 and get this error message on the Anki Console

Exception in thread Thread-1:
Traceback (most recent call last):
File “threading.py”, line 932, in _bootstrap_inner
File “aqt\mediasrv.py”, line 63, in run
File “waitress\server.py”, line 81, in create_server
File “waitress\server.py”, line 242, in init
File “waitress\server.py”, line 254, in get_server_name
ValueError: Requires an IP to get the server name
mpv too old for key rebinding

The last working version for me is 2.26

1 Like

What is your computer’s network hostname set to?

@addons_zz any ideas?

1 Like

Hostname: Desktop-7ZAAFP

1 Like

I opened an issue on https://github.com/Pylons/waitress/issues/312 (ValueError: Requires an IP to get the server name) asking for help.

@whome, what is your operating system? Linux?

Can you run a Python Script to help debugging the problem?

If you do not have Python installed, you can install it from https://www.python.org/downloads/

You would need to create a text file named test.py with the contents:

import os
import flask
from waitress.server import create_server

app = flask.Flask(__name__)

desired_port = int(os.getenv("ANKI_API_PORT", "0"))
server = create_server(app, host="127.0.0.1", port=desired_port)

print("Serving on http://%s:%s"% (server.effective_host, server.effective_port))

After creating the test.py file, you can open a command line and run it with the command python test.py or python3 test.py

After running the script, you should have an output like the following:

Serving on http://<your-computer-name>:56008

Or it could show you the same error:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    server = create_server(app, host="127.0.0.1", port=desired_port)
  File "waitress\server.py", line 81, in create_server
    last_serv = TcpWSGIServer(
  File "waitress\server.py", line 242, in __init__
    self.server_name = self.get_server_name(None)
  File "waitress\server.py", line 254, in get_server_name
    raise ValueError("Requires an IP to get the server name")
ValueError: Requires an IP to get the server name
2 Likes

Windows 10, I’m getting the following error with the Python script.

ModuleNotFoundError: No module named ‘flask’

1 Like

You’ll need to “pip install flask” first

What’s the contents of your hosts file?

1 Like

It is related to the Hostfile!

With a Hostfile that says "127.0.0.1 "

Traceback (most recent call last):
File “…\test.py”, line 8, in
server = create_server(app, host=“127.0.0.1”, port=desired_port)
File “…\Python38-32\lib\site-packages\waitress\server.py”, line 81, in create_server
last_serv = TcpWSGIServer(
File “…\Python38-32\lib\site-packages\waitress\server.py”, line 242, in init
self.server_name = self.get_server_name(self.effective_host)
File “…\Python38-32\lib\site-packages\waitress\server.py”, line 254, in get_server_name
raise ValueError(“Requires an IP to get the server name”)
ValueError: Requires an IP to get the server name

With a Blank hostfile
Serving on http://DESKTOP-…:59385

With a Hostfile with a site blocked
Serving on [site]:59786

It seems that Waitress may not be reading the hostfile properly. I wonder why it worked in 2.2.26?

1 Like

To confirm, the hostname was missing - the line just said "127.0.0.1 " with nothing else on that line? That does not look valid - it should have have a hostname after it.

1 Like

Yes, that one was missing the hostname. When it does have a hostname, it says Serving on Hostname:59786 . It seems that Waitress is doing the following

  1. Read the Hosts file
  2. Find the first entry that says 127.0.0.1 Hostname
  3. Set Server to Hostname
    4)Which fails if Hostame is either blank or a site.
1 Like

Thanks for clarifying, I’ve posted an update on the ticket @addons_zz created.

1 Like

Confirmed - Fixed