Production server Bad Request (Error: ValueError: Unknown endpoint type: 'fd')

This morning, my production website went down with a "Bad Request" error. It was working the day before, and I made no changes that might have caused the error. Below is the traceback I got in the asgi.log file. I can provide more information if needed, but not sure what.

I have tried the following:

  1. Uninstalled all from requirements.txt, then reinstalled, and restarted the server
  2. Added '*' to ALLOWED_HOSTS, and set DEBUG=True, but this did not work, so I undid those changes.
  3. Rebooted the server

The site works fine in my local machine, whether I use DEBUG = FALSE or DEBUG = True.

Traceback (most recent call last):
  File "/home/raphaeluziel/raphi/venv/bin/daphne", line 8, in <module>
    sys.exit(CommandLineInterface.entrypoint())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/daphne/cli.py", line 171, in entrypoint
    cls().run(sys.argv[1:])
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/daphne/cli.py", line 291, in run
    self.server.run()
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/daphne/server.py", line 130, in run
    ep = serverFromString(reactor, str(socket_description))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/twisted/internet/endpoints.py", line 1874, in serverFromString
    nameOrPlugin, args, kw = _parseServer(description, None)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/twisted/internet/endpoints.py", line 1794, in _parseServer
    plugin = _matchPluginToPrefix(
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/twisted/internet/endpoints.py", line 1809, in _matchPluginToPrefix
    raise ValueError(f"Unknown endpoint type: '{endpointType}'")
ValueError: Unknown endpoint type: 'fd'
Traceback (most recent call last):
  File "/home/raphaeluziel/raphi/venv/bin/daphne", line 8, in <module>
    sys.exit(CommandLineInterface.entrypoint())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/daphne/cli.py", line 171, in entrypoint
    cls().run(sys.argv[1:])
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/daphne/cli.py", line 291, in run
    self.server.run()
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/daphne/server.py", line 130, in run
    ep = serverFromString(reactor, str(socket_description))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/twisted/internet/endpoints.py", line 1874, in serverFromString
    nameOrPlugin, args, kw = _parseServer(description, None)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/twisted/internet/endpoints.py", line 1794, in _parseServer
    plugin = _matchPluginToPrefix(
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphaeluziel/raphi/venv/lib/python3.12/site-packages/twisted/internet/endpoints.py", line 1809, in _matchPluginToPrefix
    raise ValueError(f"Unknown endpoint type: '{endpointType}'")
ValueError: Unknown endpoint type: 'fd'

This is a bug in version 4.2.0 of Daphne, it has been reported here. Until a fix is released you can downgrade Daphne's version to 4.1.2 as a workaround and it should work again.

Вернуться на верх