#UI connection issues

1 messages Β· Page 1 of 1 (latest)

midnight vine
#

Somehow I am getting "unauthorized conn=79069e3b-b50d-4081-aca8-71f53d0f4194 remote=127.0.0.1 client=clawdbot-control-ui webchat vdev", in the gateway log and the UI refuses to connect. I tried to reinstall and reset the claude oauth token to no avail. Any suggestion?

honest flameBOT
#

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

hasty tokenBOT
# midnight vine Somehow I am getting "unauthorized conn=79069e3b-b50d-4081-aca8-71f53d0f4194 rem...

Based on the FAQ and code, this "unauthorized" error happens when the UI isn't sending the correct auth token/password that the gateway expects.

Quick fixes to try:

  1. Get a fresh token link:

    clawdbot dashboard
    

    This prints a tokenized link. Open it in your browser β€” it should authenticate automatically.

  2. Clear browser localStorage:

    • Open DevTools β†’ Application β†’ Local Storage
    • Delete clawdbot.control.settings.v1
    • Reload the UI
  3. Generate a new gateway token:

#
   clawdbot doctor --generate-gateway-token

Then restart the gateway and use the new token.

  1. Check your gateway config:

    clawdbot config get gateway.auth
    

    If auth is set to "token" or "password", make sure:

    • The gateway has gateway.auth.token (or CLAWDBOT_GATEWAY_TOKEN env var)
    • The UI is sending the same value via ?token=... URL param or in settings
  2. If running remotely, tunnel first:

    ssh -N -L 18789:127.0.0.1:18789 user@your-host
    
#

Then open http://127.0.0.1:18789/?token=YOUR_TOKEN

Most common cause: The gateway was reconfigured with a new token, but the UI still has the old one cached in localStorage.

Let me know what clawdbot config get gateway.auth shows and whether you're connecting locally or remotely! 🦐

midnight vine
#

so I did first step, and it gets a bit better, but then the UI is unresponsive with "Error: OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate.

hasty tokenBOT
#
   claude setup-token   # Run this on any machine with Claude Code CLI

Copy the token and paste it when prompted by Clawdbot.

Alternative: Use an API key instead
If you don't want to deal with OAuth refresh issues, just use an Anthropic API key:

clawdbot config set auth.profiles.anthropic:default.mode "token"
clawdbot config set auth.profiles.anthropic:default.token "sk-ant-api03-..."

The API key approach is simpler and doesn't expire like OAuth tokens. 🦐

midnight vine
#

so the point 1, the CLI doesnt seem to know about the command anthropic. I tried to look at the dashboard UI, where would you retrigger re-auth?

hasty tokenBOT
# midnight vine so the point 1, the CLI doesnt seem to know about the command anthropic. I tried...

The CLI doesn't have a direct anthropic reauth command. Here's how to fix this:

Option 1: Run the doctor (auto-refresh OAuth)

clawdbot doctor

It should detect the expired OAuth token and try to refresh it.

Option 2: Reconfigure the model/auth section

clawdbot configure --section model

This will walk you through setting up Anthropic credentials again.

Option 3: Delete the auth profile manually, then reconfigure

#
# See what profiles exist
clawdbot config get auth.profiles

# Remove the Anthropic OAuth profile
clawdbot config unset auth.profiles."anthropic:<profile-id>"

# Then re-run setup
clawdbot configure --section model

In the Dashboard UI:
Go to Settings β†’ Providers β†’ Anthropic (or the model/auth section) β€” there should be a "Re-authenticate" or "Reset" button there.

The issue is your Anthropic OAuth refresh token expired. Using an API key instead avoids this entirely β€” no refresh tokens to expire. If you have an Anthropic API key, you can switch to that mode instead of OAuth. 🦐

midnight vine
#

the error now is "Error: Auth profile "anthropic:default" is not configured for anthropic."

hasty tokenBOT
#
clawdbot config set auth.profiles.anthropic:default.mode "token"
clawdbot config set auth.profiles.anthropic:default.token "sk-ant-api03-YOUR-KEY-HERE"

# Restart gateway
clawdbot gateway restart

To find your API key: https://console.anthropic.com/settings/keys

Once reconfigured via configure --section model, the UI should work again. 🦐

midnight vine
#

if I use API key it wont use my claude max subscription though, no

hasty tokenBOT
# midnight vine if I use API key it wont use my claude max subscription though, no

Correct β€” API keys are separate from Claude Max subscription. You need to use the setup-token method for Max.

Steps:

  1. Get a setup-token (on any machine with Claude Code CLI):

    claude setup-token
    

    Copy the token string it outputs.

  2. Paste it into Clawdbot:

    clawdbot configure --section model
    

    Choose "Anthropic setup-token" and paste the token.

Or if you already have a setup-token saved somewhere, just set it directly:

#
clawdbot config set auth.profiles.anthropic:claude-cli.token "YOUR-SETUP-TOKEN-HERE"
clawdbot config unset auth.profiles.anthropic:default  # remove old broken profile if it exists
clawdbot gateway restart

