Device security-context out of sync

I’m trying to send a data to the end node using “/api/devices/{device_queue_item.dev_eui}/queue”
Actually, it was working several days ago. but today it responds an error message below.

    {
  "error": "enqueue downlink payload error: create device-queue item error: rpc error: code = InvalidArgument desc = device security-context out of sync",
  "message": "enqueue downlink payload error: create device-queue item error: rpc error: code = InvalidArgument desc = device security-context out of sync",
  "code": 13,
  "details": []
}

Please give me an advice.
This is what I sent.

This happens when the device OTAA joined (again), but LoRa Server did not signal the new AppSKey to LoRa App Server because it didn’t receive a first uplink yet.

Thus, the LoRa App Server security-context is not in sync during a short interval which causes the above error.

@brocaar

we are also facing this issue. What is the root cause of this issue?

What is the solution to this type of error, assume we have deployed so many devices in fields and occurs this type of issue what should we do on-field scenario.

Thanks

This happens when the device OTAA joined (again), but LoRa Server did not signal the new AppSKey to LoRa App Server because it didn’t receive a first uplink yet.

Wait until the device sends its first uplink.

1 Like

Yes, but my device is working perfectly and suddenly server shows context security out of bound error and All the counter will be 0.

Over the course of the life of a device (or battery), the time between the join and the first uplink should be a very small percentage - i.e. it should not happen very often. Is your device rejoining regularly?

No, first time we are facing this issue

I understand not happen every time, @bconway any solution if this issue occurs in the real field?

Thanks for your reply

We configured our services that sit on top of ChirpStack to queue the message until it can be successfully queued in ChirpStack. The same approach works for devices that have been registered but never joined, which also cannot queue downlinks in ChirpStack.

1 Like