400 Bad Request error when sending requests to IC mainnet from specific machine

Hello. We have some bizarre issue trying to communicate with canisters on IC mainnet, and hope that maybe someone would have ideas about the cause for this.

What we do is sending query, update and management requests to a canister using ic-utils of version 0.39. All the requests work fine on all machines we tried except one specific computer. And it so happens that we need exactly this computer to work for these requests (for security reasons).

On this computer any request that we send to IC mainnet results in 400 Bad Request response with empty body. When we send exactly same requests with dfx CLI tool, they do produce the correct responses. We tried using both HSM and Basic identities when creating an agent. We also tried connecting to different canisters on different subnets, with the same result.

Hey @MaximGritsenko

What does the body of the error response say? Can you check the clock of that machine. Often the time being out-of-sync leads to such errors.

1 Like

Hi, @rbirkner . We’ve checked the time and it is correct. Moreover, if the system time would be the issue dfx requests would also fail, but they do pass without problem. The response body is empty.

Hey @MaximGritsenko

Hmm, ok. Errors from the HTTP Gateways and API Boundary Nodes do have a body and a special header x-ic-error-cause set. What is the value of that header?

Can you see where you are sending the request to? What is the IP address of that machine?