The setup-token is tied to your Claude Max subscription and doesn't expire like OAuth refresh tokens. 🦐

midnight vine
#

ok it works but when I asked clawdbot if it is using my claude max subscription, it responds: This is an API key, not Claude Max subscription. You're being billed per token via Anthropic API.

If you have Claude Max and want to use it instead:

Run: clawdbot configure --section auth
Choose OAuth login instead of API key
Sign in with your Anthropic account
This would put usage against your Max subscription instead of pay-per-token.

hasty tokenBOT
#
  1. Restart:
    clawdbot gateway restart
    

The anthropic:claude-cli profile with mode oauth is what uses your Max subscription. The anthropic:default profile with mode token is for API keys (pay-per-use).

Run clawdbot config get auth.profiles to verify you have the claude-cli profile set up, not a default profile with mode token. 🦐

midnight vine
#

yes, but we are now back to the issue of having the error "Error: Auth profile "anthropic:default" is not configured for anthropic."

hasty tokenBOT
# midnight vine yes, but we are now back to the issue of having the error "Error: Auth profile "...

The system is still looking for anthropic:default instead of anthropic:claude-cli. Let's fix the default reference:

# Check what's pointing to default
clawdbot config get agents.defaults.modelProvider
clawdbot config get model.defaults

# Update to use claude-cli profile
clawdbot config set agents.defaults.modelProvider "anthropic:claude-cli"
clawdbot config set model.defaults.provider "anthropic:claude-cli"

# Also check agents config
clawdbot config get agents

Then restart:

#
clawdbot gateway restart

The issue is your agents/defaults are still configured to use anthropic:default profile, but you deleted it. The anthropic:claude-cli profile is the correct one for Max subscription. 🦐

midnight vine
#

it's still complaining: "Error: Auth profile "anthropic:default" is not configured for anthropic."

hasty tokenBOT
# midnight vine it's still complaining: "Error: Auth profile "anthropic:default" is not configur...

Found it! Your session has authProfileOverride set to anthropic:default, but that profile doesn't exist anymore.

Quick fix - Option 1: Start a fresh session

/new

Option 2: Clear the auth profile override from your session

# Find your sessions
clawdbot sessions --active

# Or reset the session auth profile (you may need to edit the session file manually)

Option 3: Set up a dummy anthropic:default profile temporarily

#
# Get a setup-token first
claude setup-token

# Set it as both claude-cli AND default
clawdbot config set auth.profiles.anthropic:claude-cli.token "YOUR-SETUP-TOKEN"
clawdbot config set auth.profiles.anthropic:default.provider "anthropic"
clawdbot config set auth.profiles.anthropic:default.mode "oauth"

# Or simpler - delete the session and start fresh

The cleanest fix:

# Delete your main session file to start fresh
rm ~/.clawdbot/sessions/session-main.json  # or similar path
#

# Or just use /new in chat to start a fresh session

Your old session has a hardcoded reference to anthropic:default that got wiped when you removed the profile. Starting a fresh session with /new should resolve this. 🦐

midnight vine
#

I am a bit lost. /new doesnt help, on the web UI, as soon as I type something it complains "Error: Auth profile "anthropic:default" is not configured for anthropic.". For option 2, it complains that the command is invalid. Option 3, I think will not use my claude max subscription and the cleanest fix, well the directory listed does not exist.

hasty tokenBOT
# midnight vine I am a bit lost. /new doesnt help, on the web UI, as soon as I type something it...

Based on my investigation, the issue is that somewhere the system is expecting anthropic:default profile to exist, but it doesn't. Here's the fix:

Solution: Add anthropic:default to your auth profiles

Since you have anthropic:manual set up with a token, let's add anthropic:default as an alias or update your config to use the existing profile:

# Option 1: Copy the manual profile as default
clawdbot config set auth.profiles.anthropic:default.provider "anthropic"
clawdbot config set auth.profiles.anthropic:default.mode "token"
clawdbot config unset auth.profiles.anthropic:manual  # remove old one

# Option 2: Set auth.order to use anthropic:manual
clawdbot config set auth.order.anthropic '["anthropic:manual"]'

# Then restart the gateway
#
clawdbot gateway restart

Or simply run the doctor to auto-fix:

clawdbot doctor --yes

The issue is that your config/config store has references to anthropic:default from old OAuth setup, but that profile was deleted/expired. The system is still trying to use it because it's the default profile name. 🦐

midnight vine
#

I am getting a lot of errors. For instance: clawdbot doctor --fix
Invalid config:

  • auth.profiles.anthropic:default.mode: Invalid input
    Invalid config:
  • auth.profiles.anthropic:default.mode: Invalid input
    Invalid config:
  • auth.profiles.anthropic:default.mode: Invalid input
hasty tokenBOT
# midnight vine I am getting a lot of errors. For instance: clawdbot doctor --fix Invalid config...

The issue is you're trying to set the profile in the wrong place. You have TWO auth systems:

  1. Config file (clawdbot.json) - main config with mode field
  2. Auth store (auth-profiles.json) - credentials with type field

