-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hello, I got a problem that leads to a crash in kraken when I try to run it with the http_proxy environment variable set but its value does not contain username and password, leading to the following error:
(chaos) [user@machine]$ python3 run_kraken.py --config test-config.yaml
2025-05-08 11:45:46,006 [INFO] Starting kraken
2025-05-08 11:45:46,010 [INFO] Initializing client to talk to the Kubernetes cluster
2025-05-08 11:45:46,010 [INFO] Generated a uuid for the run: 30335fb7-9718-4943-b57e-938b55a82ea0
Traceback (most recent call last):
File "//krkn/run_kraken.py", line 160, in main
kubecli = KrknKubernetes(kubeconfig_path=kubeconfig_path)
File "//krkn/chaos/lib64/python3.9/site-packages/krkn_lib/k8s/krkn_kubernetes.py", line 118, in init
self.__initialize_config(kubeconfig_path)
File "/***************************/krkn/chaos/lib64/python3.9/site-packages/krkn_lib/k8s/krkn_kubernetes.py", line 167, in __initialize_config
auth_string = proxy_auth.username + ":" + proxy_auth.password
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
When the http_proxy url is parsed, if the username and password fields are not present in the url, the proxy_auth.username and proxy_auth.password are NoneType instead of an empty string as documented in the parser lib: https://docs.python.org/3/library/urllib.parse.html leading to the error displayed in the console.
In my specific scenario the proxy access does not require a username and password thus leading to this situation. If you could help me understand whether this is a bug or a miss configuration on my part I would appreciate it.
Thanks in advance