oxen-io / lokinet

Lokinet is an anonymous, decentralized and IP based overlay network for the internet.
https://lokinet.org/
GNU General Public License v3.0
1.71k stars 221 forks source link

Lokinet router failed to start up #2133

Closed Syone closed 1 year ago

Syone commented 1 year ago

I'm trying to install a service node on an ubuntu instance on OCI.

During the installation I had this message : image

I have updated the ini file and set the public ip address as explained

But the lokinet-router service failed to start and when I try to run manually lokinet router, I have a failed to parse configuration error : image

Edit: But the lokinet-router service failed to start and when I try to run manually lokinet router as root, I have this error : image

jagerman commented 1 year ago

What is in your lokinet.ini now, in particular where you set these options? It sounds like something wasn't added as expected.

Syone commented 1 year ago

Just set public-ip and public-port in the [router] section image

Chief36 commented 1 year ago

I've got this error in the Lokinet client due to insufficient permissions to read the file for the user we're trying to run lokinet as. Could this be the reason why, as it appears to be that the configuration is trying to be read without switching to the correct user group (_lokinet:_loki IIRC)?

Edit: There's an open issue for this https://github.com/oxen-io/lokinet/issues/1970

jagerman commented 1 year ago

Lokinet runs from the beginning as the _lokinet user; what is the owner and permission of the config file?

Syone commented 1 year ago

image

jagerman commented 1 year ago

Those are the normal permissions, so doesn't look like a permissions issue.

I'm thinking then that there must be something else wrong in the config file; run this, which should show any uncommented lines, and see if there's anything that looks strange in it:

sudo grep -Ev '^#|^$' /etc/loki/lokinet-router.ini

It should look something like this:

[router]
public-ip=1.2.3.4
public-port=5678
[network]
[dns]
bind=127.3.2.1:53
[bind]
[api]
[lokid]
rpc=ipc:///var/lib/oxen/oxend.sock
[bootstrap]
[logging]
Syone commented 1 year ago
[router]
public-ip=X.X.X.X
public-port=1090
[network]
[dns]
[bind]
[api]
[lokid]
enabled=1
rpc=ipc:///var/lib/oxen/oxend.sock
[bootstrap]
[logging]
Chief36 commented 1 year ago

Those are the normal permissions, so doesn't look like a permissions issue.

I'm thinking then that there must be something else wrong in the config file; run this, which should show any uncommented lines, and see if there's anything that looks strange in it:

sudo grep -Ev '^#|^$' /etc/loki/lokinet-router.ini

It should look something like this:

[router]
public-ip=1.2.3.4
public-port=5678
[network]
[dns]
bind=127.3.2.1:53
[bind]
[api]
[lokid]
rpc=ipc:///var/lib/oxen/oxend.sock
[bootstrap]
[logging]

But the user seems to be attempting to run lokinet as the default non-root (Linux) user, from what I can see in the image posted in the beginning.

Syone commented 1 year ago

@Chief36 you are right, in fact the lokinet-router service failed to start and I tried to run manually the command with my non-root user. image

If I try to run it as root, I have this error: image

jagerman commented 1 year ago

You should not run lokinet as root; it has its own user (_loki) under which it runs. Running it as root like that may well have changed permissions such that the proper lokinet run can't read/write files.

To try to get yourself back to some sane state, try:

Syone commented 1 year ago

sudo chown -R _loki:_lokinet /var/lib/lokinet

You mean _lokinet:_loki I think

jagerman commented 1 year ago

sudo chown -R _loki:_lokinet /var/lib/lokinet

You mean _lokinet:_loki I think

Whoops, yup. Edited.

Syone commented 1 year ago

Same error message: image

jagerman commented 1 year ago

What are the permissions on the /var/lib/lokinet directory itself? (ls -ld /var/lib/lokinet)

Syone commented 1 year ago

it seems good:

ubuntu@instance-1:~$ ls -ld /var/lib/lokinet
drwxr-xr-x 5 _lokinet _loki 4096 Feb  7 13:53 /var/lib/lokinet
jagerman commented 1 year ago

Oh, I'm dumb! I've been paying so much attention to the first error (which isn't actually a terminal error and should really be a warning) that I didn't read the second one, which is the problem. It's been a long week.

Okay.

To configure inbound links add this config into the [bind] section of lokinet.ini:

inbound=10.2.3.4

this IP address should be the one where traffic coming into your configured public-ip gets forwarded. E.g. if your public IP/port is 1.2.3.4/5678 and traffic sent there goes to local interface address 10.2.3.4:5678 then you'd use 10.2.3.4:5678 here. (If you leave the port off, it uses the default port (1090), which is probably what you want).

Syone commented 1 year ago

Yes! It works!!! Thank you so much @jagerman I spent several days reading the explanations in the ini file but I haven't understand this I suggest to add a "Troubleshooting" section in the documention