Skip to content

500 response when requesting /api/currentuser caused by Babel #4744

Closed
@crysxd

Description

The problem

As discussed on Discord: https://discord.com/channels/704958479194128507/705047010641838211/1080750696430841856
And in the forum: https://community.octoprint.org/t/http-500-when-trying-to-connect-to-the-api/50252

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

Did the issue persist even in safe mode?

Yes, it did persist

If you could not test in safe mode, please state why

No response

Version of OctoPrint

1.8.6

Operating system running OctoPrint

/

Printer model & used firmware incl. version

/

Browser and version of browser, operating system running browser

/

Checklist of files to include below

  • Systeminfo Bundle (always include!)
  • Contents of the JavaScript browser console (always include in cases of issues with the user interface)
  • Screenshots and/or videos showing the problem (always include in case of issues with the user interface)
  • GCODE file with which to reproduce (always include in case of issues with GCODE analysis or printing behaviour)

Additional information & file uploads

octoprint-systeminfo-20230301234452.zip

Metadata

Assignees

No one assigned

    Labels

    triageThis issue needs triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions