Skip to content

Internal Server Error while login with Debian 10 / Python3 #2629

@mimugmail

Description

@mimugmail

Top-level intent

Install PI on Debian 10 with Python3 via pip/virtualenv

Steps to reproduce

Hi Cornelius, after long time I tried to install PI via pip/virtualenv on Debian 10 like with my old guide.
https://www.routerperformance.net/howtos/privacyidea/install-privacyidea-2-13-on-a-clean-debian-8-jessie/

It needs some tweakting but I found besides this that when logging in I get an 500 error due to bad utf8 encoding.
In file /opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/auth.py I removed .decode('utf8') and then it works.
Not sure if this is a bug with Debian or in general.

Expected outcome

What do you think, how the system should have worked?

Actual outcome

What did actually happen?

Configuration

  • privacyIDEA version: 3.5.1
  • Installation method: PyPI
  • Python version: 3.7.2
  • Operating system: Debian 10
  • Webserver: Apache24
  • Token database: MariaDB 10.3

Log file

[2021-02-17 09:57:27,876][3785][139653066196800][ERROR][privacyidea.app:1892] Exception on /auth [POST]
Traceback (most recent call last):
  File "/opt/privacyidea/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/privacyidea/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/privacyidea/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/privacyidea/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/privacyidea/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/privacyidea/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/prepolicy.py", line 154, in policy_wrapper
    return wrapped_function(*args, **kwds)
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/prepolicy.py", line 154, in policy_wrapper
    return wrapped_function(*args, **kwds)
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/prepolicy.py", line 154, in policy_wrapper
    return wrapped_function(*args, **kwds)
  [Previous line repeated 1 more time]
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/postpolicy.py", line 108, in policy_wrapper
    response = wrapped_function(*args, **kwds)
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/postpolicy.py", line 108, in policy_wrapper
    response = wrapped_function(*args, **kwds)
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/lib/postpolicy.py", line 108, in policy_wrapper
    response = wrapped_function(*args, **kwds)
  [Previous line repeated 3 more times]
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/lib/event.py", line 99, in event_wrapper
    f_result = func(*args, **kwds)
  File "/opt/privacyidea/lib/python3.7/site-packages/privacyidea/api/auth.py", line 370, in get_auth_token
    secret, algorithm='HS256').decode('utf8')
AttributeError: 'str' object has no attribute 'decode'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions