After upgrading to 1.8.3 from web ui logins stopped working. Octoprint.log says:
2022-09-21 00:54:30,166 - octoprint - ERROR - Exception on /api/login [POST]
Traceback (most recent call last):
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/flask/app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/flask/app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/flask/app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/flask/app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/flask_limiter/extension.py", line 1145, in __inner
R, flask.current_app.ensure_sync(cast(Callable[P, R], obj))(*a, **k)
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/octoprint/server/api/__init__.py", line 312, in login
if octoprint.server.userManager.check_password(username, password):
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/octoprint/access/users.py", line 157, in check_password
if user.check_password(password):
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/octoprint/access/users.py", line 1173, in check_password
return passwordhash.verify(password, self._passwordHash)
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/passlib/handlers/argon2.py", line 669, in verify
cls._stub_requires_backend()
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/passlib/utils/handlers.py", line 2254, in _stub_requires_backend
cls.set_backend()
File "/home/pi/OctoPrint/venv/lib/python3.7/site-packages/passlib/utils/handlers.py", line 2176, in set_backend
raise default_error
passlib.exc.MissingBackendError: argon2: no backends available -- recommend you install one (e.g. 'pip install argon2_cffi')
What did you already try to solve it?
Solved it my downgrading it back to 1.8.2 with ssh console
yes that is mystery to me too, if I go to ssh shell into the venv environment and run pip install from there it says that "Requirement already satisfied: argon2_cffi in ./lib/python3.7/site-packages (21.3.0)", but it looks like octoprint is unable to find it as it says "passlib.exc.MissingBackendError: argon2: no backends available"
And second thing it seem that I also had trouble with remote connections. I have reverse haproxy setup (with added client certificate checking) with couple different dns names for couple of my different octoprint printers, and they also stopped working with wrong password redirect (when local ip accepted the same password). Most likely something to do the CORS or CSRF protection, so for the time beeing I've downgraded all my printers back to 1.8.2 until I figure out how to update haproxy settings to work also. One of my venv octoprint setups were also over Armbian 22.05.3 Jammy distro, and that one also runned into argon2: no backends available error after pressing update from the webui.
I can confirm this issue. After upgrade via the UI i ran into th same error.
I also manually installed the plugin "pip install argon2_cffi"
pi@prusa:~ $ cd OctoPrint/
pi@prusa:~/OctoPrint $ source venv/bin/activate
(venv) pi@prusa:~/OctoPrint $ pip install argon2_cffi
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: argon2_cffi in ./venv/lib/python3.9/site-packages (21.3.0)
Requirement already satisfied: argon2-cffi-bindings in ./venv/lib/python3.9/site-packages (from argon2_cffi) (21.2.0)
Requirement already satisfied: cffi>=1.0.1 in ./venv/lib/python3.9/site-packages (from argon2-cffi-bindings->argon2_cffi) (1.15.1)
Requirement already satisfied: pycparser in ./venv/lib/python3.9/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2_cffi) (2.21)
(venv) pi@prusa:~/OctoPrint $ octoprint user password admin
Password:
Repeat for confirmation:
Traceback (most recent call last):
File "/home/pi/OctoPrint/venv/bin/octoprint", line 8, in <module>
sys.exit(main())
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/__init__.py", line 936, in main
octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/cli/common.py", line 37, in invoke
return self._impl.invoke(ctx)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/cli/user.py", line 155, in change_password_command
ctx.obj.user_manager.change_user_password(username, password)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/access/users.py", line 788, in change_user_password
user._passwordHash = UserManager.create_password_hash(password)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/access/users.py", line 144, in create_password_hash
return passwordhash.hash(password)
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/passlib/handlers/argon2.py", line 664, in hash
cls._stub_requires_backend()
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/passlib/utils/handlers.py", line 2254, in _stub_requires_backend
cls.set_backend()
File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/passlib/utils/handlers.py", line 2176, in set_backend
raise default_error
passlib.exc.MissingBackendError: argon2: no backends available -- recommend you install one (e.g. 'pip install argon2_cffi')
(venv) pi@prusa:~/OctoPrint $
What OS is this and what version? Which Python version, which pip version? What underlying hardware? I'm trying to get a picture here to figure out why this works fine on OctoPi and in my and the team's local testing, but not in now two manual installs. I'm guessing it might be some native library that's missing, or maybe something that cffi requires to do its magic, but currently that's really just blind guessing.
If you're using virtual environments (venv), are you sure you installed argon2_cffi into the same virtual environment? What happens if you run Octoprint server via the CLI (octoprint serve -v) instead of the daemon?