Closed ymgupta closed 2 years ago
I am having the same problem.
My application has device ids that are just numbers.
Examples:
10
11
12
13
14
simon@workstation:(w)~^master ±
% ttn-lw-migrate application --source ttnv2 "wildschreck" --ttnv2.with-session=false
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored.
INFO Clearing device keys dev_eui=XXXXXXXXX device_id=10
Error: error:go.thethings.network/lorawan-stack-migrate/cmd:invalid_fields (invalid fields for device `10`)
error:go.thethings.network/lorawan-stack-migrate/cmd:invalid_fields (invalid fields for device `10`)
device_id=10
dev_eui=XXXXXXXXXX
--- error:pkg/errors:validation (invalid `ids`: embedded message failed validation)
reason=embedded message failed validation
name=EndDeviceValidationError
field=ids
--- error:pkg/errors:validation (invalid `device_id`: value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$")
name=EndDeviceIdentifiersValidationError
field=device_id
reason=value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$"
A successful export.
simon@workstation:(w)~^master ±
% ttn-lw-migrate device --source ttnv2 "1355" --ttnv2.with-session=false
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored.
INFO Clearing device keys dev_eui=XXXXXXXX device_id=1355
{"ids":{"device_id":"1355","application_ids":{"application_id":"wildschreck"},"dev_eui":"XXXXXXXX","join_eui":"XXXXXXX"},"created_at":"0001-01-01T00:00:00Z","updated_at":"0001-01-01T00:00:00Z","name":"1355","lorawan_version":"MAC_V1_0_2","lorawan_phy_version":"PHY_V1_0_2_REV_B","frequency_plan_id":"EU_863_870_TTN","supports_join":true,"root_keys":{"app_key":{"key":"XXXXXXXXX"}},"mac_settings":{"supports_32_bit_f_cnt":true,"status_time_periodicity":"0s","status_count_periodicity":0}}
Ubuntu 20.04 Application installed via snap.
Output of command ttn-lw-migrate version
:
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared object): ignored.
Migrate from other LoRaWAN network servers to The Things Stack: ttn-lw-migrate
Version: 0.7.0
Build date: 2021-09-27T14:43:12Z
Git commit: ca2d9a2
Go version: go1.16.8
OS/Arch: linux/amd64
Remove the or adjust the regex that filters valid device_ids.
If that's not possible, then request a different name be given to conform to the required naming scheme in the new TTN stack (if it's that, which requires that device names obey this regex)
I can just retry the export command again and see if it works.
I will try to remove the regex in a fork and see what happens...
Actually this regex comes from the things stack itself and can't be changed by me.
It seems that this is out of my hands:
@AnyTimeTraveler: Your issue was fixed with a previous PR. Please try with the latest version.
@ymgupta: Is the original issue still necessary? Are users still using this tool for TTN v2 migration?
Hi @KrishnaIyer,
In recent times we don't see any TTN V2 users using this tool/reporting this issue to us. However, there are TTI V2 customers who will be using this tool in their migration to TTS V3.
Feel free to close it for now. If we see the need to implement this, we will reopen.
Summary
While migrating the devices from V2 to V3 with the migrating tool, users are getting an error
invalid attributes[CustomerKey]: value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$"
when the device attributes don't satisfy the regex pattern.Steps to Reproduce
ttnctl
toolWhat do you see now?
The export of devices halted with the below error.
What do you want to see instead?
Export of the device should be successful without any issues.
Environment
TTI V2 SaaS ttn-lw-migrate tool v0.7.0
How do you propose to implement this?
Can we handle this case at the migration tool in a similar way it is handling the device id constraints (updating
_
occurrences with-
) to enhance the user experience?As most of the users are migrating from TTI V2/TTN V2, it would avoid the manual intervention of the users in deleting and re-adding these attributes for the devices in this case.
How do you propose to test this?
...
Can you do this yourself and submit a Pull Request?
No