{"record":{"id":"dcb09dd325a53de0","repo":"atuinsh/atuin","slug":"failed-to-create-client","errorCode":null,"errorMessage":"failed to create client","messagePattern":"failed to create client","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/store/push.rs","lineNumber":55,"sourceCode":"impl Push {\n    pub async fn run(&self, settings: &Settings, store: SqliteStore) -> Result<()> {\n        let host_id = Settings::host_id().await?;\n\n        if self.force {\n            println!(\"Forcing remote store overwrite!\");\n            println!(\"Clearing remote store\");\n\n            let caps = atuin_client::api_client::caps_client(settings)?;\n            let client = Client::new(\n                settings.sync_address.clone(),\n                &settings.sync_auth_token().await?,\n                settings.network_connect_timeout,\n                settings.network_timeout * 10, // we may be deleting a lot of data... so up the\n                // timeout\n                &settings.extra_headers,\n                caps,\n            )\n            .expect(\"failed to create client\");\n\n            client.delete_store().await?;\n        }\n\n        // We can actually just use the existing diff/etc to push\n        // 1. Diff\n        // 2. Get operations\n        // 3. Filter operations by\n        //  a) are they an upload op?\n        //  b) are they for the host/tag we are pushing here?\n        let key = paseto_v4::Key::try_load_from_path(&settings.key_path)\n            .context(\"could not load encryption key\")?;\n        let session = SyncSession::builder()\n            .store(store)\n            .client_source(ClientSource::FromSettings {\n                settings,\n                caps: None,\n            })","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/store/push.rs#L37-L73","documentation":"`atuin store push` (with delete) constructs a sync client via `Client::new` and `.expect(\"failed to create client\")`s on failure. This panics when the HTTP client cannot be built — most commonly an invalid sync URL in settings, bad extra headers, or TLS/network client initialization failure.","triggerScenarios":"Running `atuin store push` when `Client::new(...)` fails at crates/atuin/src/command/client/store/push.rs:55 — e.g. `sync_url` in config is malformed/unparsable, or invalid characters in `extra_headers` prevent HTTP client construction.","commonSituations":"Misconfigured `sync_url` in ~/.config/atuin/config.toml (typo, missing scheme, self-signed TLS host); corporate proxies with bad header values; syncing against a self-hosted server with an invalid address.","solutions":["Fix `sync_url` in ~/.config/atuin/config.toml to a valid absolute URL (e.g. `https://api.atuin.sh`).","Remove or correct any invalid entries in `extra_headers` in the config.","Verify the server hostname resolves and TLS config is valid (`curl <sync_url>`)."],"exampleFix":"// before (config.toml)\nsync_url = \"api.atuin.sh\"\n// after\nsync_url = \"https://api.atuin.sh\"","handlingStrategy":"validation","validationCode":"// validate sync_url before running store push\nlet url = url::Url::parse(&settings.sync_url)\n    .expect(\"sync_url in config.toml must be a valid absolute URL, e.g. https://api.atuin.sh\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep sync_url as a fully-qualified https:// URL in config.toml.","Validate extra_headers values after proxy/VPN configuration changes.","Test connectivity with curl to the sync host before running store operations."],"tags":["network","http-client","config","panic"],"backgroundTag":"invalid-url-format","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}