<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<table cellspacing="0" cellpadding="0" border="0" style="background:#EFF6FC; width:100%; border-radius:10px; border-collapse:separate; border:1px; border-radius:6px; margin-bottom:12px">
<tbody style="font-family:-apple-system,Segoe UI,HelveticaNeue-Bold,Helvetica Neue Bold,Helvetica Neue,Helvetica,Arial,sans-serif; font-size:20px">
<tr>
<td style="padding:5px 15px">
<table style="width:100%">
<tbody style="font-family:-apple-system,Segoe UI,HelveticaNeue-Bold,Helvetica Neue Bold,Helvetica Neue,Helvetica,Arial,sans-serif">
<tr>
<td>
<table style="border-spacing:0">
<tbody style="font-family:-apple-system,Segoe UI,HelveticaNeue-Bold,Helvetica Neue Bold,Helvetica Neue,Helvetica,Arial,sans-serif">
<tr>
<td><img alt="laugh" src="https://outlook-1.cdn.office.net/assets/reaction/laugh.png" style="height:25px; width:25px">
</td>
<td><span style="font-weight:bold; padding-left:3px">Vadim Yakovenko</span> <span>
reacted to your message:</span> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Kea-users <kea-users-bounces@lists.isc.org> on behalf of Ben Scott <bscott@isc.org><br>
<b>Sent:</b> Wednesday, December 10, 2025 4:56:20 AM<br>
<b>To:</b> kea-users@lists.isc.org <kea-users@lists.isc.org><br>
<b>Subject:</b> Re: [Kea-users] Kea 3.0.1 (Debian) – kea-shell hangs when executing lease4 commands through Control Agent</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:11pt;">
<div class="PlainText">CAUTION: This email is from an external source. Do not click links or open attachments unless you recognize the sender and know the content is safe.<br>
<br>
On 12/9/25 03:31, Oliver wrote:<br>
> echo '{ "command": "list-commands" }' | \ kea-shell --host 127.0.0.1 --<br>
> port 8000 \ --auth-user xxx \ --auth-password-file /etc/kea/kea-api-<br>
> password \ --service dhcp4<br>
<br>
The above is not correct usage. The API command has to be provided<br>
on the command line. The API arguments are provided on standard input.<br>
So one should not give "command" in standard input, but rather, whatever<br>
one would put inside the "arguments" map (object). If no arguments are<br>
needed, the input should be empty/null.<br>
<br>
The documentation could be clearer in this regard. In particular,<br>
the man page should make this explicit. The ARM does a better job but<br>
could still stand some improvement. I will try to get some changes<br>
submitted for that soon.<br>
<br>
<a href="https://kea.readthedocs.io/en/latest/arm/shell.html">https://kea.readthedocs.io/en/latest/arm/shell.html</a><br>
<br>
> This also hangs with no output:<br>
> kea-shell --host 127.0.0.1 --port 8000 \ --service dhcp4 \ list-commands<br>
<br>
It is not "hung" (in the sense of improperly functioning). It is<br>
blocked on standard input. You are not providing anything as input, so<br>
it sits there waiting for you to do so.<br>
<br>
kea-shell is a very simple program. It has no knowledge of the Kea<br>
API; it simply passes what you give it on to Kea. As such, it still<br>
expects an API argument payload -- it does not "know" if an API command<br>
needs arguments or not.<br>
<br>
The simplest possible invocation of kea-shell looks like:<br>
<br>
kea-shell < /dev/null<br>
<br>
The defaults are:<br>
<br>
host = localhost<br>
port = 8000<br>
API command = list-commands<br>
service = none<br>
authentication = none<br>
<br>
Thus, the above command is equivalent to:<br>
<br>
kea-shell --host 127.0.0.1 --port 8000 list-commands < /dev/null<br>
<br>
Either of the above two command lines will invoke "list-commands"<br>
against whatever is listening on port 8000. If that is kea-ctrl-agent<br>
(the only supported scenario before 3.0), you get the commands available<br>
on the Kea Control Agent. On Kea 3.0, you get the commands for whatever<br>
daemon you are talking to (kea-ctrl-agent or kea-dhcp4 or whatever).<br>
<br>
For your case, you probably want something like:<br>
<br>
kea-shell --service dhcp4 \<br>
--auth-user xxx \<br>
--auth-password-file /etc/kea/kea-api-password \<br>
< /dev/null<br>
<br>
For API commands which do take input, it might look like this:<br>
<br>
echo ' "ip-address": "192.0.2.202" ' |\<br>
kea-shell --service dhcp4 lease4-del<br>
<br>
Note how the input is just the arguments to the API (without the API<br>
command name). Note also that the API command name is specified as an<br>
argument to "kea-shell" itself.<br>
<br>
> Is it expected behavior that |kea-shell| ignores HTTP/authentication<br>
> parameters in the ISC Debian packages?<br>
<br>
No. In my experience, it does not ignore these parameters.<br>
<br>
> Should |kea-shell| be able to communicate with an authenticated<br>
> Control Agent, or is this a known limitation?<br>
<br>
Yes, kea-shell supports both HTTP basic authentication as well as TLS<br>
client certificates.<br>
<br>
> Is |kea-shell| still supposed to use the UNIX control socket even<br>
> when HTTP parameters are explicitly provided?<br>
<br>
No. kea-shell never uses the control sockets. It either talks to<br>
kea-ctrl-agent, or in 3.0 and later, it can talk to the services<br>
directly (if the services are configured with HTTP listeners).<br>
<br>
Hope this helps,<br>
<br>
-- Ben<br>
<br>
--<br>
Any opinions expressed in this message are those of the author alone.<br>
All information is provided without warranty of any kind.<br>
<br>
--<br>
ISC funds the development of this software with paid support subscriptions. Contact us at
<a href="https://www.isc.org/contact/">https://www.isc.org/contact/</a> for more information.<br>
<br>
To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
Kea-users@lists.isc.org<br>
</div>
</span></font>
</body>
</html>