Skip to content

Slack socket mode can never start on v0.0.114: credential-binding denies every request (credential_unavailable) even on a fresh onboard — the credential saves where NemoClaw looks but never materializes where openshell's boundary engine looks #10602

Closed

Description

@jonnyd99

TL;DR for triage

On a fresh v0.0.114 onboard (no migration, no prior state):

nemoclaw onboard --name ctl-gw --agent openclaw        # completes, sandbox healthy
nemoclaw ctl-gw channels add slack                     # interactive, real tokens, completes

every worker attempt then logs (sandbox container OCSF stream):

NET:OPEN  ALLOWED  node -> slack.com:443                        [policy:slack engine:opa]
HTTP:POST ALLOWED  POST /api/apps.connections.open              [policy:slack engine:l7]
HTTP:UNKNOWN DENIED                                             [policy:slack engine:credential-binding] [reason:credential_unavailable]
[slack] socket mode failed to start; retry N/∞ ... statusCode = 500; slack_webapi_http_error

Slack never receives one authenticated request; the operator only sees doctor's "channels paused" hint. Reproduced identically on a bare-metal host and a QEMU/KVM VM, with two different Slack apps and freshly issued tokens, on three sandbox lineages (fresh v0.0.114 onboard; v0.0.90-created sandbox migrated per #9215's workaround, twice). The same production tokens ran for months on v0.0.90/openshell 0.0.85 — the regression window is the binding architecture itself, not a recent patch, so bisecting 0.0.109→0.0.114 likely won't find it.

Where the chain breaks, checked link by link

Everything on the save side verifiably works; the resolve side never sees the material. Each check below is copy-pasteable against a broken deployment:

layer check observed
credential save openshell provider get <sandbox>-slack-bridge credential key SLACK_BOT_TOKEN present; resource version bumps (1→2) when channels add saves
sandbox attachment openshell sandbox provider list <sandbox> both slack providers listed as attached
config channels.slack.accounts.default in openclaw.json normalized xoxb-/xapp-OPENSHELL-RESOLVE-ENV-… aliases (per src/lib/messaging/channels/slack/manifest.ts), channel + plugin enabled: true
policy openshell policy get --full slack preset applied; opa + l7 ALLOW (log above); no provider-composed credential entries in any revision — the slack network-policy blocks of "worked-looking" and broken revisions are byte-identical, so binding material is not carried in the policy document
raw egress docker exec <sandbox> curl -sX POST https://slack.com/api/api.test 200 {"ok":true} — network is fine, only injection fails
NemoClaw's own view channels add slack on a second sandbox, same tokens conflict guard correctly reports the first sandbox "uses the same slack credential" — NemoClaw's save surface sees the credential the binding engine cannot resolve

Not fixed by any of: plain rebuild; rebuild with SLACK_* in the rebuild process env; managed stop/start; gateway restart; channels remove+add (interactive and non-interactive); policy remove/add slack; openshell provider update --credential re-push (version bumps, denial unchanged).

Suspected mechanism (from your own source, v0.0.114 tag)

The architecture comment in src/lib/onboard/providers.ts (upsertMessagingProviders) describes the intended chain:

ensureMessagingBridgeProfiles   <- import the profile (must exist before `provider create`)
  upsertProvider(... slack -> --type nemoclaw-mcp-v1)   bridge created with a sentinel token
configureMessagingBridgeRefreshes  <- refresh mints the real token, overwriting the sentinel

and nemoclaw-blueprint/provider-profiles/nemoclaw-mcp-v1.yaml describes the profile as "Endpointless profile for credentials bound by generated MCP policies."

