I have configured the docker-ldap-auth container and it has been working for about a week. However, last night I tried to log in to my web applications and they are returning 500 Internal Error messages.
Looking at the docker-ldap-auth logs, I see these stack traces:
Exception occurred during processing of request from ('172.18.0.12', 60686)
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 98, in do_GET
auth_decoded = auth_decoded.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
Allow log in calls to the web applications.
----------------------------------------
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('172.18.0.12', 54850)
Exception occurred during processing of request from ('172.18.0.12', 54862)
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
Traceback (most recent call last):
cryptography.fernet.InvalidToken
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
During handling of the above exception, another exception occurred:
cryptography.exceptions.InvalidSignature: Signature did not match digest.
Traceback (most recent call last):
During handling of the above exception, another exception occurred:
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
cryptography.fernet.InvalidToken
File "/app/nginx-ldap-auth-daemon.py", line 97, in do_GET
auth_decoded = base64.b64decode(auth_header[6:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
During handling of the above exception, another exception occurred:
File "/usr/lib/python3.12/base64.py", line 88, in b64decode
return binascii.a2b_base64(s, strict_mode=validate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Traceback (most recent call last):
binascii.Error: Invalid base64-encoded string: number of data characters (117) cannot be 1 more than a multiple of 4
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
----------------------------------------
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 97, in do_GET
auth_decoded = base64.b64decode(auth_header[6:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/base64.py", line 88, in b64decode
return binascii.a2b_base64(s, strict_mode=validate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
binascii.Error: Invalid base64-encoded string: number of data characters (117) cannot be 1 more than a multiple of 4
----------------------------------------
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('172.18.0.12', 54864)
Exception occurred during processing of request from ('172.18.0.12', 54868)
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 97, in do_GET
auth_decoded = base64.b64decode(auth_header[6:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
File "/usr/lib/python3.12/base64.py", line 88, in b64decode
return binascii.a2b_base64(s, strict_mode=validate)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cryptography.exceptions.InvalidSignature: Signature did not match digest.
binascii.Error: Incorrect padding
During handling of the above exception, another exception occurred:
----------------------------------------
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 98, in do_GET
auth_decoded = auth_decoded.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('172.18.0.12', 54882)
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 98, in do_GET
auth_decoded = auth_decoded.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('172.18.0.12', 54890)
----------------------------------------
Exception occurred during processing of request from ('172.18.0.12', 54906)
Traceback (most recent call last):
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 98, in do_GET
auth_decoded = auth_decoded.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
----------------------------------------
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 98, in do_GET
auth_decoded = auth_decoded.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
----------------------------------------
----------------------------------------
Exception occurred during processing of request from ('172.18.0.12', 54918)
Traceback (most recent call last):
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 131, in _verify_signature
h.verify(data[-32:])
cryptography.exceptions.InvalidSignature: Signature did not match digest.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/nginx-ldap-auth-daemon.py", line 92, in do_GET
auth_decoded = cipher_suite.decrypt(auth_decoded)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 90, in decrypt
return self._decrypt_data(data, timestamp, time_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 149, in _decrypt_data
self._verify_signature(data)
File "/lsiopy/lib/python3.12/site-packages/cryptography/fernet.py", line 133, in _verify_signature
raise InvalidToken
cryptography.fernet.InvalidToken
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.12/socketserver.py", line 697, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.12/socketserver.py", line 766, in __init__
self.handle()
File "/usr/lib/python3.12/http/server.py", line 436, in handle
self.handle_one_request()
File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
method()
File "/app/nginx-ldap-auth-daemon.py", line 200, in do_GET
if AuthHandler.do_GET(self):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/nginx-ldap-auth-daemon.py", line 98, in do_GET
auth_decoded = auth_decoded.decode("utf-8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
----------------------------------------
Is there an existing issue for this?
Current Behavior
I have configured the docker-ldap-auth container and it has been working for about a week. However, last night I tried to log in to my web applications and they are returning 500 Internal Error messages.
Looking at the docker-ldap-auth logs, I see these stack traces:
Glancing through the code, it looks like this line:
in https://github.com/linuxserver/docker-ldap-auth/blob/master/root/app/nginx-ldap-auth-daemon.py#L98 is causing the second stack trace. Maybe that should be in a separate try-except block?
However, I am not sure what the cause of the initial exception is. I have tried adding a Fernet Key but that did not result in the docker-ldap-auth container returning successful log ins.
Expected Behavior
Allow log in calls to the web applications.
Steps To Reproduce
Environment
CPU architecture
x86-64
Docker creation
docker-compose.yml snippet: ldap-auth: # Original image: lscr.io/linuxserver/ldap-auth:latest image: docker.media.domain.local/linuxserver/ldap-auth:latest container_name: ldap-auth hostname: ldap-auth environment: - PUID - PGID - TZ expose: - 8888 - 9000 restart: unless-stopped healthcheck: test: curl --fail --insecure http://127.0.0.1:9000/ || exit 1 interval: 2s retries: 3 start_period: 5s cpu_shares: 1792 deploy: resources: limits: memory: 128m reservations: cpus: 2 memory: 128m logging: driver: "json-file" options: max-size: "10m" max-file: "3" networks: - external-networkContainer logs