Closed almico closed 2 years ago
Hi, is this a new behavior ? As this seems an upstream behavior. Or it is due to the "latest" image and I'll revert to the "4.0" one. Thanks
I can't answer with absolute certainty. I moved from a Raspberry PI 4B to a VM inside an Intel i5. All I know is I faced it today for the first time π
Do you have a custom config file for which you could remove the β--ping-restartβ directive that is mentioned at the top of your excerpt?
Do you want me to try deleting it? As far as I remember, it's set by the VPN provider in its config.
The same issue happened with "4.0-v17". This is from the logs:
Mon Aug 29 07:47:12 2022 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Mon Aug 29 07:47:12 2022 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Mon Aug 29 07:47:12 2022 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 4096 bit RSA
Mon Aug 29 07:55:16 2022 Connection reset command was pushed by server ('[N]')
Mon Aug 29 07:55:16 2022 SIGTERM received, sending exit notification to peer
Mon Aug 29 07:55:17 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.3.2 255.255.255.0 init
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Mon Aug 29 07:55:21 2022 /sbin/ip route del [redacted]/32
Mon Aug 29 07:55:21 2022 /sbin/ip route del 0.0.0.0/1
Mon Aug 29 07:55:21 2022 /sbin/ip route del 128.0.0.0/1
Mon Aug 29 07:55:21 2022 Closing TUN/TAP interface
Mon Aug 29 07:55:21 2022 /sbin/ip addr del dev tun0 10.8.3.2/24
Mon Aug 29 07:55:21 2022 SIGTERM[soft,exit-with-notification] received, process exiting
2022/08/29 08:48:12 [error] 742#742: *36987 connect() failed (111: Connection refused) while connecting to upstream, client: 172.30.32.2, server: db21ed7f-transmission-openvpn, request: "GET /web/ HTTP/1.1", upstream: "http://127.0.0.1:9091/transmission/web/", host: "192.168.16.18:8123", referrer: "http://192.168.16.18:8123/db21ed7f_transmission_openvpn"
I'm going to upgrade to "4.0-v18" and see what happens.
This issue is still there, using 4.0-v19
Thanks ; however I honestly have no idea of what could help. I could revert the image back to 4.0 instead of latest if you'd prefer
If I got it correctly, in /etc/cont-init.d/99-run.sh
you execute /./etc/openvpn/start.sh & echo ""
.
That script, in turn, executes exec openvpn ${TRANSMISSION_CONTROL_OPTS} ${OPENVPN_OPTS} --config "${CHOSEN_OPENVPN_CONFIG}"
that, I think, triggers tunnelUp.sh
.
So far, everything is ok.
The problem should be that openvpn is shut down either because of some inactivity timeout, or because of an explicit (remote?) reset request. That triggers the execution of tunnelDown.sh
, and that's the end of the story π
All that should be needed is a restart of openvpn (a new exec openvpn...
?). Maybe from within tunnelDown.sh
?
Hi, this looks like https://github.com/haugene/docker-transmission-openvpn/issues/2063
The recommandation is to have an automation to restart the container... https://haugene.github.io/docker-transmission-openvpn/faq/#set_the_ping-exit_option_for_openvpn_and_restart-flag_in_docker
Can't you activate the HA option of "guard dog" that restarts the container in case of issues?
Thanks for the analysis, I've replaced the tunnel own script by an automatic addon restart. This is comparable to openvpn restart but avoids deal g with potential network issues. Could you please test? Thanks!
Actually I could try just to restart just the openvpn but globally it's the same, except that restarting the addon should avoid ip leakage
Upgrading now π
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@alexbelgium There must be a bug in the "resurrect" script π
Mon Sep 19 18:17:39 2022 [antanex.com] Inactivity timeout (--ping-restart), restarting
Mon Sep 19 18:17:39 2022 SIGTERM received, sending exit notification to peer
Mon Sep 19 18:17:40 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.1.3 255.255.255.0 init
parse error: Expected string key before ':' at line 1, column 4
[16:17:40] ERROR: Unknown HTTP error occured
Mon Sep 19 18:17:40 2022 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Mon Sep 19 18:17:40 2022 Exiting due to fatal error
The only option, for me, is manually restart the addon.
Hi, I've pushed a new version, could you please test it? Thanks
Thank you. I upgraded last night. Will post findings π
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi @alexbelgium π Unfortunately, the issue is still there:
Wed Oct 12 02:08:41 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Wed Oct 12 02:08:41 2022 SIGTERM received, sending exit notification to peer
Wed Oct 12 02:08:42 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.0.4 255.255.255.0 init
parse error: Expected string key before ':' at line 1, column 4
[00:08:42] ERROR: Unknown HTTP error occured
Wed Oct 12 02:08:42 2022 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Wed Oct 12 02:08:42 2022 Exiting due to fatal error
The only option is a manual restart.
You could try to check the content of the /etc/openvpn/tunnelDown.sh file using portainer. If I find some time I'll reinstall the addon to test
I already looked at that file, but it makes no sense to me. If I execute it manually, it succeeds, but this is true while everything is working fine.
My best guess is that script is executed in a different system state, and, most likely, it is some other script that is, called by it, failing. In other words, I fear the "parse error" is not coming directly from /etc/openvpn/tunnelDown.sh, but from, say bashio::addon.restart
.
Hi, please try this version I've added api access to see if it changes anything
Will report as soon as anything relevant happens π
Thu Oct 13 16:46:18 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Thu Oct 13 16:46:18 2022 SIGTERM received, sending exit notification to peer
Thu Oct 13 16:46:19 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.2.2 255.255.255.0 init
parse error: Expected string key before ':' at line 1, column 4
[14:46:19] ERROR: Unknown HTTP error occured
Thu Oct 13 16:46:19 2022 WARNING: Failed running command (--up/--down): external program exited with error status: 1
Thu Oct 13 16:46:19 2022 Exiting due to fatal error
Same as before. I really cannot understand in what file is expected to be that ":" at line 1, column 4 π
I wonder if this is because the bashio command requires root, and the script is launched from a user... I think it means it can't read the options.json file, which requires root access, or that the /data is chmod -R 755
Some result, different error message, this time:
Sun Oct 16 02:43:32 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Sun Oct 16 02:43:32 2022 SIGTERM received, sending exit notification to peer
Sun Oct 16 02:43:33 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.2.4 255.255.255.0 init
Sun Oct 16 02:43:33 2022 WARNING: Failed running command (--up/--down): could not execute external program
Sun Oct 16 02:43:33 2022 Exiting due to fatal error
Transmission Openvpn Current version: 4.0-v28
Mon Oct 17 10:22:17 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Mon Oct 17 10:22:17 2022 SIGTERM received, sending exit notification to peer
Mon Oct 17 10:22:18 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.1.4 255.255.255.0 init
[08:22:18] FATAL: Tunnel down, addon restarting in 15 seconds
parse error: Expected string key before ':' at line 1, column 4
[08:22:33] ERROR: Unknown HTTP error occured
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Mon Oct 17 10:22:35 2022 /sbin/ip route del 7.25.11.62/32
Mon Oct 17 10:22:36 2022 /sbin/ip route del 0.0.0.0/1
Mon Oct 17 10:22:36 2022 /sbin/ip route del 128.0.0.0/1
Mon Oct 17 10:22:36 2022 Closing TUN/TAP interface
Mon Oct 17 10:22:36 2022 /sbin/ip addr del dev tun0 10.8.1.4/24
Mon Oct 17 10:22:36 2022 SIGTERM[soft,exit-with-notification] received, process exiting
This time, the addon died differently, but died π
Transmission Openvpn Current version: 4.0-v25
Tue Oct 18 14:38:24 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Tue Oct 18 14:38:24 2022 SIGTERM received, sending exit notification to peer
Tue Oct 18 14:38:25 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.3.6 255.255.255.0 init
[12:38:25] FATAL: Tunnel down, addon restarting in 15 seconds
/./usr/bin/restart_addon: line 9: __BASHIO_LIB_DIR: readonly variable
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Tue Oct 18 14:38:44 2022 /sbin/ip route del 7.25.1.61/32
Tue Oct 18 14:38:44 2022 /sbin/ip route del 0.0.0.0/1
Tue Oct 18 14:38:44 2022 /sbin/ip route del 128.0.0.0/1
Tue Oct 18 14:38:44 2022 Closing TUN/TAP interface
Tue Oct 18 14:38:44 2022 /sbin/ip addr del dev tun0 10.8.3.6/24
Tue Oct 18 14:38:44 2022 SIGTERM[soft,exit-with-notification] received, process exiting
What I see in the UI is:
I think the UI is there, but the underlying Transmission is gone π
I see there is a new version of the add-on. Installing now π
Hi, indeed it seems the container env doesn't get pulled in and I try to force it manually through trials and errors given I can't find a way to replicate it using portainer
No more errors but not working anyway ;)
Transmission Openvpn Current version: 4.0-v27
Wed Oct 19 09:05:59 2022 Connection reset command was pushed by server ('[N]')
Wed Oct 19 09:05:59 2022 SIGTERM received, sending exit notification to peer
Wed Oct 19 09:06:00 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.3.3 255.255.255.0 init
[07:06:00] FATAL: Tunnel down, addon restarting in 15 seconds
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Wed Oct 19 09:06:19 2022 /sbin/ip route del 4.23.15.6/32
Wed Oct 19 09:06:19 2022 /sbin/ip route del 0.0.0.0/1
Wed Oct 19 09:06:19 2022 /sbin/ip route del 128.0.0.0/1
Wed Oct 19 09:06:19 2022 Closing TUN/TAP interface
Wed Oct 19 09:06:19 2022 /sbin/ip addr del dev tun0 10.8.3.3/24
Wed Oct 19 09:06:19 2022 SIGTERM[soft,exit-with-notification] received, process exiting
Basically, it looks like transmission-daemon is taken down, but never started again.
It also looks as if the curl command for the supervisor restart of the addon doesn't work ;-)
Another solution could be to link the finish script with the start one but the it would be an endless loop
It also looks as if the curl command for the supervisor restart of the addon doesn't work ;-)
Do you have the command, and the error? Can I find them somewhere?
Hi, the bashio::addon.restart
function is described in this library : https://github.com/hassio-addons/bashio/blob/main/lib/addons.sh
If we follow the different logic, it seems to arrive to this command : curl --silent --show-error \ --write-out '\n%{http_code}' --request "${method}" \ -H "${auth_header}" \ -H "Content-Type: application/json" \ -d "${data}" \ "${__BASHIO_SUPERVISOR_API}${resource}"
where $method = POST ; $resource=/addons/transmission_openvpn/restart ; $auth_header, $__BASHIO_SUPERVISOR_API are described in the container env
It also looks as if the curl command for the supervisor restart of the addon doesn't work ;-)
To be honest, this is something I saw in previous reports. Now, I can no longer see any trace of that in my report.
As far as I can see, the failure pattern is always the same now:
Wed Oct 19 09:05:59 2022 Connection reset command was pushed by server ('[N]')
Wed Oct 19 09:05:59 2022 SIGTERM received, sending exit notification to peer
Wed Oct 19 09:06:00 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.3.3 255.255.255.0 init
[07:06:00] FATAL: Tunnel down, addon restarting in 15 seconds
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Wed Oct 19 09:06:19 2022 /sbin/ip route del 4.23.15.6/32
Wed Oct 19 09:06:19 2022 /sbin/ip route del 0.0.0.0/1
Wed Oct 19 09:06:19 2022 /sbin/ip route del 128.0.0.0/1
Wed Oct 19 09:06:19 2022 Closing TUN/TAP interface
Wed Oct 19 09:06:19 2022 /sbin/ip addr del dev tun0 10.8.3.3/24
Wed Oct 19 09:06:19 2022 SIGTERM[soft,exit-with-notification] received, process exiting
In the log above, I do not see any message about "Restarting Transmission daemon". I would expect something like that, since there is a "Sending kill signal to transmission-daemon".
New error message in logs, this time!
Tue Oct 25 18:54:27 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Tue Oct 25 18:54:27 2022 SIGTERM received, sending exit notification to peer
Tue Oct 25 18:54:29 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.0.3 255.255.255.0 init
/etc/openvpn/tunnelDown.sh: /./usr/bin/restart_addon: /usr/bin/with-contenv: bad interpreter: No such file or directory
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Tue Oct 25 18:54:33 2022 /sbin/ip route del 6.23.1.12/32
Tue Oct 25 18:54:33 2022 /sbin/ip route del 0.0.0.0/1
Tue Oct 25 18:54:33 2022 /sbin/ip route del 128.0.0.0/1
Tue Oct 25 18:54:33 2022 Closing TUN/TAP interface
Tue Oct 25 18:54:33 2022 /sbin/ip addr del dev tun0 10.8.0.3/24
Tue Oct 25 18:54:33 2022 SIGTERM[soft,exit-with-notification] received, process exiting
Hi again @alexbelgium π So, it all boils down to this
/./usr/bin/restart_addon: /usr/bin/with-contenv: bad interpreter: No such file or directory
where the key point is that /usr/bin/with-contenv
does not exist anywhere in the system.
Thanks, I'll put back the previous one, but it still won't solve why the bashio command to restart the add-on doesn't work...
Commit to restore the shebang : https://github.com/alexbelgium/hassio-addons/commit/72bd04aa30b2e3a431412c777a333e68b1a20b8a
We're back to the old version of the issue π
Thu Nov 3 09:00:35 2022 [somevpn.org] Inactivity timeout (--ping-restart), restarting
Thu Nov 3 09:00:35 2022 SIGTERM received, sending exit notification to peer
Thu Nov 3 09:00:36 2022 /etc/openvpn/tunnelDown.sh tun0 1500 1585 10.8.3.2 255.255.255.0 init
[08:00:36] FATAL: Tunnel down, addon restarting in 15 seconds
resolv.conf was restored
Sending kill signal to transmission-daemon
Waiting 5s for transmission-daemon to die
Successfuly closed transmission-daemon
Thu Nov 3 09:00:55 2022 /sbin/ip route del 9.23.11.2/32
Thu Nov 3 09:00:55 2022 /sbin/ip route del 0.0.0.0/1
Thu Nov 3 09:00:55 2022 /sbin/ip route del 128.0.0.0/1
Thu Nov 3 09:00:55 2022 Closing TUN/TAP interface
Thu Nov 3 09:00:55 2022 /sbin/ip addr del dev tun0 10.8.3.2/24
Thu Nov 3 09:00:55 2022 SIGTERM[soft,exit-with-notification] received, process exiting
Ah, ah, I see you are persistent with this issue. I'm really sorry that I don't know how to solve this. Perhaps I could add a local ping with cron but I fear the impact on the addon resources
Hi, if you activate the new auto_restart bool, it should check every hour if the vpn is up. If not, it should automatically restart the addon. Could you please try? Thanks
It doesn't work:
Updating variables
Using PUID 1000 and PGID 1000
[13:01:37] INFO: Custom openvpn provider selected
Copying ovpn file to proper location
Exporting variable for custom provider : somevpn.org
[13:01:37] INFO: Auto restarting addon if openvpn down for more than 1h
chmod: cannot access '/etc/cron.hourly/cronupdate': No such file or directory
/etc/cont-init.d/99-run.sh: exiting 1
I had already pushed a new version, sorry
New version pushed to have the cron show in addon log
Doesn't work, same error
I think it now works. I've pushed a new version
Installing 4.0-v40
now π
Ah ah ah π Then, I will install 4.0-v41
!
Both have the same code but 41 has an additional message to say after rebooting that it was rebooted
Which addon?
Describe the bug
When the VPN tries to restart, everything is taken down.
To Reproduce
Wait for the VPN to restart.
Full addon log
I'm pasting the relevant part of the log. I can post the beginning, if needed.
Full addon config
System