Closed bafonins closed 3 years ago
@adriansmares please assign milestone
Found another one. NS panic when no lorawan_version
and lorawan_phy_version
provided in creation request.
Without lorawan_version
and lorawan_phy_version
:
curl --location --request PUT 'http://localhost:8080/api/v3/ns/applications/{app-id}/devices/{device-id}' \
--header 'Authorization: Bearer ... \
--header 'Content-Type: application/json' \
--data-raw '{
"end_device": {
"multicast": true,
"ids": {
"device_id": {device-id}
},
"session": {
"keys": {
"f_nwk_s_int_key": {
"key": "C87C8BEFC72E7A3011218B027CCB5057"
}
},
"dev_addr": "01A8B2AE"
},
"supports_class_c": true,
"frequency_plan_id": "EU_863_870"
},
"field_mask": {
"paths": [
"multicast",
"ids.device_id",
"session.keys.f_nwk_s_int_key.key",
"session.dev_addr",
"supports_class_c",
"frequency_plan_id"
]
}
}'
Response:
{
"code": 13,
"message": "error:pkg/rpcserver:rpc_recovered (Internal Server Error)",
"details": [
{
"@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
"namespace": "pkg/rpcserver",
"name": "rpc_recovered",
"message_format": "Internal Server Error",
"correlation_id": "9da93977a6de4b26827a9ce6942497d0",
"code": 13
}
]
}
With lorawan_version
and lorawan_phy_version
inplace:
curl --location --request PUT 'http://localhost:8080/api/v3/ns/applications/{app-id}/devices/{device-id}' \
--header 'Authorization: Bearer ... \
--header 'Content-Type: application/json' \
--data-raw '{
"end_device": {
"multicast": true,
"ids": {
"device_id": {device-id}
},
"session": {
"keys": {
"f_nwk_s_int_key": {
"key": "C87C8BEFC72E7A3011218B027CCB5057"
}
},
"dev_addr": "01A8B2AE"
},
"supports_class_c": true,
"lorawan_version": "MAC_V1_0",
"frequency_plan_id": "EU_863_870",
"lorawan_phy_version": "PHY_V1_0"
},
"field_mask": {
"paths": [
"multicast",
"ids.device_id",
"session.keys.f_nwk_s_int_key.key",
"session.dev_addr",
"supports_class_c",
"lorawan_version",
"frequency_plan_id",
"lorawan_phy_version"
]
}
}'
NS return 200 as expected
Summary
NS returns error 500 when creating a new end device and adding
"ids"
field mask. This is what I see in the logs:Steps to Reproduce
app-id
curl
command:"ids"
field mask from the request:What do you see now?
NS returns error 500
What do you want to see instead?
No panic
Can you do this yourself and submit a Pull Request?
no