standalone-lorawan-gateway-balena icon indicating copy to clipboard operation
standalone-lorawan-gateway-balena copied to clipboard

403 Error after logging in for the first time

Open nucleardreamer opened this issue 3 years ago • 5 comments

After deploying to balena (with the basicstation also deployed), logging in with default admin/changeme on the main page gives back a 403 Forbidden: Token exchange refused, no option to do anything unless I blow away the cookies to get back to the login screen.

Also, trying to Create an account is erroring on the url https://null/api/v3/auth_info, but I'm pretty sure this is unrelated.

nucleardreamer avatar Jun 29 '21 21:06 nucleardreamer

I resolved this by adding my devices IP address as the TS_DOMAIN variable

nucleardreamer avatar Jun 30 '21 16:06 nucleardreamer

Hi The code sets the default TS_DOMAIN to the first IP address in the LAN:

https://github.com/xoseperez/balena-tts-lns/blob/56e527cb27b5bc67e491dfe715c0e6910f493550/lorawan-stack/entrypoint.sh#L42

Maybe it got it wrong or you used a different IP (accessing via WiFi instead of ethernet, for instance)?

xoseperez avatar Jul 01 '21 06:07 xoseperez

@xoseperez looks like TTS_DOMAIN is null instead of having the IP_LAN value.

mpous avatar Jul 01 '21 11:07 mpous

I have not been able to reproduce the issue consistently. Only once I've seen the same behaviour and it got solved after restarting the stack service. Maybe a race condition on getting an IP?

xoseperez avatar Jul 02 '21 06:07 xoseperez

This behaviour happens when you click Deploy with balena as the TTS_DOMAIN variable is only defined as null at the balena.yml contract.

mpous avatar Jul 08 '21 08:07 mpous