CLI: Unable to claim gateway - error with gateway-id format

Hi All,
I’m trying to claim a TTIG Gateway using ttn-lw-cli but it fails with an error stating that the gateway ID is not conform to requirements.
However, the id I’m using matches the pattern used to enforce GW ID format so I guess there’s another error somewhere but I cannot find it.
Has anyone succeeded in claiming through cli ? (this is on a TTN Cloud instance):

ttn-lw-cli -c .ttn-lw-cli.yml gateways claim --gateway-id ttig-test-01 --gateway-eui VALID_EUI --authentication-code 'edofrvwD' --organization-id my-org --target-frequency-plan-id EU_863_870_TTN --target-gateway-server-address XXX.eu1.cloud.thethings.industries

I’m getting this error :

error:pkg/errors:validation (invalid gateway: embedded message failed validation) name=CreateGatewayRequestValidationError field=gateway reason=embedded message failed validation correlation_id=48cad067d52f4d628d863ee99210eaae --- error:pkg/errors:validation (invalid ids: embedded message failed validation) field=ids reason=embedded message failed validation name=GatewayValidationError correlation_id=4308af927daf45aaa86013a50352b0ff --- error:pkg/errors:validation (invalid gateway_id: value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$") name=GatewayIdentifiersValidationError field=gateway_id reason=value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" correlation_id=2ca74cacd9fb46d98d976f66e58de5a6

But the ID I used ttig-test-01 does indeed match the pattern [1](?:[-]?[a-z0-9]){2,}$”
Has anyone succeeded in claiming using cli ?
Thanks


  1. a-z0-9 ↩︎

If this is a one off activity, best just use the web console & move on.

If you need to script this for future claims, then best use the web console to see what it sends to the backend as a hint for the CLI.

The CLI is prone to giving misleading errors - it may be that there is another issue and it’s tripping over the gateway id. The web console should say precisely what’s wrong.

Hi Nick,
thanks for the answer. The ID is to batch a bunch of claiming that’s why I do not wan to use the web console.
I’ve done the claiming through the web console and it worked fine, no issues reported.
So I guess there’s a cli bug lying somewhere :frowning:

Did you capture the http traffic so you can …

I’ll try that, good idea. Thanks