HTTP 500 when trying to connect to the API

What is the problem?

I'm trying to set up OctoApp, but the app does not want to connect. It gives HTTP error 500. The error traceback in the Octoprint log is below:

Mar 01 23:38:20 server octoprint[89081]: 2023-03-01 23:38:20,399 - octoprint - ERROR - Exception on /api/currentuser [GET]
Mar 01 23:38:20 server octoprint[89081]: Traceback (most recent call last):
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
Mar 01 23:38:20 server octoprint[89081]:     response = self.full_dispatch_request()
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/flask/app.py", line 1519, in full_dispatch_request
Mar 01 23:38:20 server octoprint[89081]:     rv = self.handle_user_exception(e)
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request
Mar 01 23:38:20 server octoprint[89081]:     rv = self.preprocess_request()
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/flask/app.py", line 1857, in preprocess_request
Mar 01 23:38:20 server octoprint[89081]:     rv = self.ensure_sync(before_func)()
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/octoprint/server/__init__.py", line 1427, in before_request
Mar 01 23:38:20 server octoprint[89081]:     g.locale = self._get_locale()
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/octoprint/server/__init__.py", line 1352, in _get_locale
Mar 01 23:38:20 server octoprint[89081]:     return Locale.parse(request.accept_languages.best_match(LANGUAGES))
Mar 01 23:38:20 server octoprint[89081]:   File "/home/octoprint/OctoPrint/lib/python3.9/site-packages/babel/core.py", line 317, in parse
Mar 01 23:38:20 server octoprint[89081]:     raise TypeError(f"Unexpected value for identifier: {identifier!r}")
Mar 01 23:38:20 server octoprint[89081]: TypeError: Unexpected value for identifier: None

What did you already try to solve it?

Googling it :slight_smile:

Have you tried running in safe mode?

Yes

Did running in safe mode solve the problem?

No, same error

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

octoprint-systeminfo-20230301234452.zip (27.1 KB)

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

OctoPrint on Debian installed with the octoprint_install.sh script. All software is latest at 01-03-2023.

There is a corresponding Bug report on GitHub: 500 response when requesting `/api/currentuser` caused by Babel Β· Issue #4744 Β· OctoPrint/OctoPrint Β· GitHub

Seems to be an issue with an internal dependency that was updated the day before yesterday, causing issues on new installations of OctoPrint.

1 Like

@foosel is working on a patch :tentacle:

1 Like

I've just release 1.8.7 which should fix this.

2 Likes

Wow, that's quick! Thanks!

I have a tip jar :wink:

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.