Observed against that design:

  1. Every rebuild prints, up to three times: error … profile=nemoclaw-mcp-v1 field=id custom provider profile 'nemoclaw-mcp-v1' already exists / Error: × provider profile import failed. ensureMessagingBridgeProfiles (src/lib/onboard/messaging-bridge-provider.ts) probes with provider profile export before importing and is idempotent when the probe succeeds — but during a rebuild the gateway is restarting, the probe fails, the blind import hits already exists, and the run takes the failure path. The registered profile is byte-equivalent to the checked-in blueprint (only server-added resource_version/source/scope differ), so this is the probe racing the gateway lifecycle, not real drift.
  2. openshell provider refresh status <sandbox>-slack-bridge → "No refresh configurations found" — the mint-the-real-token step never configures. (Slack has no co-located provider-profile/<agent>.yaml, so configureMessagingBridgeRefreshes self-gates for it — we could not determine from the NemoClaw side what is supposed to deliver slack's binding material to the enforcement point; whatever it is, it observably never runs.)
  3. /run/nemoclaw/ inside the sandbox is empty (no managed-startup-runtime.env), and the in-container gateway process env contains no SLACK_*/v<nonce>_* variables — on 0.0.90/openshell 0.0.85 the process-env path is how channel tokens reached the worker.

If the generated binding material for nemoclaw-mcp-v1-typed providers is produced in the same phase the profile-import failure aborts, that would explain a universal failure. We can't verify past the NemoClaw/openshell boundary — the denial is emitted by openshell 0.0.106's engine:credential-binding, which is where a maintainer with openshell source can pick up the trail.

Two secondary defects found while isolating this (say the word and we'll file separately)

  • Non-idempotent profile import under the rebuild race (above) — even if benign for binding, it prints a scary triple error on every rebuild.
  • Non-interactive channels add silently skips the credential save: with NEMOCLAW_NON_INTERACTIVE=1 and tokens in SLACK_BOT_TOKEN/SLACK_APP_TOKEN env, the flow completes "successfully" but the provider resource version never bumps; only the interactive prompt path saves. Cost us most of a day of misdiagnosis.

Environment

  • NemoClaw v0.0.114 (built from tag), openshell 0.0.106 (auto-installed by rebuild preflight)
  • Ubuntu 24.04; Docker 29.1.3 (bare metal) and QEMU/KVM (VM); agent OpenClaw v2026.7.1; provider ollama-local / qwen3:8b
  • Both hosts keep snapshots — a full retest against a branch build takes minutes, and we're happy to run any diagnostic you want against the broken state.

Activity

  1. Shivang9983 commented on Aug 29, 2026

    @Shivang9983

    Hi @jonnyd99,

    Thanks for the extremely thorough breakdown and reproduction details!

    The root cause points to a breakdown in the credential material injection path between NemoClaw and openshell's engine:credential-binding:

    1. Profile Import Race Condition: The ensureMessagingBridgeProfiles probe fails during gateway restart, causing nemoclaw-mcp-v1 profile import to fail with already exists and aborting subsequent binding generation steps.
    2. Missing Token Injection: Because configureMessagingBridgeRefreshes gates out and the /run/nemoclaw/managed-startup-runtime.env process-env path is omitted in v0.0.114, openshell's boundary engine never receives the resolved binding secrets.

    Proposed Fix Steps:

    • Fix idempotency in ensureMessagingBridgeProfiles to ignore already exists errors during rebuild races so execution isn't aborted.
    • Ensure configureMessagingBridgeRefreshes correctly handles Slack's binding material and falls back/injects valid tokens into openshell's boundary engine.
    • Address the non-interactive channels add silent skip when NEMOCLAW_NON_INTERACTIVE=1 is set.

    I will investigate the binding material pipeline and open a PR with the fix.

  2. Dongni-Yang commented on Aug 31, 2026

    @Dongni-Yang
    Contributor

    The mechanism behind credential_unavailable looks already fixed after v0.0.114 — the Slack OpenClaw policy preset shipped with no credential_binding entries at all, so OpenShell's boundary engine had nothing to resolve.

    $ git show v0.0.114:src/lib/messaging/channels/slack/policy/openclaw.yaml | grep -c credential_binding
    0
    $ git show main:src/lib/messaging/channels/slack/policy/openclaw.yaml | grep -n credential_binding
    25:        credential_binding:
    34:        credential_binding:
    44:        credential_binding:
    54:        credential_binding:
    

    The four entries were added by 4222c10452 — fix(messaging): make channel credentials reach the agent on OpenShell 0.0.106 (#10273) — which is contained in v0.0.115 and v0.0.116:

    $ git tag --contains 4222c10452
    v0.0.115
    v0.0.116
    

    That matches your trace exactly: NET:OPEN and HTTP:POST pass on the slack policy, then the credential-binding stage denies, because on v0.0.114 no binding existed for it to resolve. It also explains why a fresh onboard did not help — nothing about it was state-dependent.

    Worth retrying on v0.0.116 before deeper investigation. @Shivang9983 — this may save you the pipeline dig.

    Not a maintainer, just reporting the version evidence.

  3. Shivang9983 commented on Aug 31, 2026

    @Shivang9983

    Thanks @Dongni-Yang for bisecting this and pointing out commit 4222c10452 (#10273)! That completely explains why credential_binding was returning credential_unavailable on v0.0.114.

    @jonnyd99 Could you please verify if upgrading to v0.0.116 resolves the Slack socket mode startup issue on your end?

    If everything works as expected on v0.0.116, we can mark this as resolved

  4. added
    area: sandbox
    area: security
    integration: slack
    on Sep 3, 2026
  5. added theissue type on Sep 3, 2026
  6. jonnyd99 commented on Sep 17, 2026

    @jonnyd99
    Author

    Verified — and the fix is two halves, both needed on the same openshell 0.0.106 gateway.

    Retest 2026-09-12, v0.0.123 built from tag, openshell 0.0.106 (gateway unchanged), Ubuntu 24.04 QEMU/KVM, fresh onboard + channels add slack: [slack] socket mode connected, both SLACK_* placeholders injected, zero credential_unavailable — once the unclassified-provider repair described below had also been applied (the fresh sandbox attached the gateway's existing pre-#9895 inference provider, and the whole provider environment was rejected until that provider was re-created).

    Confirmed on the production box 2026-09-16: the v0.0.90-born sandbox (migrated to v0.0.114 on 08-29, Slack dead since) was rebuilt under the v0.0.123 CLI on the same 0.0.106 gateway. Socket mode connected after the rebuild, survived a cold reboot, and the agent answered in the channel.

    What the fix consists of, from the outside — for anyone trying to repair an existing v0.0.114 sandbox without rebuilding:

    1. Policy half: v0.0.114's slack preset has no credential_binding entries; v0.0.123's preset binds each slack endpoint to its provider. Applying the v0.0.123 preset to a v0.0.114 sandbox (through the v0.0.114 CLI as a custom preset) is enough for the gateway to stop "withholding static provider credential handle from endpointless profile" — the SLACK_* placeholders then reach the process.
    2. Config half: the v0.0.114 channel flow writes literal alias tokens (xoxb-OPENSHELL-RESOLVE-ENV-…) into openclaw.json and the runtime logs [channels] Normalized SLACK_BOT_TOKEN runtime placeholder to the Bolt-compatible alias, so requests carry the alias, which the 0.0.106 proxy's credential-binding engine cannot map — credential_unavailable persists even with the bindings in place. The v0.0.123 flow writes no token fields and the raw openshell:resolve:env:… handle reaches Bolt. A rebuild under v0.0.123 (which re-renders the channel config that way) is what fixed it; policy alone does not. (Whether the v0.0.114 image with a token-less config would work is untested.)

    One more finding worth a line in the docs, same class as #9895: a provider whose credential was stored before its type had a profile is never reclassified by importing the profile afterwards; only delete + create with the profile present does. On our gateway that was the ollama-local (openai) provider AND the anthropic provider — openshell provider profile export anthropic reports not found on 0.0.106 (the built-ins we can see are aws, aws-bedrock, aws-s3, claude-code, codex, copilot, cursor, deepinfra, github, google-cloud, google-vertex-ai, nvidia, pypi), and the key was rejected as unclassified until a profile existed. One unclassified key revokes every static credential in the snapshot while doctor reads healthy. An endpointless anthropic profile classifies the key but the gateway then withholds it; the profile needs the api.anthropic.com endpoint + x-api-key credential (claude-code's shape) for the sandbox route to get its key.

    Two upgrade-path notes from the same run, in case they help others: rebuild verifies the inference route only after the old sandbox is destroyed, so a cold model or a stopped host auth proxy turns into "Recreate failed after sandbox was destroyed" (the printed onboard --resume + snapshot restore recovery worked). And the v0.0.123 recovery path calls sudo lsof on the gateway and dashboard ports; on a passwordless host that fails with "a password is required" a few times and then proceeds (the lsof dependency already noted on #7418).

    Happy for this to be closed as fixed in v0.0.116+ / verified on v0.0.123.

  7. wscurran commented on Nov 14, 2026

    @wscurran
    Contributor

    Thanks for the thorough investigation and production verification. We’re closing the reported Slack socket-mode failure as fixed, based on your v0.0.123 confirmation that the rebuilt sandbox connected, survived a cold reboot, and answered in the channel.

    Your distinction between the two required corrections is helpful: the policy needs credential bindings, and the channel configuration must be regenerated. Updating the policy alone did not resolve the old configuration.

    The legacy provider-classification and upgrade-path observations remain documented above; this closure does not establish that those separate cases are resolved. Please reopen if the same Slack credential-binding failure recurs on a current release after rebuilding, with redacted logs and version details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sandboxarea: securityintegration: slack

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions