I've run into an interesting problem when trying to deploy Bunkerweb in a managed kubernetes environment from the Stackit Cloud Provider.
I've used the same deployment in a different managed kubernetes environment (Ionos) and there it worked well.
The problem is that the controller-pod throws an exception when processing an Ingress event. I'm not sure if the problem is found in/can be fixed in Bunkerweb or Stackit, but I thought I might as well let you know.
Thanks and best wishes
How to reproduce?
Deploy Bunkerweb as an ingress controller in a Stackit Managed Kubernetes Environment
[2024-03-22 09:32:16] - KUBERNETES-CONTROLLER - ❌ - Unknown exception while reading k8s event (type = ingress) :
Traceback (most recent call last):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 761, in _update_chunk_length
self.chunk_left = int(line, 16)
^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 444, in _error_catcher
yield
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 828, in read_chunked
self._update_chunk_length()
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 765, in _update_chunk_length
raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/bunkerweb/autoconf/IngressController.py", line 265, in __watch
for event in w.stream(what):
File "/usr/share/bunkerweb/deps/python/kubernetes/watch/watch.py", line 165, in stream
for line in iter_resp_lines(resp):
File "/usr/share/bunkerweb/deps/python/kubernetes/watch/watch.py", line 56, in iter_resp_lines
for seg in resp.stream(amt=None, decode_content=False):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 624, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 816, in read_chunked
with self._error_catcher():
File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 461, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
[2024-03-22 09:32:16] - KUBERNETES-CONTROLLER - ⚠️ - Got exception, retrying in 10 seconds ...
[2024-03-22 09:32:17] - KUBERNETES-CONTROLLER - ❌ - Unknown exception while reading k8s event (type = service) :
Traceback (most recent call last):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 761, in _update_chunk_length
self.chunk_left = int(line, 16)
^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: b''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 444, in _error_catcher
yield
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 828, in read_chunked
self._update_chunk_length()
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 765, in _update_chunk_length
raise InvalidChunkLength(self, line)
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/bunkerweb/autoconf/IngressController.py", line 265, in __watch
for event in w.stream(what):
File "/usr/share/bunkerweb/deps/python/kubernetes/watch/watch.py", line 165, in stream
for line in iter_resp_lines(resp):
File "/usr/share/bunkerweb/deps/python/kubernetes/watch/watch.py", line 56, in iter_resp_lines
for seg in resp.stream(amt=None, decode_content=False):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 624, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 816, in read_chunked
with self._error_catcher():
File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/usr/share/bunkerweb/deps/python/urllib3/response.py", line 461, in _error_catcher
raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))
[2024-03-22 09:32:17] - KUBERNETES-CONTROLLER - ⚠️ - Got exception, retrying in 10 seconds ...
BunkerWeb version
1.5.5
What integration are you using?
Kubernetes
Linux distribution (if applicable)
No response
Removed private data
[X] I have removed all private data from the configuration file and the logs
Code of Conduct
[X] I agree to follow this project's Code of Conduct
What happened?
Hi there!
I've run into an interesting problem when trying to deploy Bunkerweb in a managed kubernetes environment from the Stackit Cloud Provider.
I've used the same deployment in a different managed kubernetes environment (Ionos) and there it worked well.
The problem is that the controller-pod throws an exception when processing an Ingress event. I'm not sure if the problem is found in/can be fixed in Bunkerweb or Stackit, but I thought I might as well let you know.
Thanks and best wishes
How to reproduce?
Deploy Bunkerweb as an ingress controller in a Stackit Managed Kubernetes Environment
Configuration file(s) (yaml or .env)
Relevant log output
BunkerWeb version
1.5.5
What integration are you using?
Kubernetes
Linux distribution (if applicable)
No response
Removed private data
Code of Conduct