The Things Stack Command-line Interface (CLI) EOF

Hi Community

I’ve run into an error with the Things Stack Command-line Interface on Windows. When I try to run commands like ttn-lw-cli.exe login or ttn-lw-cli.exe config, I simply get the response EOF. Running the commands ttn-lw-cli.exe version or simply ttn-lw-cli.exe does not result in the EOF response.

C:\GIT>ttn-lw-cli.exe config
EOF

C:\GIT>ttn-lw-cli.exe version
The Things Network Command-line Interface: ttn-lw-cli
Version: 3.30.1
Build date: 2024-05-13T14:17:13Z
Git commit: 295b9319c
Go version: go1.21.9
OS/Arch: windows/amd64

I didn’t see any similar issues reported on the forum or this being mentioned in the docs.

What I have tried so far is:

  • Ensure that the ttn-lw-cli is updated to the latest version (V3.33.1)
  • Went back to a version that was working before (V3.30.1)
  • In the process above I ended up “reinstalling” the tool and trying to use it as one would for the first time in case the config file got corrupted, but as mentioned above I couldn’t even configure it using the config command
  • I’ve tried running the command terminal as Administrator although I have full administrative access on the PC
  • I even tried running it in Powershell (suggestion I saw online)

What will be causing this error and how can it possibly be debugged since using the --log.level "debug" flag did not make a difference?

You may not have a config - if there isn’t a file, then EOF would make sense.

Have you set the server using use and then login?

Hi descartes

Thank you for the reply.

The issue started in an existing use of the tool where there was a valid config file. I then tried a clean install of the tool, where you are right that there was no config file, but even then trying the command ttn-lw-cli.exe use connectedsensors.nam1.cloud.thethings.industries results in the EOF result.

I do believe there is something wrong somewhere as following the steps on the Configuring the CLI | The Things Stack for LoRaWAN does not work (results in EOF) and I don’t know how to debug it more to see the reason for the EOF

Having never used the CLI on Windows I gave it a quick try:

C:\Users\nick\Downloads\lorawan-stack-cli_3.33.1_windows_amd64>ttn-lw-cli.exe use connectedsensors.nam1.cloud.thethings.industries
INFO Telemetry is enabled. Check the documentation for more information on what is collected and how to disable it
{“documentation_url”: “https://www.thethingsindustries.com/docs/concepts/advanced/telemetry/cli/”}
INFO Configuring for The Things Stack Cloud {“cluster_id”: “nam1”, “tenant_id”: “connectedsensors”}
INFO Set OAuth Server address {“address”: “Connected Sensors Account”}
INFO Set Identity Server gRPC address {“address”: “connectedsensors.eu1.cloud.thethings.industries:8884”}
INFO Config file for connectedsensors.nam1.cloud.thethings.industries written in .ttn-lw-cli.yml
INFO Sent telemetry information

Don’t worry, I can’t login to your instance without credentials, just checking that not-TTN was acceptable. I’ve setup for my TTN account and got a list of applications back when requested.

I’m on Windows 10 amd64.

I’d suggest you try a different machine to eliminate any issues with the machine you are using.

Thank you for giving it a try, I have access to another machine and I know it is working there. This particular machine gives me issues from time to time and I was trying to resolve the EOF issue.

I might just resort to using the API instead to rule out any issues.

Just a bit frustrating to learn that you eliminated the exe as the issue right from the beginning. It appeared you were reporting a generic issue on Windows.

Not much anyone can do about individual mis-behaving machines, but I’d steer clear of using the API for things like device creation - it’s a four step process that is a mess to resolve if it goes wrong due to connectivity or other issues - whereas the CLI is an atomic operation that does it all in one go.

And a machine that can’t run a vanilla exe isn’t likely to be a good candidate for running an API.

But YMMV