{"record":{"id":"a8e53632b442de23","repo":"nautechsystems/nautilus_trader","slug":"coinbase-credentials-not-available-set-coinbase-a","errorCode":null,"errorMessage":"Coinbase credentials not available; set COINBASE_API_KEY and COINBASE_API_SECRET or pass them in the config","messagePattern":"Coinbase credentials not available; set COINBASE_API_KEY and COINBASE_API_SECRET or pass them in the config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/execution.rs","lineNumber":148,"sourceCode":"    /// Creates a new [`CoinbaseExecutionClient`].\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if credentials cannot be resolved or the underlying\n    /// HTTP / WebSocket client cannot be constructed.\n    pub fn new(\n        core: ExecutionClientCore,\n        config: CoinbaseExecutionClientConfig,\n    ) -> anyhow::Result<Self> {\n        let credential = CoinbaseCredential::resolve(\n            config.api_key.as_ref().map(|value| value.expose_secret()),\n            config\n                .api_secret\n                .as_ref()\n                .map(|value| value.expose_secret()),\n        )\n        .ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"Coinbase credentials not available; set COINBASE_API_KEY and COINBASE_API_SECRET or pass them in the config\"\n                    )\n                })?;\n        let proxy_url = config\n            .proxy_url\n            .as_ref()\n            .map(|value| value.expose_secret().to_owned());\n\n        let retry_config = RetryConfig {\n            max_retries: config.max_retries,\n            initial_delay_ms: config.retry_delay_initial_ms,\n            max_delay_ms: config.retry_delay_max_ms,\n            backoff_factor: 2.0,\n            jitter_ms: 250,\n            operation_timeout_ms: Some(60_000),\n            immediate_first: false,\n            max_elapsed_ms: Some(180_000),\n        };","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/execution.rs#L130-L166","documentation":"The execution (trading) client requires Coinbase API credentials. `new` resolves them from the config or the COINBASE_API_KEY / COINBASE_API_SECRET environment variables; if neither is available it raises this error and refuses to start.","triggerScenarios":"Constructing the Coinbase execution client with api_key/api_secret unset in the config and the env vars missing or empty in the process environment.","commonSituations":"Deploying a trading node without a .env file loaded; running in a container where the secret env vars were not passed; passing only the API key but not the secret (or vice versa).","solutions":["Set COINBASE_API_KEY and COINBASE_API_SECRET in the environment","Pass api_key and api_secret explicitly in the execution client config","Verify the .env file is actually loaded (e.g. dotenv import) before construction","Check the secret is non-empty (a set-but-empty env var still fails)","Confirm the process user can read the env/secret source"],"exampleFix":"// before\nlet config = CoinbaseExecClientConfig::default(); // no creds, no env vars\n// after\nstd::env::set_var(\"COINBASE_API_KEY\", key);\nstd::env::set_var(\"COINBASE_API_SECRET\", secret);\nlet client = CoinbaseExecClient::new(...)?;","handlingStrategy":"validation","validationCode":"fn have_coinbase_creds(cfg: &Config) -> bool {\n    let from_cfg = cfg.api_key.is_some() && cfg.api_secret.is_some();\n    let from_env = std::env::var(\"COINBASE_API_KEY\").map_or(false, |v| !v.is_empty())\n        && std::env::var(\"COINBASE_API_SECRET\").map_or(false, |v| !v.is_empty());\n    from_cfg || from_env\n}\nif !have_coinbase_creds(&config) { return Err(\"set COINBASE_API_KEY/SECRET\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load and verify .env files before starting trading nodes","Pass secret env vars explicitly into containers/k8s pods","Check both key AND secret are present and non-empty at startup","Fail fast with a clear message when creds are missing"],"tags":["rust","credentials","authentication","env-vars","coinbase"],"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"}