TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
975 stars 306 forks source link

"store error" when importing devices #5926

Closed jpmeijers closed 1 year ago

jpmeijers commented 1 year ago

Summary

I did an export on TTS-CE of all devices in an application. I then created a new application on a TTS Cloud instance, and imported the json file. 5 of the 22 devices did not import with a "store error".

{
  "code": 2,
  "message": "error:pkg/redis:store (store error)",
  "details": [
    {
      "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
      "namespace": "pkg/redis",
      "name": "store",
      "message_format": "store error",
      "correlation_id": "6beb7ce9b84e4d1cb21c66561c2d8e2a",
      "code": 2
    }
  ]
}

@adriansmares is aware of this, and I provided him with the json to reproduce.

Steps to Reproduce

  1. Use ttn-lw-migrate to export all devices in an application.
  2. Import into TTS Cloud instance.
  3. Sometimes you get this error.

Current Result

store error

Expected Result

Devices should import without any error.

Relevant Logs

No response

URL

No response

Deployment

The Things Stack Cloud

The Things Stack Version

3.22.2

Client Name and Version

No response

Other Information

No response

Proposed Fix

No response

Contributing

Code of Conduct

jpmeijers commented 1 year ago

To test I removed pending_mac_state from the failing device's json. Now I'm getting a different error: Invalid value of field pending_mac_state

Update: By removing all fields from the json, except the ones documented at https://www.thethingsindustries.com/docs/getting-started/migrating/device-json/ the device was imported successfully without a session. This however does not solve my problem, as one will need to manually edit the json for every device, something that is impractical when migrating hundreds of devices. I'll therefore have to wait for either this issue to be solved, or the migrate tool to omit the session (https://github.com/TheThingsNetwork/lorawan-stack-migrate/issues/51).