Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Transmission Openvpn] FATAL: Ovpn file not found at location provided #978

Closed
almico opened this issue Sep 4, 2023 · 14 comments
Closed
Labels
bug Something isn't working stale Element will be closed automatically

Comments

@almico
Copy link

almico commented Sep 4, 2023

Description

Starting the addon, it stops with the following error:

Updating variables
Using PUID 1000 and PGID 1000
[09:02:09] INFO: Custom openvpn provider selected
[09:02:09] FATAL: Ovpn file not found at location provided : /config/openvpn/de123.ovpn
/etc/cont-init.d/99-run.sh: exiting 1

Reproduction steps

Start the addon.

Addon Logs

Starting...
/etc/cont-init.d/00-banner.sh: executing
-----------------------------------------------------------
 Add-on: Transmission Openvpn
 Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
-----------------------------------------------------------
 Add-on version: v5.1.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (amd64 / qemux86-64)
 Home Assistant Core: 2023.8.4
 Home Assistant Supervisor: 2023.08.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
 Defining permissions for main user : 
User UID: 1000
User GID : 1000
-----------------------------------------------------------
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
Mounting smb share(s)...
Using PUID 1000 and PGID 1000
[09:01:57] INFO: ... //192.168.1.1/shared successfully mounted to /mnt/shared with options ,uid=1000,gid=1000,iocharset=utf8
/etc/cont-init.d/01-custom_script.sh: executing
[09:01:57] INFO: Execute /config/addons_autoscripts/transmission-openvpn.sh if existing
[09:01:57] INFO: ... no script found
/etc/cont-init.d/32-nginx_ingress.sh: executing
/etc/cont-init.d/90-dns_set.sh: executing
[09:01:58] INFO: DNS SERVERS set to 1.1.1.1 8.8.8.8 
/etc/cont-init.d/99-run.sh: executing
[09:01:58] INFO: Updating transmission to v3
[09:01:58] WARNING: If your previous version was v2, remove and add torrents again
--2023-09-04 09:01:58--  https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xa37da909ae70535824d82620976b5901365c5ca1
Resolving keyserver.ubuntu.com (keyserver.ubuntu.com)... 185.125.188.26, 185.125.188.27, 2620:2d:4000:1007::d43, ...
Connecting to keyserver.ubuntu.com (keyserver.ubuntu.com)|185.125.188.26|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1804 (1.8K) [text/plain]
Saving to: '976b5901365c5ca1.key'
     0K .                                                     100%  836M=0s
2023-09-04 09:01:58 (836 MB/s) - '976b5901365c5ca1.key' saved [1804/1804]
debconf: delaying package configuration, since apt-utils is not installed
[09:02:05] INFO: Exporting variables
DEBUG=false
DNS_server=8.8.8.8,1.1.1.1
LOCAL_NETWORK=192.168.0.0/16
OPENVPN_CUSTOM_PROVIDER=true
OPENVPN_CUSTOM_PROVIDER_OVPN_LOCATION=/config/openvpn/de123.ovpn
OPENVPN_PASSWORD=xxx
OPENVPN_USERNAME=yyy
PGID=1000
PUID=1000
TRANSMISSION_DOWNLOAD_DIR=/mnt/shared/transmission/downloads
TRANSMISSION_HOME=/config/addons_config/transmission
TRANSMISSION_INCOMPLETE_DIR=/mnt/shared/transmission/incomplete
TRANSMISSION_V3_UPDATE=true
TRANSMISSION_WATCH_DIR=/mnt/shared/transmission/watch_dir
TRANSMISSION_WEB_UI=transmission-web-control
auto_restart=true
cifspassword=xxx
cifsusername=yyy
networkdisks=//192.168.1.1/shared
Updating variables
Using PUID 1000 and PGID 1000
[09:02:09] INFO: Custom openvpn provider selected
[09:02:09] FATAL: Ovpn file not found at location provided : /config/openvpn/de123.ovpn
/etc/cont-init.d/99-run.sh: exiting 1

Architecture

amd64

OS

HAos

@almico almico added the bug Something isn't working label Sep 4, 2023
@Rbillon59
Copy link

Rbillon59 commented Sep 4, 2023

Hello, facing the same issue since updating to v5.1.0 (was working properly on v5.0.2)