Simple fix - just tell the system to use your existing anthropic:manual profile:

# Set the order to use anthropic:manual
clawdbot config set auth.order.anthropic '["anthropic:manual"]'

# Restart gateway
clawdbot gateway restart

Or create a default profile in the auth store:

#
# Copy anthropic:manual to anthropic:default in the store
cat /srv/clawdbot/state/agents/main/agent/auth-profiles.json | jq '.profiles["anthropic:default"] = .profiles["anthropic:manual"]' > /tmp/auth-profiles.json && mv /tmp/auth-profiles.json /srv/clawdbot/state/agents/main/agent/auth-profiles.json

# Restart
clawdbot gateway restart

This way your existing API key will be used with the anthropic:default name the system expects. 🦐

midnight vine
#

I am trying to follow your direction,, but your simple fix is throwing errors: clawdbot config set auth.order.anthropic '["anthropic:manual"]'
Invalid config:

  • auth.profiles.anthropic:default.mode: Invalid input
    Invalid config:
  • auth.profiles.anthropic:default.mode: Invalid input
    Invalid config:
  • auth.profiles.anthropic:default.mode: Invalid input
    Can you tell me the location of the files I should check maybe?
hasty tokenBOT
# midnight vine I am trying to follow your direction,, but your simple fix is throwing errors: c...

The config was updated. Since systemd isn't available in this environment, you'll need to manually restart the gateway by either:

  1. Kill the gateway process and restart it:

    pkill -f clawdbot-gateway
    # Then restart it however you normally run it
    
  2. Or if running as a service, restart it via your process manager

Once restarted, the UI should work because now the auth order is explicitly set to use your anthropic:manual profile.

To verify the fix worked:

# Check that the config has the order set
cat /srv/clawdbot/state/clawdbot.json | jq '.auth.order'
#

You should see:

{
  "anthropic": ["anthropic:manual"]
}

After restarting the gateway, try the UI again. 🦐

midnight vine
#

hmmm, I tried to start afresh and run clawdbot onboard, however as soon asI type in chat anything I get "Error: OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate." Are there files I should check or a place I should try to re-authenticate?

hasty tokenBOT
# midnight vine hmmm, I tried to start afresh and run clawdbot onboard, however as soon asI type...

The OAuth token expired. You need to re-authenticate with Anthropic. Here's how:

1. Get a fresh setup-token (on any machine with Claude Code CLI installed):

claude setup-token

Copy the token it outputs.

2. Configure Clawdbot to use it:

# Set up the OAuth profile with your setup-token
clawdbot configure --section model

When prompted, choose:

  • Anthropic provider
  • "Anthropic setup-token" option
  • Paste your token
#

Or set it directly:

clawdbot config set auth.profiles.anthropic:claude-cli.token "YOUR-SETUP-TOKEN-HERE"
clawdbot config set auth.profiles.anthropic:claude-cli.mode "oauth"
clawdbot config set auth.order.anthropic '["anthropic:claude-cli"]'
clawdbot gateway restart

To find your setup-token:

This will use your Claude Max subscription instead of pay-per-token API keys. 🦐

midnight vine
#

I followed all these instructions but the UI continues to complain about the OAuth token "Error: OAuth token refresh failed for anthropic: Failed to refresh OAuth token for anthropic. Please try again or re-authenticate."

#

Would you have any advice on where to check for the setup? Much appreciated. It was working fine and stopped working today, possibly after I setup tailscale though that could be unrelated

midnight vine
#

Is there a safe way to delete everything and restart? Would it be to rm -rf .clawdbot and rm-rf the clawd directory? I feel my setup is in a weird state and I need to clear everything.

hasty tokenBOT
# midnight vine Is there a safe way to delete everything and restart? Would it be to rm -rf .cla...

The unauthorized error on localhost (webchat UI β†’ gateway) is usually a token mismatch. Before nuking everything, let's check a few quick things:

1. First, what's your version?

clawdbot --version

2. Check your gateway token in the UI vs config:

  • The control UI shows a gateway token in Settings β†’ Gateway
  • Does it match what's in ~/.clawdbot/clawdbot.json under gateway.token?

3. Quick config fix attempt:
Try setting hot-reload mode to see if it helps:

clawdbot gateway call config.patch '{"gateway.reload.mode": "hot"}'
#

If you do want to reset, here's what touches what:

Path What it contains
~/.clawdbot/ All config, credentials, tokens, cron jobs
~/clawd/ (or wherever you cloned) The actual clawdbot source code

To reset cleanly:

# Stop the gateway first
clawdbot gateway call stop

# Backup (always!)
mv ~/.clawdbot ~/.clawdbot.backup
#

# Fresh start
mkdir ~/.clawdbot
clawdbot configure

The ~/clawd/ directory doesn't need deleting unless you want a fresh git clone. Your message/DB data is in ~/.clawdbot/data/.

But try the token check first β€” 9/10 times it's just a mismatched token after an update. 🦐