You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To additional automization I create CLI API key using: docker compose run --rm stack is-db create-user-api-key ,
then I use that key to login, create default application, application API key etc.
Login fail, further actions with API KEY cannot be done, cause of the lack of the authentication
Expected Result
Login should succed, then command should be corectly authenticted: INFO (4.8) Creating default API key for application 'default-app'...
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/reference/telemetry/cli"}
WARN Using insecure connection to OAuth server
WARN Using insecure connection to API
INFO API key ID:
INFO API key value:
Relevant Logs
WARN Using insecure connection to OAuth server
WARN Using insecure connection to API
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x2478750]
goroutine 80 [running]:
go.thethings.network/lorawan-stack/v3/pkg/telemetry/exporter/cli.(*cliTask).Run(0xc000f9cbd0, {0x3255988?, 0xc000f85080?})
/home/runner/work/lorawan-stack/lorawan-stack/pkg/telemetry/exporter/cli/cli.go:171 +0xf0
go.thethings.network/lorawan-stack/v3/cmd/ttn-lw-cli/commands.init.preRun.func239.2({0x3255988, 0xc000f85080})
/home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/commands/root.go:184 +0xa2
created by go.thethings.network/lorawan-stack/v3/cmd/ttn-lw-cli/commands.init.preRun.func239 in goroutine 1
/home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/commands/root.go:180 +0x559
URL
No response
Deployment
The Things Stack Open Source (self-hosted)
The Things Stack Version
3.34.1
Client Name and Version
$ ttn-lw-cli version
The Things Network Command-line Interface: ttn-lw-cli
Version: 3.34.1
Build date: 2025-04-28T08:37:25Z
Git commit: e22b9512d
Go version: go1.23.3
OS/Arch: linux/amd64
Other Information
No response
Proposed Fix
No response
Contributing
I can help by doing more research.
I can help by implementing a fix after the proposal above is approved.
I can help by testing the fix before it's released.
Thanks for creating the issue, I did manage to replicate and I'll be opening a PR to fix that behavior in the next release.
I'm not sure as to why it was not happening in the 3.33.0, since the problem stems from a non configured cli telemetry path.
We use the XDG_CACHE_HOME value to create a temporary file for anything telemetry related in the CLI.
There are a few ways to fix this while the next release is not out.
Add the value of XDG_CACHE_HOME:
stack:
image: thethingsnetwork/lorawan-stack:latest# ...volumes:
- ./blob:/srv/ttn-lorawan/public/blob
- ./config/stack:/config:ro
- ./config/stack/cache:/cache # defined a new volume for anything cache or telemetry related# If using Let's Encrypt:
- ./acme:/var/lib/acmeenvironment:
TTN_LW_BLOB_LOCAL_DIRECTORY: /srv/ttn-lorawan/public/blobTTN_LW_REDIS_ADDRESS: redis:6379TTN_LW_IS_DATABASE_URI: postgres://root:root@postgres:5432/ttn_lorawan?sslmode=disableXDG_CACHE_HOME: /cache# ...
Disable telemetry by adding the env variable TTN_LW_TELEMETRY_ENABLE and set it to false
@nicholaspcr the fix you provided seems to be working, deployment was now without errors, thank you very much for that.
Regarding the issue in 3.33.0 version - I think I have managed to have same error that described in this issue, but I think it was somehow related to my own miss-configuration, I can not really tell right now, I have managed to resolve it. If I remember corectly it was that time when I was deploying stack inside closed non-internet LAN enviroment.
Summary
Getting the title error while trying to login using command:
ttn-lw-cli login --api-key $TTS_DEFAULT_CLI_API_KEY
This looks like new bug in release 3.34.1, because I get no error while using 3.33.0 version.
I use TTS as docker contenerized and locally deployed LoRaWAN network.
I follow every step of tutorial: https://www.thethingsindustries.com/docs/enterprise/docker/running-the-stack/
To additional automization I create CLI API key using:
docker compose run --rm stack is-db create-user-api-key ,
then I use that key to login, create default application, application API key etc.
Steps to Reproduce
--id admin
--email [email protected]
--id cli
--name "Command Line Interface"
--owner admin
--no-secret
--redirect-uri "local-callback"
--redirect-uri "code"
--id ${ID}
--name "${NAME}"
--owner admin
--secret "${CLIENT_SECRET}"
--redirect-uri "${REDIRECT_URI}"
--redirect-uri "${REDIRECT_PATH}"
--logout-redirect-uri "${LOGOUT_REDIRECT_URI}"
--logout-redirect-uri "${LOGOUT_REDIRECT_PATH}"
--user-id admin
--name "cli default API key"
--api-key <cli_default_API_key>
--insecure
Current Result
Login fail, further actions with API KEY cannot be done, cause of the lack of the authentication
Expected Result
Login should succed, then command should be corectly authenticted:
INFO (4.8) Creating default API key for application 'default-app'...
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/reference/telemetry/cli"}
WARN Using insecure connection to OAuth server
WARN Using insecure connection to API
INFO API key ID:
INFO API key value:
Relevant Logs
URL
No response
Deployment
The Things Stack Open Source (self-hosted)
The Things Stack Version
3.34.1
Client Name and Version
Other Information
No response
Proposed Fix
No response
Contributing
Validation
Code of Conduct
The text was updated successfully, but these errors were encountered: