{"record":{"id":"d93a771661f36533","repo":"nautechsystems/nautilus_trader","slug":"coinbase-credentials-unavailable-for-ws-reset","errorCode":null,"errorMessage":"Coinbase credentials unavailable for WS reset","messagePattern":"Coinbase credentials unavailable for WS reset","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/execution.rs","lineNumber":418,"sourceCode":"        // we rebuild the client outright to guarantee clean cmd_tx/out_rx\n        // pairs and a fresh signal.\n        if self.ws_user.is_active() || self.ws_user.is_reconnecting() {\n            log::debug!(\"Tearing down stale user WS before reconnect\");\n            self.ws_user\n                .disconnect()\n                .await\n                .context(\"failed to close stale Coinbase user WebSocket\")?;\n            let credential = CoinbaseCredential::resolve(\n                self.config\n                    .api_key\n                    .as_ref()\n                    .map(|value| value.expose_secret()),\n                self.config\n                    .api_secret\n                    .as_ref()\n                    .map(|value| value.expose_secret()),\n            )\n            .ok_or_else(|| anyhow::anyhow!(\"Coinbase credentials unavailable for WS reset\"))?;\n            self.ws_user = CoinbaseWebSocketClient::with_credential(\n                &self.config.ws_url(),\n                credential,\n                self.config.transport_backend,\n                self.config\n                    .proxy_url\n                    .as_ref()\n                    .map(|value| value.expose_secret().to_owned()),\n            );\n        }\n\n        if self.core.instruments_initialized() {\n            // Instruments were loaded externally; still propagate the cached\n            // set to the WS client on reconnect scenarios.\n            let cached: Vec<InstrumentAny> = self.instruments_cache.values().cloned().collect();\n            if !cached.is_empty() {\n                self.ws_user.initialize_instruments(cached).await;\n            }","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/execution.rs#L400-L436","documentation":"Raised in connect() when the client needs to rebuild the Coinbase user WebSocket with API credentials but both config.api_key and config.api_secret are None. CoinbaseIntx credential resolution returns Option; without a key/secret pair the WS reset cannot proceed and connect fails.","triggerScenarios":"Constructing CoinbaseExecutionClientConfig without api_key/api_secret (relying on env credentials that are not set) and then calling connect() which triggers a WS reset path.","commonSituations":"Missing COINBASE_API_KEY/COINBASE_API_SECRET environment variables, config built programmatically omitting credentials, or using env-based auth that was removed/renamed.","solutions":["Set api_key and api_secret on CoinbaseExecutionClientConfig (SecretString values).","Set the COINBASE_API_KEY / COINBASE_API_SECRET environment variables so the config loader picks them up.","Verify the credentials file/env names match what your node config references.","If running unauthenticated is intended, use a code path/config that does not require the private WS user channel."],"exampleFix":"// before\nlet config = CoinbaseExecutionClientConfig { api_key: None, api_secret: None, .. };\n// after\nlet config = CoinbaseExecutionClientConfig {\n    api_key: Some(SecretString::new(key.into())),\n    api_secret: Some(SecretString::new(secret.into())),\n    ..\n};","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    config.api_key.is_some() && config.api_secret.is_some(),\n    \"Coinbase api_key/api_secret required for user WebSocket\"\n);","typeGuard":"fn has_credentials(config: &CoinbaseExecutionClientConfig) -> bool {\n    config.api_key.is_some() && config.api_secret.is_some()\n}","tryCatchPattern":null,"preventionTips":["Set COINBASE_API_KEY/COINBASE_API_SECRET in the deployment environment before startup.","Validate credential presence at config-load time, not at connect time.","Keep secrets as SecretString and source them from one known env/config location."],"tags":["credentials","websocket","authentication","config"],"backgroundTag":"missing-credentials","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}