Can't migrate from V2 to V3 because the migrate app is not allowed to delete

We’ve identified the issue and a fix is on the way.

1 Like

That’s great news! Thank you for the quick response.

We just deployed a patch that should fix the issue. Please inform us here how it goes.

Hello, I am still getting the error when drying to export applications or devices using ttnv2 as the source.

error:unknown:unknown (permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021.)

What command are you running?

export TTNV2_APP_ID="my_application_name"
export TTNV2_APP_ACCESS_KEY="ttn-account-v2.mykeyishere"
export FREQUENCY_PLAN_ID="US_902_928_FSB_2"
ttn-lw-migrate application --source ttnv2 "my_application_name" > application_export.json

The key and application name are replaced but these are basically what I’m using, from:
Github

Can confirm. The export still doesn’t work using command
ttn-lw-migrate application --source ttnv2 “application name” --verbose > devices.json

Ok but can you paste the verbose outputs? I just tested with one of my applications and I didn’t have any issues

~ » ttn-lw-migrate application --source ttnv2 "myapp" --verbose > apps.json
 DEBUG [core]parsed scheme: ""
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{discovery.thethings.network:1900  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "discovery.thethings.network:1900" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000847750, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000847750, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=282.012642ms method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]parsed scheme: ""
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{eu.thethings.network:1904  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "eu.thethings.network:1904" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000848670, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000848670, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=120.676701ms method=/handler.ApplicationManager/GetDevicesForApplication service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=117.271201ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=xxxxx device_id=xxxx
 DEBUG rpc-client: call done                    auth-type=key duration=131.202206ms method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
 DEBUG [transport]transport: loopyWriter.run returning. connection error: desc = "transport is closing"%

Sure here is the verbose output:
The first device is succesfull because i have already cleared the keys of this device a while ago.

DEBUG [core]parsed scheme: “”
DEBUG [core]scheme “” not registered, fallback to default scheme
DEBUG [core]ccResolverWrapper: sending update to cc: {[{discovery.thethings.network:1900 0 }] }
DEBUG [core]ClientConn switching balancer to “pick_first”
DEBUG [core]Channel switches to new LB policy “pick_first”
DEBUG [core]Subchannel Connectivity change to CONNECTING
DEBUG [core]Subchannel picks a new address “discovery.thethings.network:1900” to connect
DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000976620, {CONNECTING }
DEBUG [core]Channel Connectivity change to CONNECTING
DEBUG [core]Subchannel Connectivity change to READY
DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000976620, {READY }
DEBUG [core]Channel Connectivity change to READY
DEBUG rpc-client: call done auth-type=key duration=260.536037ms method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
DEBUG [core]parsed scheme: “”
DEBUG [core]scheme “” not registered, fallback to default scheme
DEBUG [core]ccResolverWrapper: sending update to cc: {[{eu.thethings.network:1904 0 }] }
DEBUG [core]ClientConn switching balancer to “pick_first”
DEBUG [core]Channel switches to new LB policy “pick_first”
DEBUG [core]Subchannel Connectivity change to CONNECTING
DEBUG [core]Subchannel picks a new address “eu.thethings.network:1904” to connect
DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000885e40, {CONNECTING }
DEBUG [core]Channel Connectivity change to CONNECTING
DEBUG [core]Subchannel Connectivity change to READY
DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000885e40, {READY }
DEBUG [core]Channel Connectivity change to READY
DEBUG rpc-client: call done auth-type=key duration=1.969800231s method=/handler.ApplicationManager/GetDevicesForApplication service-name=ttn-lw-migrate service-version=2.x.x
DEBUG rpc-client: call done auth-type=key duration=54.222061ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
INFO Clearing device keys dev_eui=1000000000000001 device_id=1000000000000001
DEBUG rpc-client: call done auth-type=key duration=55.772106ms method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
DEBUG rpc-client: call done auth-type=key duration=50.553326ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
INFO Clearing device keys dev_eui=1000000000000002 device_id=1000000000000002
DEBUG rpc-client: call failed auth-type=key duration=49.663047ms error=rpc error: code = PermissionDenied desc = permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021. method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
DEBUG [core]Channel Connectivity change to SHUTDOWN
DEBUG [core]Subchannel Connectivity change to SHUTDOWN
DEBUG [core]Channel Connectivity change to SHUTDOWN
DEBUG [core]Subchannel Connectivity change to SHUTDOWN
DEBUG [transport]transport: loopyWriter.run returning. connection error: desc = “transport is closing”
Error: error:go.thethings.network/lorawan-stack-migrate/cmd:export (export device 1000000000000002)
DEBUG [transport]transport: loopyWriter.run returning. connection error: desc = “transport is closing”
error:go.thethings.network/lorawan-stack-migrate/cmd:export (export device 1000000000000002)
device_id=1000000000000002
— error:unknown:unknown (permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021.)

DEBUG [core]parsed scheme: ""                 
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{discovery.thethings.network:1900  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "discovery.thethings.network:1900" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc00079f320, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc00079f320, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=90.184182ms method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]parsed scheme: ""                 
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{us-west.thethings.network:1904  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "us-west.thethings.network:1904" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc00087c330, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc00087c330, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=403.674152ms method=/handler.ApplicationManager/GetDevicesForApplication service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=99.549464ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=xxxx device_id=xxxx
 DEBUG rpc-client: call failed                  auth-type=key duration=107.868155ms error=rpc error: code = PermissionDenied desc = permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021. method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
Error: error:go.thethings.network/lorawan-stack-migrate/cmd:export (export device `xxxx`)
error:go.thethings.network/lorawan-stack-migrate/cmd:export (export device `xxxx`)
    device_id=xxxx
--- error:unknown:unknown (permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021.)

Ok I can reproduce this. I’ll get back here after some debugging

Ok I’ve pushed a fix. My tests work. Can you guys check now?

2 Likes

I’ve tested exporting both applications and devices and they both appear to be working. Thank you!

It seems, that for migrating an application it only works for the first device. Here the output.

 DEBUG [core]parsed scheme: ""                 
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{discovery.thethings.network:1900  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "discovery.thethings.network:1900" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0x14000b499c0, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0x14000b499c0, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=85.612125ms method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]parsed scheme: ""                 
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{eu.thethings.network:1904  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "eu.thethings.network:1904" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0x14000760770, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0x14000760770, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=38.450209ms method=/handler.ApplicationManager/GetDevicesForApplication service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=40.95725ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=10521C5AD67CFEFF device_id=pax_heltecv2_10521c5ad67cfeff
 DEBUG rpc-client: call done                    auth-type=key duration=41.688584ms method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=40.17475ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=10521C5AD70CFEFF device_id=pax_heltecv2_10521c5ad70cfeff
 DEBUG rpc-client: call failed                  auth-type=key duration=35.519958ms error=rpc error: code = PermissionDenied desc = permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021. method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN

Error: error:go.thethings.network/lorawan-stack-migrate/cmd:export (export device `pax_heltecv2_10521c5ad70cfeff`)
error:go.thethings.network/lorawan-stack-migrate/cmd:export (export device `pax_heltecv2_10521c5ad70cfeff`)
    device_id=pax_heltecv2_10521c5ad70cfeff
--- error:unknown:unknown (permission denied: V2 clusters are now read-only. Migrate your devices to a The Things Stack (V3) cluster now! V2 clusters will permanently shut down in December 2021.)

Welcome, it would be very useful to know what command you issued to get this debug log.

Please note, I used the </> tool to format it - please do the same in future.

Thanks for the formatting help. I’ve run the following command:
ttn-lw-migrate application --verbose --source ttnv2 "kommunales_personenzaelen" devices_kommunales_personenzaelen.json

~ » ttn-lw-migrate application --source ttnv2 "myapp" --verbose > myapp.json
 DEBUG [core]parsed scheme: ""
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{discovery.thethings.network:1900  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "discovery.thethings.network:1900" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc00075fac0, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc00075fac0, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=72.726973ms method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]parsed scheme: ""
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{eu.thethings.network:1904  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "eu.thethings.network:1904" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc0001704e0, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc0001704e0, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call done                    auth-type=key duration=133.805999ms method=/handler.ApplicationManager/GetDevicesForApplication service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=25.996441ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=xxxx device_id=home-node-1
 DEBUG rpc-client: call done                    auth-type=key duration=54.338871ms method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=27.921412ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=xxxx device_id=home-uno-b199
 DEBUG rpc-client: call done                    auth-type=key duration=34.82058ms method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG rpc-client: call done                    auth-type=key duration=36.46346ms method=/handler.ApplicationManager/GetDevice service-name=ttn-lw-migrate service-version=2.x.x
  INFO Clearing device keys                     dev_eui=xxxx device_id=uno-1707
 DEBUG rpc-client: call done                    auth-type=key duration=27.273897ms method=/handler.ApplicationManager/SetDevice service-name=ttn-lw-migrate service-version=2.x.x
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
 DEBUG [core]Channel Connectivity change to SHUTDOWN
 DEBUG [core]Subchannel Connectivity change to SHUTDOWN
```

I just did a check and it works for me. When did you attempt this? Also is there any difference between
`pax_heltecv2_10521c5ad67cfeff ` and `pax_heltecv2_10521c5ad70cfeff `?

The migrate tool is now working for me.
Thank you for the assistance!

I migrated an other application without any problems.
Don’t know what is special in the other one, migrated it manually.
Thanks for your support.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.