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

tunneldigger-broker: connection fails with Error: Invalid handle. #167

Open
PolynomialDivision opened this issue Jun 8, 2023 · 3 comments

Comments

@PolynomialDivision
Copy link

Hi, I'm just trying to upstream the packages to openwrt/packes:
openwrt/packages#21308

it seems to work fine until I connect to the broker on localhost (I currently just use 1 router) and the broker just throws the error "Error: Invalid handle.":

daemon.err python[13789]: [INFO/tunneldigger.tunnel] Set tunnel 103 MTU to 1280.
daemon.err python[13789]: [INFO/tunneldigger.hooks] Running hook 'session.up' via script '/usr/lib/tunneldigger-broker/hooks/setup'.
daemon.err python[13789]: [INFO/tunneldigger.limits] Setting downstream bandwidth limit to 1024 kbps on tunnel 103.
daemon.err python[13789]: Error: Invalid handle.

Any idea what's the reason or how to fix this? I can not even find where the error printing is happening in the code.

@PolynomialDivision PolynomialDivision changed the title Connection fails with Error: Invalid handle. tunneldigger-broker: connection fails with Error: Invalid handle. Jun 8, 2023
@RalfJung
Copy link
Member

RalfJung commented Jun 8, 2023

I think Invalid Handle is a red herring... I am also seeing this in my logs despite everything working. As far as I recall, the error originates here

if os.system('tc %s' % (command)) != 0 and not ignore_fails:

and is output by the tc program, not the Python code. When setting a bandwidth limit, the code first removes potentially existing previous bandwidth limits; if no such limit existed, we get an "Invalid handle" error.

@PolynomialDivision
Copy link
Author

@RalfJung Thanks a lot! I thought I did something wrong because the tunnels don't come up automatically. Is that wanted behavior that you need to set them up with for example ip link afterwards?

@RalfJung
Copy link
Member

RalfJung commented Jun 9, 2023

ip link is usually done by one of the scripts, see https://github.com/wlanslovenija/tunneldigger/tree/master/broker/scripts for examples.

The config for our own servers is here; session-up is doing the setup and can be found here. Crucially we first add them to the bridge and then up the link, to make sure no traffic can go to the wrong place before the link is in the bridge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants