Open olanystrom opened 1 week ago
That's not great. Have you tried simply restarting glueforward? If the problem persists, then that's probably something with your authentication.
I'll look into that anyway, it shouldn't happen. Thanks for the report.
Edit / todo for myself :
I did a docker compose restart glueforward
at 2024-11-11 11:55:55
, that is why it managed to set the new port. I think the container was just hanging until I noticed that my port was not forwarding anymore and restarted glueforward.
Should be fixed in the newly released v1.0.2
, with the addition of commit #6811f92.
Feel free to reopen that issue or create another one if the problem reappears.
Problem is still there. It fails once and then exits since it raises QBittorrentAuthFailed exeption.
I am adding restart: unless-stopped to the docker compose service to restart it after it exits.
01adef8cd6b5 ghcr.io/geoffreycoulaud/glueforward:latest "python main.py" 26 hours ago Exited (2) 6 hours ago glueforward
Last logs of container, exits after auth error to qbittorrent.
glueforward | 2024-11-13 15:00:08,153 [INFO] Forwarded port hasn't changed glueforward | 2024-11-13 15:01:08,155 [INFO] Forwarded port hasn't changed glueforward | 2024-11-13 15:02:08,156 [INFO] Forwarded port hasn't changed glueforward | 2024-11-13 15:03:08,208 [CRITICAL] Could not authenticate to qBittorrent glueforward | Traceback (most recent call last): glueforward | File "/glueforward/qbittorrent.py", line 78, in set_port glueforward | response.raise_for_status() glueforward | File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 763, in raise_for_status glueforward | raise HTTPStatusError(message, request=request, response=self) glueforward | httpx.HTTPStatusError: Client error '403 Forbidden' for url 'http://gluetun:8089/api/v2/app/setPreferences' glueforward | For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 glueforward | glueforward | The above exception was the direct cause of the following exception: glueforward | glueforward | Traceback (most recent call last): glueforward | File "/glueforward/main.py", line 100, in run glueforward | self._loop() glueforward | File "/glueforward/main.py", line 91, in _loop glueforward | self.__qbittorrent.set_port(forwarded_port) glueforward | File "/glueforward/qbittorrent.py", line 84, in set_port glueforward | raise QBittorrentAuthFailed( glueforward | qbittorrent.QBittorrentAuthFailed: ('Failed to authenticate to qBittorrent', 403, 'Forbidden')
And after docker compose up -d glueforward
glueforward | 2024-11-13 21:25:04,355 [INFO] Listening port set to 61547
I am running latest version
1.0.2
It's hard to say if it works right now, because the expected behaviour is :
If you could provide a consistent way to reproduce the issue, that would help me a lot too.
I think the behavior is not like that.
It looks like it is.
1) Try to set qbt port
2) fail with 403
3) reset cookies
4) still throw the exception.
5) exit python app and docker container.
..
6) restart container on error ( I added restart: unless-stopped
to docker-compose)
7) reauth, change port in qbit and continue
glueforward | 2024-11-17 17:42:57,527 [INFO] HTTP Request: GET http://gluetun:8000/v1/openvpn/portforwarded "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:42:57,528 [INFO] Forwarded port hasn't changed
glueforward | 2024-11-17 17:43:57,529 [INFO] HTTP Request: GET http://gluetun:8000/v1/openvpn/portforwarded "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:43:57,529 [INFO] Forwarded port hasn't changed
glueforward | 2024-11-17 17:44:57,531 [INFO] HTTP Request: GET http://gluetun:8000/v1/openvpn/portforwarded "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:44:57,989 [INFO] HTTP Request: POST http://gluetun:8089/api/v2/app/setPreferences "HTTP/1.1 403 Forbidden"
glueforward | 2024-11-17 17:44:57,989 [DEBUG] qBittorrent client authentication reset
glueforward | 2024-11-17 17:44:57,989 [CRITICAL] Could not authenticate to qBittorrent
glueforward | Traceback (most recent call last):
glueforward | File "/glueforward/qbittorrent.py", line 78, in set_port
glueforward | response.raise_for_status()
glueforward | File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 763, in raise_for_status
glueforward | raise HTTPStatusError(message, request=request, response=self)
glueforward | httpx.HTTPStatusError: Client error '403 Forbidden' for url 'http://gluetun:8089/api/v2/app/setPreferences'
glueforward | For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
glueforward |
glueforward | The above exception was the direct cause of the following exception:
glueforward |
glueforward | Traceback (most recent call last):
glueforward | File "/glueforward/main.py", line 100, in run
glueforward | self._loop()
glueforward | File "/glueforward/main.py", line 91, in _loop
glueforward | self.__qbittorrent.set_port(forwarded_port)
glueforward | File "/glueforward/qbittorrent.py", line 84, in set_port
glueforward | raise QBittorrentAuthFailed(
glueforward | qbittorrent.QBittorrentAuthFailed: ('Failed to authenticate to qBittorrent', 403, 'Forbidden')
glueforward | 2024-11-17 17:45:11,374 [DEBUG] load_ssl_context verify=True cert=None trust_env=True http2=False
glueforward | 2024-11-17 17:45:11,376 [DEBUG] load_verify_locations cafile='/usr/local/lib/python3.12/site-packages/certifi/cacert.pem'
glueforward | 2024-11-17 17:45:11,402 [DEBUG] Gluetun client created with base url http://gluetun:8000
glueforward | 2024-11-17 17:45:11,402 [DEBUG] load_ssl_context verify=True cert=None trust_env=True http2=False
glueforward | 2024-11-17 17:45:11,403 [DEBUG] load_verify_locations cafile='/usr/local/lib/python3.12/site-packages/certifi/cacert.pem'
glueforward | 2024-11-17 17:45:11,428 [DEBUG] qBittorrent client created with base url http://gluetun:8089
glueforward | 2024-11-17 17:45:11,437 [INFO] HTTP Request: GET http://gluetun:8000/v1/openvpn/portforwarded "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:45:11,530 [INFO] HTTP Request: POST http://gluetun:8089/api/v2/auth/login "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:45:11,530 [DEBUG] qBittorrent client authenticated
glueforward | 2024-11-17 17:45:12,294 [INFO] HTTP Request: POST http://gluetun:8089/api/v2/app/setPreferences "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:45:12,294 [INFO] Listening port set to 61572
glueforward | 2024-11-17 17:46:12,295 [INFO] HTTP Request: GET http://gluetun:8000/v1/openvpn/portforwarded "HTTP/1.1 200 OK"
glueforward | 2024-11-17 17:46:12,296 [INFO] Forwarded port hasn't changed
gluetun restarted tunnel (probably) and my forwarded port changed. For some reason qbittorrent responded 403 error, and glueforward hangs. I had to restart the contaiuner. I haven't changed the password before or after, just qbittorrent having a bad day or restarting at the same time or something.