{"record":{"id":"d28f8754b93a9145","repo":"rathole-org/rathole","slug":"error","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/client.rs","lineNumber":448,"sourceCode":"            }\n        };\n\n        // Send auth\n        debug!(\"Sending auth\");\n        let mut concat = Vec::from(self.service.token.as_ref().unwrap().as_bytes());\n        concat.extend_from_slice(&nonce);\n\n        let session_key = protocol::digest(&concat);\n        let auth = Auth(session_key);\n        conn.write_all(&bincode::serialize(&auth).unwrap()).await?;\n        conn.flush().await?;\n\n        // Read ack\n        debug!(\"Reading ack\");\n        match read_ack(&mut conn).await? {\n            Ack::Ok => {}\n            v => {\n                return Err(anyhow!(\"{}\", v))\n                    .with_context(|| format!(\"Authentication failed: {}\", self.service.name));\n            }\n        }\n\n        // Channel ready\n        info!(\"Control channel established\");\n\n        // Socket options for the data channel\n        let socket_opts = SocketOpts::from_client_cfg(&self.service);\n        let data_ch_args = Arc::new(RunDataChannelArgs {\n            session_key,\n            remote_addr,\n            connector: self.transport.clone(),\n            socket_opts,\n            service: self.service.clone(),\n        });\n\n        loop {","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/rathole-org/rathole/blob/a292f7ed5402f840415fc6a53827da2f34337856/src/client.rs#L430-L466","documentation":"Fires in the client's control-channel run loop after sending Auth(service_token-derived session key): the server replied with an Ack other than Ack::Ok (e.g. ServiceNotExist or AuthFailed). The client wraps the ack variant in a generic anyhow error, so the displayed message is the ack's Debug/Display text. It means the server rejected the control-channel establishment for this service.","triggerScenarios":"Thrown at src/client.rs:448 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the ack variant in the message: ServiceNotExist means the service name is unknown to the server; AuthFailed means the token does not match","Re-check that the client's service token equals the server's token for the same service","Confirm the service is defined in the server config and the server was reloaded after changes","Replace the generic anyhow!(\"{}\", v) with a typed error for clearer diagnostics"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a292f7ed5402f840415fc6a53827da2f34337856","analyzedAt":"2026-09-07T09:56:55.739Z","contentChangedAt":"2026-09-07T09:56:55.739Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}