Skip to content

can't connect management API #82

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

Closed
ancly2008 opened this issue Mar 19, 2025 · 5 comments
Closed

can't connect management API #82

ancly2008 opened this issue Mar 19, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@ancly2008
Copy link

ancly2008 commented Mar 19, 2025

i run edge on x86 openwrt device , can't connect management api , pls help to check ,thanks

PID:
23422 nobody 676 S n3n-edge start tu3

ll /var/run/n3n/tu3/mgmt
srwxr-xr-x 1 nobody nogroup 0 Mar 19 18:47 /var/run/n3n/tu3/mgmt=

n3nctl -s tu3 -k n3n cmd get_edges
Could not find unix socket (is the session running?)

n3nctl -s tu3 supernodes
Could not find unix socket (is the session running?)
n3nctl -s tu3 edges
Could not find unix socket (is the session running?)

curl --unix-socket /run/n3n/tu3/mgmt http://x/help
curl: (7) Failed to connect to x port 80 after 0 ms: Error

curl --unix-socket /run/n3n/tu3/mgmt http://x/v1 -d '{"jsonrpc": "2.0", "method": "get_edges", "id": 1}'
curl: (7) Failed to connect to x port 80 after 0 ms: Error

curl --version
curl 8.6.0 (x86_64-openwrt-linux-gnu) libcurl/8.6.0 OpenSSL/3.0.13 nghttp2/1.51.0
Release-Date: 2024-01-31
Protocols: file ftp ftps http https ipfs ipns mqtt
Features: alt-svc HSTS HTTP2 HTTPS-proxy IPv6 Largefile SSL threadsafe UnixSockets

@hamishcoleman
Copy link
Contributor

The unix socket that has been created does not appear to be in the expected location. This may be an issue with the way the openwrt build is being configured.

You should be able to modify the examples to have a --unix-socket option that matches the management socket path.

The openwrt build probably needs updating to use the correct expected environment

@hamishcoleman hamishcoleman added the bug Something isn't working label Mar 19, 2025
@ancly2008
Copy link
Author

thanks

@ancly2008
Copy link
Author

after add management port =xxx ,API connection is normal

@hamishcoleman
Copy link
Contributor

Defining a TCP management port is a reasonable workaround.

I have found that the OpenWRT environment does not support the "/run" directory - which is unfortunate since that dir was standardized at least a decade ago.

Once I have some time, I will update the OpenWRT build to avoid trying to use "/run" and instead use "/var/run"

@hamishcoleman
Copy link
Contributor

hamishcoleman commented Apr 6, 2025

As of the recent merge, the n3nctl program now looks in both places for the management socket

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

No branches or pull requests

2 participants