Open alexg-k opened 1 year ago
Same issue here. It works at first but after some time it fails with the same logs.
Doing a docker compose down
and a docker compose up
again make it work again but this is not ideal.
In my own use, I've noticed something similar. Things will work fine, then requests to port 5351
of the VPN provider will fail, and later requests will succeed again.
I believe this is because the VPN provider's NAT-PMP service is unstable. After all, no VPN provider is guaranteeing 100% uptime for NAT-PMP. When it's down, requests to port 5351
will fail.
Hi Jordan! First off, thank you for your work on this.
I'm seeing this error too, but I think it's because I suspect my setup is talking to the wrong gateway. When I install natpmpc
in my lscr.io/linuxserver/transmission
docker instance things will not work until I manually specify the gateway IP as seen below:
output of just running natpmpc
:
initnatpmp() returned 0 (SUCCESS)
using gateway : 172.31.200.1
sendpublicaddressrequest returned 2 (SUCCESS)
readnatpmpresponseorretry returned -7 (FAILED)
readnatpmpresponseorretry() failed : the gateway does not support nat-pmp
errno=111 'Connection refused'
vs the output of running natpmpc -g 10.2.0.1
:
initnatpmp() returned 0 (SUCCESS)
using gateway : 10.2.0.1
sendpublicaddressrequest returned 2 (SUCCESS)
readnatpmpresponseorretry returned 0 (OK)
Public IP address : xxx.xxx.xxx.xxx
epoch = 8420689
closenatpmp() returned 0 (SUCCESS)
Would it be possible to add an environment variable to specify the gateway port manually? Something like NAT_PMP_GATEWAY=10.2.0.1
Update: Just noticed this mod pulls the gateway ip like so: $(grep nameserver /etc/resolv.conf | awk '{print $2}')
which for me resolves to 127.0.0.11
and running natpmpc -g 127.0.0.11
does indeed return Connection refused
.
Hey @aartrost , that shouldn't be a problem! Just need to update this line to respect the NAT_PMP_GATEWAY
environment variable before relying on the default.
Unfortunately, I won't be able to implement and test this soon. But I'd happily accept a PR!
I built and published the change above here: aartr/transmission-nat-pmp
in case you want to give it a spin. It works well on my end.
Brilliant, thank you for doing that! Just left 1 comment 👍
Excellent work! PR merged 🥳
Good stuff! For anyone looking to change their nat-pmp gateway IP, this should now do the trick:
-e 'DOCKER_MODS'='jordanpotter/docker-mods:transmission-nat-pmp'
-e 'GATEWAY'='10.2.0.1'
I repeatedly get the error message
failed to add port mapping: read udp 127.0.0.1:54156->127.0.0.11:5351: recvfrom: connection refused
when using your docker-mod. Maybe by looking at my compose file and the error log, you can advice me where to look next. Thanks!compose.yaml
And here are the error messages: