[GH-ISSUE #180] flag -accept-clients not working #1427

Closed
opened 2026-04-24 20:01:32 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @iconoclasthero on GitHub (Nov 22, 2025).
Original GitHub issue: https://github.com/fosrl/newt/issues/180

Originally assigned to: @oschwartz10612 on GitHub.

Describe the Bug

The --help shows:

# newt --help
Usage of newt:
  -accept-clients
    	Accept clients on the WireGuard interface
⋮

but when I try to run it:

flag provided but not defined: -accept-clients
Usage of /usr/local/sbin/newt:
  -blueprint-file string
    	Path to blueprint file (if unset, no blueprint will be applied)
⋮

Environment

  • OS Type & Version: (e.g., Ubuntu 22.04) Manjaro
  • Newt Version: 1.6.0

To Reproduce

calling it via systemd:

#ExecStart=/usr/local/sbin/newt -accept-clients
ExecStart=/usr/local/sbin/newt

the commented line fails, the uncommented line succeeds.

Expected Behavior

This is a flag listed in --help. it should work and accept clients.

Originally created by @iconoclasthero on GitHub (Nov 22, 2025). Original GitHub issue: https://github.com/fosrl/newt/issues/180 Originally assigned to: @oschwartz10612 on GitHub. ### Describe the Bug The --help shows: ``` # newt --help Usage of newt: -accept-clients Accept clients on the WireGuard interface ⋮ ``` but when I try to run it: ``` flag provided but not defined: -accept-clients Usage of /usr/local/sbin/newt: -blueprint-file string Path to blueprint file (if unset, no blueprint will be applied) ⋮ ``` ### Environment - OS Type & Version: (e.g., Ubuntu 22.04) Manjaro - Newt Version: 1.6.0 ### To Reproduce calling it via systemd: ``` #ExecStart=/usr/local/sbin/newt -accept-clients ExecStart=/usr/local/sbin/newt ``` the commented line fails, the uncommented line succeeds. ### Expected Behavior This is a flag listed in --help. it should work and accept clients.
GiteaMirror added the enhancement label 2026-04-24 20:01:32 -05:00
Author
Owner

@iconoclasthero commented on GitHub (Nov 22, 2025):

Also, on my other machine with newt 1.5.1, --accept-clients (2 -- prefix) works.

<!-- gh-comment-id:3566975142 --> @iconoclasthero commented on GitHub (Nov 22, 2025): Also, on my other machine with newt 1.5.1, `--accept-clients` (2 -- prefix) works.
Author
Owner

@iconoclasthero commented on GitHub (Nov 22, 2025):

Also, why is it now spitting out this first line when I query the version?

# newt --version
INFO: 2025/11/22 14:13:23 Starting metrics server on 
Newt version 1.6.0

that't not happening here:

$ newt --version
Newt version 1.5.1
<!-- gh-comment-id:3566979993 --> @iconoclasthero commented on GitHub (Nov 22, 2025): Also, why is it now spitting out this first line when I query the version? ``` # newt --version INFO: 2025/11/22 14:13:23 Starting metrics server on Newt version 1.6.0 ``` that't not happening here: ``` $ newt --version Newt version 1.5.1 ```
Author
Owner

@oschwartz10612 commented on GitHub (Nov 22, 2025):

So --accept-clients works but -accept-clients does not?

Also, why is it now spitting out this first line when I query the version?

That's a bug I will fix.

<!-- gh-comment-id:3567068500 --> @oschwartz10612 commented on GitHub (Nov 22, 2025): So `--accept-clients` works but `-accept-clients` does not? > Also, why is it now spitting out this first line when I query the version? That's a bug I will fix.
Author
Owner

@iconoclasthero commented on GitHub (Nov 22, 2025):

So --accept-clients works but -accept-clients does not?

Also, why is it now spitting out this first line when I query the version?

That's a bug I will fix.

No, I originally had --accept-clients in my systemctl, I changed it to -accept-clients after seeing the error message.
So far as I can tell, neither work. I had to remove it completely so systemd could start newt.

<!-- gh-comment-id:3567082847 --> @iconoclasthero commented on GitHub (Nov 22, 2025): > So `--accept-clients` works but `-accept-clients` does not? > > > Also, why is it now spitting out this first line when I query the version? > > That's a bug I will fix. No, I originally had `--accept-clients` in my systemctl, I changed it to `-accept-clients` after seeing the error message. So far as I can tell, neither work. I had to remove it completely so systemd could start newt.
Author
Owner

@oschwartz10612 commented on GitHub (Nov 22, 2025):

Hum testing now for me both seem to work and I am able to start newt.

Could you provide a full output of the logs when you use
--accept-clients. What happens specifically when it does not work?

<!-- gh-comment-id:3567089706 --> @oschwartz10612 commented on GitHub (Nov 22, 2025): Hum testing now for me both seem to work and I am able to start newt. Could you provide a full output of the logs when you use --accept-clients. What happens specifically when it does not work?
Author
Owner

@iconoclasthero commented on GitHub (Nov 22, 2025):

I misspoke earlier, this is on a Rhino 2025.03 machine (i.e., Ubuntu devel/Resolute), but I tested it on my Manjaro server and the same thing happened.

Does not work with either --accept-clients or -accept-clients:

$ cat /etc/systemd/system/newt.service |grep ExecStart; systemctl daemon-reload; systemctl restart newt.service; sudo tail /var/log/newt/newt.log -f
ExecStartPre=+/usr/local/sbin/newt-update
ExecStart=/usr/local/sbin/newt --accept-clients
#ExecStart=/usr/local/sbin/newt
Checking for newt updates...
Current repo version: 1.6.0.
   Installed version: 1.6.0.
No update for newt available at
https://api.github.com/repos/fosrl/newt/releases/latest.
flag provided but not defined: -accept-clients
Usage of /usr/local/sbin/newt:
  -blueprint-file string
    	Path to blueprint file (if unset, no blueprint will be applied)
⋮
  -version
    	Print the version
Checking for newt updates...
^C
$ fg
sudo nano /etc/systemd/system/newt.service


Use "fg" to return to nano.

[1]+  Stopped                 sudo nano /etc/systemd/system/newt.service
$ cat /etc/systemd/system/newt.service |grep ExecStart; systemctl daemon-reload; systemctl restart newt.service; sudo tail /var/log/newt/newt.log -f
ExecStartPre=+/usr/local/sbin/newt-update
ExecStart=/usr/local/sbin/newt -accept-clients
#ExecStart=/usr/local/sbin/newt
Checking for newt updates...
Checking for newt updates...
Current repo version: 1.6.0.
   Installed version: 1.6.0.
No update for newt available at
https://api.github.com/repos/fosrl/newt/releases/latest.
flag provided but not defined: -accept-clients
Usage of /usr/local/sbin/newt:
  -blueprint-file string
    	Path to blueprint file (if unset, no blueprint will be applied)
⋮
  -version
    	Print the version
Checking for newt updates...
^C
$ fg
sudo nano /etc/systemd/system/newt.service


Use "fg" to return to nano.

[1]+  Stopped                 sudo nano /etc/systemd/system/newt.service
$ cat /etc/systemd/system/newt.service |grep ExecStart; systemctl daemon-reload; systemctl restart newt.service; sudo tail /var/log/newt/newt.log -f
ExecStartPre=+/usr/local/sbin/newt-update
#ExecStart=/usr/local/sbin/newt -accept-clients
ExecStart=/usr/local/sbin/newt
Checking for newt updates...
Current repo version: 1.6.0.
   Installed version: 1.6.0.
No update for newt available at
https://api.github.com/repos/fosrl/newt/releases/latest.
INFO: 2025/11/22 17:07:55 Starting metrics server on 127.0.0.1:2112
INFO: 2025/11/22 17:07:55 Newt version 1.6.0
INFO: 2025/11/22 17:08:00 Setting up clients with netstack...
⋮
<!-- gh-comment-id:3567090345 --> @iconoclasthero commented on GitHub (Nov 22, 2025): I misspoke earlier, this is on a Rhino 2025.03 machine (i.e., Ubuntu devel/Resolute), but I tested it on my Manjaro server and the same thing happened. Does not work with either `--accept-clients` or `-accept-clients`: ``` $ cat /etc/systemd/system/newt.service |grep ExecStart; systemctl daemon-reload; systemctl restart newt.service; sudo tail /var/log/newt/newt.log -f ExecStartPre=+/usr/local/sbin/newt-update ExecStart=/usr/local/sbin/newt --accept-clients #ExecStart=/usr/local/sbin/newt Checking for newt updates... Current repo version: 1.6.0. Installed version: 1.6.0. No update for newt available at https://api.github.com/repos/fosrl/newt/releases/latest. flag provided but not defined: -accept-clients Usage of /usr/local/sbin/newt: -blueprint-file string Path to blueprint file (if unset, no blueprint will be applied) ⋮ -version Print the version Checking for newt updates... ^C $ fg sudo nano /etc/systemd/system/newt.service Use "fg" to return to nano. [1]+ Stopped sudo nano /etc/systemd/system/newt.service $ cat /etc/systemd/system/newt.service |grep ExecStart; systemctl daemon-reload; systemctl restart newt.service; sudo tail /var/log/newt/newt.log -f ExecStartPre=+/usr/local/sbin/newt-update ExecStart=/usr/local/sbin/newt -accept-clients #ExecStart=/usr/local/sbin/newt Checking for newt updates... Checking for newt updates... Current repo version: 1.6.0. Installed version: 1.6.0. No update for newt available at https://api.github.com/repos/fosrl/newt/releases/latest. flag provided but not defined: -accept-clients Usage of /usr/local/sbin/newt: -blueprint-file string Path to blueprint file (if unset, no blueprint will be applied) ⋮ -version Print the version Checking for newt updates... ^C $ fg sudo nano /etc/systemd/system/newt.service Use "fg" to return to nano. [1]+ Stopped sudo nano /etc/systemd/system/newt.service $ cat /etc/systemd/system/newt.service |grep ExecStart; systemctl daemon-reload; systemctl restart newt.service; sudo tail /var/log/newt/newt.log -f ExecStartPre=+/usr/local/sbin/newt-update #ExecStart=/usr/local/sbin/newt -accept-clients ExecStart=/usr/local/sbin/newt Checking for newt updates... Current repo version: 1.6.0. Installed version: 1.6.0. No update for newt available at https://api.github.com/repos/fosrl/newt/releases/latest. INFO: 2025/11/22 17:07:55 Starting metrics server on 127.0.0.1:2112 INFO: 2025/11/22 17:07:55 Newt version 1.6.0 INFO: 2025/11/22 17:08:00 Setting up clients with netstack... ⋮ ```
Author
Owner

@oschwartz10612 commented on GitHub (Nov 22, 2025):

Hum it looks like it is working in the bottom output but not the top
two. And if you use --help does it show in the options?

Are you only providing --accept-clients or also the --id, --secret,
--endpoint? Those are also required.

<!-- gh-comment-id:3567096195 --> @oschwartz10612 commented on GitHub (Nov 22, 2025): Hum it looks like it is working in the bottom output but not the top two. And if you use --help does it show in the options? Are you only providing --accept-clients or also the --id, --secret, --endpoint? Those are also required.
Author
Owner

@iconoclasthero commented on GitHub (Nov 22, 2025):

the systemd unit pulls those in from an EnvironmentFile, see below:

# cat newt.service |grep -v \#
[Unit]
Description=Newt Pangolin Tunnel
After=network.target
Wants=network.target

[Service]
User=newt
Group=newt
WorkingDirectory=/var/lib/newt

ExecStartPre=+/usr/local/sbin/newt-update

EnvironmentFile=/var/lib/newt/.config/credentials.conf

ExecStart=/usr/local/sbin/newt
Restart=on-failure
RestartSec=5


NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
# cat /var/lib/newt/.config/credentials.conf 
PANGOLIN_ENDPOINT='https://a.fqdn.tld`
NEWT_ID='a newt id'
NEWT_SECRET='a newt secret'
HOME='/var/lib/newt'
ACCEPT_CLIENTS=true

also,this would probably be easier to do on discord...

<!-- gh-comment-id:3567096364 --> @iconoclasthero commented on GitHub (Nov 22, 2025): the systemd unit pulls those in from an EnvironmentFile, see below: ```ini # cat newt.service |grep -v \# [Unit] Description=Newt Pangolin Tunnel After=network.target Wants=network.target [Service] User=newt Group=newt WorkingDirectory=/var/lib/newt ExecStartPre=+/usr/local/sbin/newt-update EnvironmentFile=/var/lib/newt/.config/credentials.conf ExecStart=/usr/local/sbin/newt Restart=on-failure RestartSec=5 NoNewPrivileges=true [Install] WantedBy=multi-user.target ``` ``` # cat /var/lib/newt/.config/credentials.conf PANGOLIN_ENDPOINT='https://a.fqdn.tld` NEWT_ID='a newt id' NEWT_SECRET='a newt secret' HOME='/var/lib/newt' ACCEPT_CLIENTS=true ``` also,this would probably be easier to do on discord...
Author
Owner

@oschwartz10612 commented on GitHub (Nov 22, 2025):

AHH! Okay its because you have already provided accept clients as true in the env var. When this happens it does not check the cli flags and you would get that error.

So this is "expected behavior" but I think it could be improved by not throwing the warning and just bypassing that flag when the env is set. Will take this as an enhancement.

<!-- gh-comment-id:3567099559 --> @oschwartz10612 commented on GitHub (Nov 22, 2025): AHH! Okay its because you have already provided accept clients as true in the env var. When this happens it does not check the cli flags and you would get that error. So this is "expected behavior" but I think it could be improved by not throwing the warning and just bypassing that flag when the env is set. Will take this as an enhancement.
Author
Owner

@iconoclasthero commented on GitHub (Nov 22, 2025):

It's not throwing a warning, it's exiting 1.

<!-- gh-comment-id:3567100763 --> @iconoclasthero commented on GitHub (Nov 22, 2025): It's not throwing a warning, it's exiting 1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/newt#1427