-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Bug description
I'm trying to regenerate our claim token, but even after regenerating it I can still claim a new node using the old token.
I'm unsure if this is a widespread bug or some consistency issue in the netdata cloud database since we have a very old account.
Expected behavior
After regenerating the token I would expect previous claim tokens to no longer work. The API that regenerates tokens should take extra care to ensure NO other active claim tokens exist in the space.
Steps to reproduce
- Stop netdata on the server
- Delete all netdata-related data and cache on the server (
/var/lib/netdata,/var/cache/netdata) - Delete the offline node from netdata cloud
- Regenerate the token by clicking
Space settings > Rooms > Settings > Nodes > Add nodes > Settings > Regenerate token(see screenshot) - Check that the claim token in the
Add nodeswindow clearly does not match the old token - Reload the window to ensure that the
Add nodeswindow still shows the same newly generated token and does not match the old token - Run the existing claim script with the old token in
NETDATA_CLAIM_TOKEN - Netdata starts successfully and the node reappears on netdata cloud
For testing, I also tried on a fresh cloud server with an identical script (and old token) and the latest version of netdata/netdata and it was still able to register.
This is the (albeit super old) script that we were using on the server I'm trying to decommission:
docker run -d --name=netdata \
-p 127.0.0.1:19999:19999 \
-v netdatalib:/var/lib/netdata \
-v netdatacache:/var/cache/netdata \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/hostname:/etc/hostname:ro \
-v /etc/os-release:/host/etc/os-release:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-e NETDATA_CLAIM_TOKEN="H8uQmL... (the old token)" \
-e NETDATA_CLAIM_URL="https://app.netdata.cloud" \
-e NETDATA_CLAIM_ROOMS="redacted" \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
--hostname testing-dean.coder.com \
netdata/netdataScreenshots
New node claiming successfully with old token:
Error Logs
n/a
Desktop
n/a
Additional context
Space ID: 2e496afd-456a-45d7-b035-43190c65af60
The old claim token that still works starts with H8uQmL