Issue Description
I’m experiencing a consensus failure when making HTTP outcalls to Discord webhooks from my IC canister. The error indicates that replicas are returning different responses, preventing consensus from being reached. Additionally, I’m receiving multiple duplicate Discord messages instead of just one, suggesting the request is being processed multiple times.
Error Details
Failed to send webhook: Request failed: (SysTransient, “No consensus could be reached. Replicas had different responses. Details: request_id: 112432, timeout: 1757795577378071499, hashes: [b3ece9ff483b8675f8f0e65ad43bdaa40723544d9994b5125526db18728e094c: 1], [ab6b89f5d2d277ad9bf44acdfc8847ff85c5f68f70e195f5bcb701eabf905001: 1], [7753ca3b315ad95979d8a7de62214792e4ee3927161383ec39613a662e5ed4b5: 1], [699de35216ea55c658e203cb8f558a99e0e458c126af2d5a2dc54bd0f4042179: 1], [56a86bcecc3d04ff5d397f325aa3aad83db3b870bf906d74eed7342c6fbcf2b0: 1], [018bf18c4c6f09dadee41f7535415997dc1f24973a265a43010c3d0c0190ebc9: 1]”)
Technical Setup
-
Network: Mainnet IC
-
Canister Type: Rust canister
-
HTTP Request Configuration:
-
URL: https://discordapp.com/api/webhooks/[webhook-id]/[webhook-token]
-
Method: POST
-
Content-Type: application/json
-
Max Response Bytes: 2000
-
Cycles: 5,000,000,000 (5 billion)
Code Implementation
// HTTP Request Structure
let request = CanisterHttpRequestArgument {
url: webhook_url.to_string(),
method: HttpMethod::POST,
headers: vec![
HttpHeader {
name: "Content-Type".to_string(),
value: "application/json".to_string(),
},
],
body: Some(discord_payload.to_string().into_bytes()),
max_response_bytes: Some(MAX_DISCORD_RESPONSE_BYTES),
transform: None,
};
// Making the request
match http_request(request, DISCORD_REQUEST_CYCLES).await {
Ok(_) => println!("Webhook sent successfully"),
Err(e) => println!("Failed to send webhook: {}", e),
}
GitHub Repo:
github.com/AbdulrahmanFiala/chain_notary