[
    {
        "role": "user",
        "content": "I%27m%20installing%20openclaw%20on%20debian%2013.%20I%20get%20all%20the%20way%20to%20channels%2C%20choose%20skip%2C%20and%20get%20an%20error%20about%20trim.%20so%20it%20doesn%27t%20appear%20the%20onboard%20finished%20or%20that%20the%20daemon%20was%20loaded%20since%20there%20is%20no%20%7E%2F.openclaw%2Fworkspace.%20how%20do%20I%20continue%3F"
    },
    {
        "role": "assistant",
        "content": "You're running into a known bug in recent versions of OpenClaw, where the onboarding wizard crashes at the \"Select channel\" step with a `TypeError: Cannot read properties of undefined (reading 'trim')`, even if you choose \u201cSkip for now\u201d. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1slanbq/help_installing_stuck_on_channel_selection/?utm_source=openai)) Let's walk through what you can do to bypass it reliably, finish the setup, and get the daemon running so that `~/.openclaw/workspace` (and other setup files) appear.\n\n---\n\n## What\u2019s Going Wrong\n\n- The problem arises in the channel setup wizard, particularly when the allowlist input is parsed. If you try to specify channels during onboarding, OpenClaw\u2019s parser attempts `.trim()` on something undefined, causing the crash. Even skipping can trigger this bug due to broken internal logic. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1sm3zo1/channel_config_problem/?utm_source=openai))  \n- The CI reports suggest this occurs more frequently with versions after 2026.4.x. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1smmxu1/openclaw_installation_crashing/?utm_source=openai))  \n- It also appears more often when using Node.js versions older than 22.16. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1sm3zo1/channel_config_problem/?utm_source=openai))  \n\n---\n\n## Workarounds & Fixes\n\nHere are several approaches that the community reports as working. Try them in order:\n\n### 1. Install a Specific Stable Version First\n\nOne successful strategy:\n\n```bash\nnpm install -g openclaw@2026.4.12\nopenclaw onboard --install-daemon --skip-channels\n```\n\nUsers reported that version `2026.4.12` avoids the channel-trim bug during onboarding. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1slanbq/help_installing_stuck_on_channel_selection/?utm_source=openai))  \n\nIf you\u2019ve already installed a newer version, you can downgrade:\n\n```bash\nsudo npm install -g openclaw@2026.4.12\n```\n\nThen re-run onboarding with `--skip-channels`. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1slanbq/help_installing_stuck_on_channel_selection/?utm_source=openai))\n\n---\n\n### 2. Manually Configure Channels After Onboarding\n\nIf the install script completes (or can complete) with skip-channels, you can then manually add channels afterward via commands or by editing the config file. Steps:\n\n```bash\nopenclaw channels login --channel discord\n```\n\nAnd then set properties like the bot token, allowed channel IDs, etc.:\n\n```bash\nopenclaw config set channels.discord.botToken \"YOUR_TOKEN_HERE\"\nopenclaw config set channels.discord.allowedChannels \"123456789012345678\"\n```\n\nSpecifying **channel IDs** rather than names with special characters/spaces helps avoid parser issues. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1sn190l/installation_error_while_choosing_channels/?utm_source=openai))\n\n---\n\n### 3. Manually Edit the Config File\n\nIf onboarding crashes before creating a valid config:\n\n1. Create the OpenClaw config file manually at `~/.openclaw/openclaw.json`.\n2. Add:\n\n   ```json\n   {\n     \"onboardingComplete\": true\n   }\n   ```\n\n3. Add channels, tokens, etc., manually according to the schema in the docs. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1slanbq/help_installing_stuck_on_channel_selection/?utm_source=openai))  \n\nThen start/enable the daemon and gateway manually.\n\n---\n\n### 4. Check Node.js Version\n\nConfirm your Node version:\n\n```bash\nnode -v\n```\n\nIf it's older than v22.16, upgrade:\n\n```bash\n# LTS recommended\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash\nnvm install 24\nnvm use 24\n```\n\nHaving Node \u2265 22.16 seems critical. ([reddit.com](https://www.reddit.com/r/openclaw/comments/1sm3zo1/channel_config_problem/?utm_source=openai))\n\n---\n\n## Verifying Daemon Installation\n\nOnce onboarding (with skip-channels) or manual config is done:\n\n- Check that the config directory exists: `~/.openclaw/openclaw.json`.\n- Run:\n\n  ```bash\n  openclaw gateway status\n  ```\n\n  This should show the daemon is loaded or service is running. ([clawdocs.org](https://clawdocs.org/reference/cli?utm_source=openai))\n\n- If you passed `--install-daemon`, ensure systemd (user) service is active:\n\n  ```bash\n  systemctl --user status openclaw-gateway\n  ```\n\n- Also check logs:\n\n  ```bash\n  journalctl --user -u openclaw-gateway -f\n  ```\n\n- Run diagnostics:\n\n  ```bash\n  openclaw doctor\n  ```\n\n---\n\n## Suggested Workflow for Debian 13\n\nPutting it all together, here's a workflow to avoid the bug and get you fully set up:\n\n```bash\n# Ensure prerequisites\nsudo apt update && sudo apt upgrade -y\nsudo apt install -y curl build-essential git python3\n\n# Ensure Node.js version\nnode -v\n# If <22.16, upgrade via nvm or similar\n\n# Install OpenClaw stable version\nnpm install -g openclaw@2026.4.12\n\n# Run onboarding, skip channels\nopenclaw onboard --install-daemon --skip-channels\n\n# Verify daemon/gateway status\nopenclaw gateway status\nsystemctl --user status openclaw-gateway\n\n# Manually add a channel (e.g., Discord)\nopenclaw channels login --channel discord\nopenclaw config set channels.discord.botToken \"YOUR_TOKEN\"\nopenclaw config set channels.discord.allowedChannels \"123456789012345678\"\n\n# Or instead edit ~/.openclaw/openclaw.json directly\n\n# Finally, restart gateway if needed\nopenclaw gateway restart\n```\n\n---\n\nIf you want, I can check whether there\u2019s an official fix or patch already available so you're using the version that avoids this entirely. Do you want me to fetch that for Debian 13?"
    }
]