Ttn-lw-cli on Ubuntu

Today I had to use ttn-lw-cli to change a configuration that is not available on the console. I ran into a couple of issues, which I had to solve to get it to work. I’m using Ubuntu 20.04. Here are my workarounds.

The TTI docs recommend one to use the snap package on Linux. I’ve tried and tried, but could not get the config file path and permissions to work. Luckily I found there is a deb package available on github.

  • Remove snap: $ snap remove ttn-lw-stack
  • Download deb from Releases · TheThingsNetwork/lorawan-stack · GitHub. In my case I used lorawan-stack_3.14.1_linux_amd64.deb.
  • Install deb: $ sudo apt install ./lorawan-stack_3.14.1_linux_amd64.deb
  • Create a config file: $ ttn-lw-cli use eu1.cloud.thethings.network

At this point you can view the content of the config file by doing $ cat ~/.ttn-lw-cli.yml. A sharp eye will see that the identity server address is incorrect: identity-server-grpc-address: eu1.cloud.thethings.industries:8884

This will cause commands like $ ttn-lw-cli applications list to fail with an error error:pkg/tenant/middleware:missing_tenant_id (missing tenant ID).

To fix this we need to edit the config file, using a command like $ nano ~/.ttn-lw-cli.yml and replace:

  • identity-server-grpc-address: eu1.cloud.thethings.industries:8884
    with
  • identity-server-grpc-address: eu1.cloud.thethings.network:8884

Now doing a command like $ ttn-lw-cli applications list will succeed without an error.

These two issues were reported to TTI.

3 Likes

Thanks for reporting.
The second issue is fixed here; Fix grpc address of the IS for TTS CE in the CLI by KrishnaIyer · Pull Request #4507 · TheThingsNetwork/lorawan-stack · GitHub and will be a part of the v3.14.2 release.

The first one is being investigated.

1 Like

Thank you I had the same issue, getting error: error:pkg/tenant/middleware:missing_tenant_id (missing tenant ID) after using auto generate according to the docs.

Replacing

identity-server-grpc-address: eu1.cloud.thethings.industries:8884
with
identity-server-grpc-address: eu1.cloud.thethings.network:8884

As you stated sorted it for me!