Seems to come from this commit / line

Using Shell, if [ ! -f "$OVPNLOCATION" ] try to check the existence of a file.

To check for a directory, you need to use if [ ! -d "$OVPNLOCATION" ]

@alexbelgium
Copy link
Owner

Thanks! Nice spotting I'll check a bit later when I have time

alexbelgium added a commit that referenced this issue Sep 4, 2023
@alexbelgium
Copy link
Owner

Should be good!

@Rbillon59
Copy link

Should be good!

Hi, impossible to install on my side

Screenshot_2023-09-04-22-20-18-80_c3a231c25ed346e59462e84656a70e50.jpg

@alexbelgium
Copy link
Owner

Thanks, relaunched

@Rbillon59
Copy link

So actually, the fix worked and did not fail as before.

I don't know if it was related to my configuration (which worked before). But

my personal config was named user.ovpn and stored in like /config/ovpn/user.ovpn and I set the OPENVPN_CUSTOM_PROVIDER_OVPN_LOCATION to exactly that.

I had an error saying

ERROR: Could not find any configs for provider USER in downloaded configs

The workaround found after examining a bit what the docker image does was to create a folder named user (the name of the ovpn file without the extention) in /config/addons_config/transmission_openvpn/vpn-configs-contrib/openvpn/ and put my user.ovpn file there

So at the end, the full path was /config/addons_config/transmission_openvpn/vpn-configs-contrib/openvpn/user/user.ovpn

@alexbelgium
Copy link
Owner

Happy it worked for you but it seems the code isn't very robust... One day I'll have to work on improving that

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale Element will be closed automatically label Sep 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2023
@almico
Copy link
Author

almico commented Sep 19, 2023

Doesn't work for me:

Starting container with revision: 48299204d160d2d699ce6dd5ccdfcba0ecf13c83
TRANSMISSION_HOME is currently set to: /config/addons_config/transmission_openvpn/transmission-home
Using OpenVPN provider: DK263.NORDVPN.COM.UDP
Running with VPN_CONFIG_SOURCE auto
No bundled config script found for DK263.NORDVPN.COM.UDP. Defaulting to external config
Will get configs from https://github.com/haugene/vpn-configs-contrib.git
Cloning https://github.com/haugene/vpn-configs-contrib.git into /config/addons_config/transmission_openvpn/vpn-configs-contrib
Cloning into '/config/addons_config/transmission_openvpn/vpn-configs-contrib'...
ERROR: Could not find any configs for provider DK263.NORDVPN.COM.UDP in downloaded configs

@Rbillon59
Copy link

@almico I faced the same issue, you can follow my workaround, I believe it will work for you as well

@almico
Copy link
Author

almico commented Sep 19, 2023

Thank you, @Rbillon59, it worked.
It's ugly, but it works.
I hope it will not require me to do the same after some addon restart.

@Rbillon59
Copy link

Thank you, @Rbillon59, it worked.
It's ugly, but it works.
I hope it will not require me to do the same after some addon restart.

No, it's data mounted from the host to the container, they will persist

@almico
Copy link
Author

almico commented Sep 19, 2023

I think the containing directory is retrieved from github. If it's updated, it might be completely overwritten, depending on the settings, I think.
We'll see 😄

@alexbelgium
Copy link
Owner

Hi, from version "v5.3.1-6", the custom vpn configuration changes. The way it works is by mapping the /config/addons_config/transmission/openvpn folder to the /etc/openvpn/custom, as per normal way of working for the Haugene's transmission openvpn github. No more strange workarounds as before.

Here is how to make it work :
BREAKING CHANGE FOR CUSTOM VPN : if you are using a custom VPN provider, you must remove OPENVPN_CUSTOM_PROVIDER from your addon option and instead set OPENVPN_PROVIDER to "custom", then reference your ovpn file in your "OPENVPN_CONFIG". For example, if AIRVPN has provided to you an *.ovpn filed named AIRVPN.ovpn, you need to install an addon such as Filebrowser, go in the /config/addons_config/transmission/openvpn folder and put the AIRVPN.ovpn here. Then, in the addon option you need to write "AIRVPN" in the "OPENVPN_CONFIG" option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Element will be closed automatically
Projects
None yet
Development

No branches or pull requests

3 participants