400 error every 250 Requests [SOLVED]

My Electron(s) are returning a 400 error every 14-15 minutes , however they are setup to send a keep alive every 4 minutes .

No matter how much I call a function on the electron or how often the device publishes to the API they Will always return a 400 every 15 minutes and that lasts about 1.5 minutes .
It looks like the device goes offline for some reason ?? Or the UDP connection is killed even though I have a keep alive .

Can anyone else tell me what could be causing this issue . Please note this is a 400 error , not a 408

Thanks in advance , P.S these electrons Are currently in a real life production environment where stability is an absolute must and I’m really struggling with these errors

  • Which endpoint are you hitting that gave the 400 error?
  • are you using a third party SIM?

We are using the particle node library which hits api.particle.io

And we are using the particle Sim included with the electron.

The error returned every 14-15 minutes for about 1.5 minutes is :

{
statusCode: 400,
errorDescription: ‘HTTP error 400 from /v1/devices/XXX/XXX’,
error: { [Error: Bad Request] original: null, response: [Object], status: 400 },
body: { ok: false, error: ‘Timed out.’ }
}

Will pass this message along to the Particle team for investigation. :wink:

1 Like

Thankyou that would be a massive help ! its a big hole in our electron sites, as we are getting 400’s for about 1.5 minutes every 14-15 minutes. Cant wait to hear back.

Heya @elijthomas,

Dave here! Can you send me your device id and we’ll check the logs and see what’s up?

Thanks,
David

1 Like

An update , it actually calls the function on the hardware but it returns a 400 error after about 240 requests. Is there hardware / firmeware throttling ? i’m requesting every 5 seconds.

Another BIG update : it is happening every 245 - 250 requests (regardless of time). @Dave or @kennethlimcp anty ideas ?

Oh interesting, that sounds like an off-by-one error on the coap token during a rollover. Thoughts @bryce ?

Thanks,
David

Ok, I have tested about 9 different ways now, It seems to be in the vicinity of 250 - 255 that it returns a 400 error.

I can reproduce it every single time. If you create a loop that calls a function or variable it will fail on the (roughly) 253rd time.

Thanks @Dave, looking forward to hearing from @bryce.

Looks like it gets a 400 error after the 252nd function call and a 408 error after the 252nd variable call, Interesting that they are different errors but are completely reproducable.

1 Like

@elijthomas Can you post or PM me the entire error response you get from the API?

@bryce I have done that :slight_smile: thanks

I’ve confirmed this is a bug in the Particle cloud. The fix is easy, and should be deployed this week.

1 Like

@elijthomas The fix has been deployed. Please try again.

Hi @bryce I have tested and the issue is gone ! Thankyou very much !!