Body: Specified ingress_expiry not within expected range:

I am running a heroku server and trying to talk to a canister on mainnet.

I am encountering an error quite frequently where I am being told that my time is ahead of the IC network and I am before time expiry. This is the full error I am seeing:

 Body: Specified ingress_expiry not within expected range: 
Minimum allowed expiry: 2024-08-08 12:06:05.276014545 UTC, 
Maximum allowed expiry: 2024-08-08 12:11:35.276014545 UTC, 
Provided expiry:        2024-08-08 12:06:00 UTC

I have looked into changing the time/resyncing the time of my heroku server but it seems to be correct and uses AWS to sync the time. So it is likely that my server time is correct.

I have tried using the syncTime function on the agent i am trying to use but it doesn’t seem to change anything.

this is a snippet of my code:

export const createAgent = async (canisterID: string) => {
  const agent = new HttpAgent({
    host: 'https://ic0.app',
    identity,
  });
  agent.syncTime(Principal.fromText(canisterID));

Is it possible that the IC’s time is a little bit behind? Or is there anything I can do to fix this…

Please help x

Not the same error message but, it sounds vaguely similar to the SSG issue I encountered this weekend. @kpeacock said there might be an inssue with syncTime:

I updated my version of @dfinity/agent and seems to be working a bit better now

1 Like