Error 404 - ingress_expiry not within expected range

Hi everyone. I’ve deployed a static page in the IC network, and it’s working fine from my PC, but in my phone i’m getting a 400 error → “Specified ingress_expiry not within expected range”.
I know that the time in my phone is wrong. (some minutes behind).

Does anybody know if that could be the cause? ( wrong time in device ).

Thanks in advance.

This is the error:

I get a 502 error on GET on the CANISTER ID+.icp0.io
followed by:

Error: Server returned an error:
Code: 400 ()
Body: Specified ingress_expiry not within expected range:
Minimum allowed expiry: 2023-05-05 18:44:13.779647122 UTC
Maximum allowed expiry: 2023-05-05 18:49:43.779647122 UTC
Provided expiry: 2023-05-05 18:50:54.017 UTC
Local replica time: 2023-05-05 18:44:13.779647633 UTC

at M.query (index.js:230:19)
at async actor.js:155:19
at async Oe (utils.ts:110:13)
at async Gr.assetRequestHandler (index.ts:84:19)
at async Gr.perform (index.ts:36:19)

Hi @juanpablodr,

yes, that explains the issue. Ingress messages have an expiration time of 5 mins, i.e. if your clock lacks behind more than that, then the IC won’t accept your message.

Thanks for the answer domwoe. Do you know if that’s something I can change, i.e. in my canister parameters ? ( In case my question is totally nonsense, forgive my lack of knowledge about how the IC works ).
I’m aware that hosting a simple static page is not the main purpose of the IC…, and also most people have the time properly configured on their devices…I know that.
But sadly I can’t host this page in the IC if I could have this “issue” with other people I could share the page with.

Thank you again for your time.

Unfortunatley not. This is a global mechanism to prevent replay attacks without having to keep track of nonces for a long time.

May I ask why you don’t sync the time on your phone?

There isn’t any technical reason. You may laugh, but somehow using my phone some minutes ahead helps me with my daily tasks.
I’ve noticed that old pages with the previous postfix (raw.ic0.app) work fine on my phone. Probably this new logic was implemented after the change in the urls.
I never have problems with other pages though, hosted in other platforms.

Anyway, thank you for your answers domwoe! Everyday you learn something new here.

1 Like

The reason that raw.ic0.app works is because the timecode check is done server side rather than on your mobile device. On the “new” URLs, that check runs locally (via the service worker).

3 Likes

Thank you Nathanos for taking the time to reply and helping me understand (even more) how this works.

1 Like

Hi, is anyone else experiencing this issue? I’m getting the following when using the default for Mac (time.apple.com): Code: 400 () Body: Specified ingress_expiry not within expected range: Minimum allowed expiry: 2024-04-18 15:31:34.119747076 UTC, Maximum allowed expiry: 2024-04-18 15:37:04.119747076 UTC, Provided expiry: 2024-04-18 15:31:00 UTC. I recently updated the time manually, one minute forward, but now I’m getting this error again. I’m worried users will have a difficult time figuring this out.

gm, I kept updating my computer’s time manually, but this error still shows up from time to time (quite often, unfortunately). Is there any recommended approach to overcome it?