#Gateway config.get ERROR

1 messages · Page 1 of 1 (latest)

cosmic hamlet
#

Gateway: config.get failed: gateway closed (1008): unauthorized: device token mismatch (rotate/reissue device token)

high snowBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

fair gateBOT
#

That error means your CLI is authenticating to the Gateway with a cached per-device token (a “device token”), but the Gateway no longer recognizes it (common after reinstall/restore, switching Gateways, or wiping ~/.openclaw on either side).

Fix (fastest)

  1. Make sure you’re using the Gateway’s shared auth token (not an old device token):
  • On the gateway host (the machine running openclaw gateway), get the token:
    openclaw config get gateway.auth.token
    
  • On the client machine where you run the command, pass it explicitly:
    openclaw gateway call config.get --url ws://<host>:18789 --token "<PASTE_TOKEN>"
    
    (Docs note: if you pass --url, you must also pass --token/--password explicitly.)
  1. Clear the cached device token on the client (so it can re-issue a fresh one):
  • Default location is:
    • ~/.openclaw/identity/device-auth.json (or under $OPENCLAW_STATE_DIR/identity/ if you set OPENCLAW_STATE_DIR)
#
  • Safer than deleting: rename it:
    mv ~/.openclaw/identity/device-auth.json ~/.openclaw/identity/device-auth.json.bak
    
  • Then retry the openclaw gateway … command (with the correct --token).

If you want to rotate/reissue from the Gateway side

Once you can connect with the shared token again:

openclaw devices list
openclaw devices rotate --device <deviceId> --role operator

Docs: https://docs.openclaw.ai/cli/devices

If it still fails

Paste: