hello there,
ingress_expiry not within expected error when deploy frontend canister from server ,
to create static page i sent get data request to node api and node api call my backend canister to fetch data , some pages created and in some pages it throw an error ingress_expiry not within expected range .
sometime its work well and sometime i face this error .
And on frontend my website is on article base when i try to publish the the article i face this error
In the latest AgentJS release, you can set a specific replicaTime. Can you please try that and see if it helps per the other thread that we’re communicating in?
i have update its version to latest and and i don;t know to to set its value replicaTime
i have set it like
const replicaTime = BigInt(Date.now()) * BigInt(1_000_000); // Current time in nanoseconds
const agent = options.agent || HttpAgent.createSync({ …options.agentOptions ,replicaTime});
is it correct if not then reffer me how to do this. thanks
use time::{Duration, OffsetDateTime};
use ic_agent::Agent;
let now_utc = OffsetDateTime::now_utc();
let five_seconds = Duration::seconds(5);
let time = now_utc + five_seconds;
agent.query(&ledger.id, "get_transactions")
.expire_at(time)
.with_arg("your args").unwrap())
.call_without_verification().await
how i can did this in next js creating agent please need help @jennifertran
when i send request to canister it show me error like ingress expiry screenshot i mentioned above
Had this weird error also in a project I worked on, had this when one of my team member has deployed the project on main net and while testing on main net, rust backend and react front end.
This was the issue, Some on the internet said that the system time might be wrong. Which we checked later on, and seemed to be correct.
Ultimately, we resolved the error by deploying again on main net in my laptop, and it worked perfectly. So, I’d suggest you to do that. Not another laptop, but prolly just deploying again on the main net.
which canisiter i deploy now i send a request to backend canister which throw an error “ingress expiry” ,
is this reason can be i am send to many request to backend ? as i am creating build of nextjs and static pages and for each static page a create an actor and an send request to backend to get data? if anyone the reason than please let me know. thanks
The root of the problem you encountered is the fact that a client’s time can be ahead of the replica’s time which receives the message. Moreover the time certified by the subnet’s nodes can differ from both those times as well. We are aware of the problem and we’re discussing different options to improve the situation. We should be able to communicate a more concrete plan soon.