docker-transmission-openvpn icon indicating copy to clipboard operation
docker-transmission-openvpn copied to clipboard

Creating TUN device /dev/net/tun mknod: /dev/net/tun: File exists

Open gettingerr opened this issue 3 years ago • 5 comments

Is there a pinned issue for this?

  • [X] I have read the pinned issues and could not find my issue

Is there an existing or similar issue/discussion for this?

  • [X] I have searched the existing issues
  • [X] I have searched the existing discussions

Is there any comment in the documentation for this?

  • [X] I have read the documentation, especially the FAQ and Troubleshooting parts

Is this related to a provider?

  • [X] I have checked the provider repo for issues
  • [X] My issue is NOT related to a provider

Are you using the latest release?

  • [X] I am using the latest release

Have you tried using the dev branch latest?

  • [x] I have tried using dev branch

Docker run config used

Transmission Configs

Current Behavior

When trying to start the container, it hangs and loops with the following log: Starting container with revision: 67ae2da5c1f3ddb2b969dacb4bbcd62cacde8ace Creating TUN device /dev/net/tun mknod: /dev/net/tun: File exists

I can manually delete the file: /dev/net/tun and then start the container and it will function normally for some time, but anytime the container updates/restarts itself for any reason, the error reoccurs which leads to a nonfunctioning container until I go in manually and stop it, delete the file, then start it again. There are no other log errors while starting or running the container.

Expected Behavior

Container starts normally without the aforementioned error and is able to start itself after updates/restarts without user intervention.

How have you tried to solve the problem?

All configs are valid and do not have other errors. I have attempted with no success to implement code to automatically delete the tun file on startup of the container but this wouldn't solve the problem, just make it bearable.

Log output

Starting container with revision: 67ae2da5c1f3ddb2b969dacb4bbcd62cacde8ace Creating TUN device /dev/net/tun mknod: /dev/net/tun: File exists

HW/SW Environment

- OS: Unraid Version 6.9.2
- Docker: 20.10.5

Anything else?

No response

gettingerr avatar Jul 17 '22 15:07 gettingerr

I am having this exact same issue and using Unraid. Deleting the tun file temporarily "fixes" the issue.

dustinwilson avatar Jul 31 '22 15:07 dustinwilson

I recommend you looking into creating a script that is called when the container goes down/connection drops, which deletes the tun file. This is highly platform dependent, so I would also recommend looking into Unraid forum or such.

pkishino avatar Aug 01 '22 00:08 pkishino

I recommend you looking into creating a script that is called when the container goes down/connection drops, which deletes the tun file. This is highly platform dependent, so I would also recommend looking into Unraid forum or such.

I could likely spend some more time getting this sort of script figured out. I was hoping to find a real solution or get to the root of the problem rather than using this bandaid method.

gettingerr avatar Aug 01 '22 00:08 gettingerr

well, then you could look into forking the dev branch, edit the https://github.com/haugene/docker-transmission-openvpn/blob/dev/openvpn/tunnelDown.sh script to delete tun when the tunnel goes down. I don't see this problem on other platforms and I am unfamiliar with how Unraid works in details so your best bet is to experiment and when successful please submit a PR.

pkishino avatar Aug 01 '22 00:08 pkishino

As far as Docker is concerned Unraid is just Slackware. Unraid isn't doing anything to the container or images. Its web UI just runs cli commands to maintain docker images. Unraid has no issue with your running the commands yourself in the terminal. Prior to this I was having the issue with ipvanish where they changed something on their end and it stopped working. I ended up editing the openvpn/start.sh file to delete it if present after checking the config option to create the tun file, and it works.

dustinwilson avatar Aug 01 '22 19:08 dustinwilson

For what its worth, I also have this issue on unraid (and ipvanish). I had the issue with ipvanish config location moving. I'm now running the dev branch as that had the fix for that in and am encountering the same error described here. I followed the suggestion from @dustinwilson above to edit start.sh and remove the file before creating it. I don't know enought about this to know if that should be proposed as a permanent fix though.

dg-101 avatar Aug 18 '22 12:08 dg-101

I have the same issue, except with OVPN provider Creating TUN device /dev/net/tun mknod: /dev/net/tun: File exists Options error: You must define TUN/TAP device (--dev)

I'm not running in unraid though. I am using docker-compose in a regular linux distro environment

It worked fine until a recent change in how the OVPN config is setup, for which I have updated it with what I have found.

edit: in the meanwhile i have downgraded from latest to 3.7.1 as that one still works fine for me

Snuffsis avatar Aug 21 '22 09:08 Snuffsis

I have the same issue, except with OVPN provider Creating TUN device /dev/net/tun mknod: /dev/net/tun: File exists Options error: You must define TUN/TAP device (--dev)

I'm not running in unraid though. I am using docker-compose in a regular linux distro environment

It worked fine until a recent change in how the OVPN config is setup, for which I have updated it with what I have found.

edit: in the meanwhile i have downgraded from latest to 3.7.1 as that one still works fine for me

I did this too, set it up for 3.7.1 and it works. I think there is an issue with the dev repo

ZerkerEOD avatar Aug 25 '22 02:08 ZerkerEOD

Yeah, Unraid is just Slackware. It does nothing weird to Docker to make it behave differently, so if it happens on Unraid it's liable to happen elsewhere.

Anyway, I created a pull request for this that includes the fix I use in my own container: https://github.com/haugene/docker-transmission-openvpn/pull/2328. I created one a week ago, but I mistakenly created it on master instead of dev; my mistake.

dustinwilson avatar Aug 25 '22 05:08 dustinwilson

Yeah, its weird thought if i used docker compose it worked but when I transferred out of using compose for better unraid integration is when it broke. Both were on the dev image. So not sure why.

ZerkerEOD avatar Aug 25 '22 05:08 ZerkerEOD