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
Miniupnpd and bittorrent improvements #46443
Conversation
@jgillich You seem to have more experience with miniupnpd than I do. What I'm running into is the following:
nixpkgs/nixos/modules/services/networking/miniupnpd.nix Lines 61 to 70 in 0f1de2e
Do you have any idea what could be the problem here? |
Not sure, but I've also never gotten it to work right and found it impossible to debug, so I just gave up. It probably should have been marked as broken. |
This is related to getting all tests passing for 18.09: #45960 |
@miniupnp Can you shed some light on what miniupnpcd does? And maybe good ways to debug problems? I'm trying to write a test using a few vms to make sure the core functionality of miniupnpcd always works in NixOS. The chain MINIUPNPCD is created in iptables. The following also succeeds:
But then I don't see the any output from:
I don't see much happening in miniupnpcd and I don't see iptables changing using:
I have very little understanding of iptables, but I guessed that would change by miniupnpd. Do you have some suggestions on ways to debug this problem? |
what are the output log of miniupnpd while you run the |
@miniupnp Thank you for pushing me in the right direction. I wasn't aware of the Next up is the bittorrent test, where I was initially working on ;). |
@jgillich the miniupnpd service should now be working correctly. It now uses the shell scripts that Miniupnpd supplies. @miniupnp during the tests it occurred to me that @samueldr If/when this gets merged, this probably also needs backporting to 18.09. |
b4d375a
to
6df2d01
Compare
@bobvanderlinden how did he fail ? Have you the console output ? |
@@ -59,30 +59,12 @@ in | |||
config = mkIf cfg.enable { | |||
# from miniupnpd/netfilter/iptables_init.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably remove this comment (and the other one below).
Great work btw! 👍
This attempts to improve stability of the test by using existing services for miniupnpd and transmission. It also uses explicit addresses for the network interfaces so that the external IP addresses are valid internet addresses (thus fixing validation problems from upnpc). Also disable eth0 from being used to transfer torrents over without that being the intention.
6df2d01
to
5fbc521
Compare
@miniupnp I'm terribly sorry, but I can't reproduce the errors anymore (reflog is gone and I recreated the commits to adhere to nixpkgs standards :(). The biggest confusion was the exit code always being 0. Initially I didn't realize the test framework did not output any stdout/err of the upnpc comand when the exit code is 0, because succeeding commands do not ouput anything in this framework. So it was not showing up output by default. Based on your comment I added While figuring the above out I ended up using I also struggled a bit with the @jgillich I removed the comments in the new commit set 👍 thanks for noticing. |
@GrahamcOfBorg test upnp bittorrent |
Success on x86_64-linux (full log) Attempted: tests.upnp, tests.bittorrent Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: tests.upnp, tests.bittorrent Partial log (click to expand)
|
🎉 I think this one is ready to merge 👍 |
[backport] Miniupnpd and bittorrent improvements (#46443)
Motivation for this change
The bittorrent tests was sometimes failing. It seemed to be related to upnp. There was no test yet that checked whether miniupnpd worked correctly. Lastly the miniupnpd service did not setup iptables correctly.
This PR fixes the miniupnpd iptables setup by using the related scripts from Miniupnpd.
It adds a test which checks whether the Miniupnpd service allows port mapping in a
client <> router <> client
structure.It fixes and simplifies the bittorrent test by using the miniupnpd service, the transmission service and by reusing the network structure used in thhe miniupnpd test.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)