Importing devices in V3 with JSON generated by V2 ttn-lw-migrate tool fails

Based upon the process documentation "…/docs/getting-started/migrating/migrating-from-v2/ " I tried to migrate an OTAA test device.
The V2 ttn-lw-migrate tool succesfully generated a JSON file which failed in the V3 “import end device” process.

The result of this import :
“code”: 3,
“message”: “error:pkg/networkserver:field_mask (invalid field mask)”,
“details”: [
@type”: “”,
“namespace”: “pkg/networkserver”,
“name”: “field_mask”,
“message_format”: “invalid field mask”,
“correlation_id”: “16fbb93b94fd49efab19e36ed5815f6f”,
“cause”: {
“namespace”: “pkg/ttnpb”,
“name”: “prohibited_field”,
“message_format”: “field {field} is prohibited”,
“attributes”: {
“field”: “session.keys.nwk_s_enc_key.key”
“code”: 2
“code”: 3
“request_details”: {
“url”: “/ns/applications/showcase/devices/leonardo005”,
“method”: “put”,
“stack_component”: “ns”

Anyone a clue?

I’m facing exactly the same issue. Did you find any solution yet, or do you have an idea what is causing the issue?

Made some tests and figured out, that the issue is caused by the “session”-part of the json-object. If I remove the session part it works fine.

The question for me now is why is this part generated by the migration tool. I’m using lorawan-stack-migrate_0.3.0 to generate the json objects.

Thanks for your effort, I will give it another try soon.

The session part is most likely generated to transfer live devices to V3, without a rejoin. Not all devices are accesable for maintenance.

The v2 tool was created before v3 existed. It wasn’t created to provide data for v3 specifically.

the tool lorawan-stack-migrate was initially commited to github on 26. November 2020, and version v0.3.0-rc1 was commited 8 Days ago.

So the tool came along with V3.

This might be a bit confusing

My apologies, I wasn’t aware of such a thing, I’ve been using the CLI tools as I had lots of scripts for v2 and I’m in the process of reworking the essential ones for v3, having reworked the v3 quick reference ( so I can see all the options.

If you can, please submit a GitHub issue on this. I’ll have a look at the migration tool over the next few days.

Issue created. Thanks

I overlooked the note that importing live sesions will be supported in stack V3.12. My mistake, sorry for that.