Private Stack Instance on localhost: Internal Server Error

Hi all,
I’m running a private instance of TTN-Stack on a VM which runs on a remote server without DNS, so the configuration was made as default for localhost.
When I try to login to the Web Console, I get an intenal Server Error. Log:

INFO Request handled                          duration=393.03µs location=/oauth/authorize?client_id=console&redirect_uri=%2Fconsole%2Foauth%2Fcallback&response_type=code&state=4JP6pFsDuHg1VZnj method=GET namespace=web remote_addr=192.168.200.1:54389 request_id=01DZ1TYK440SGCQB3SC985E8KD response_size=0 status=302 url=/console/login/ttn-stack,
INFO Request handled                          duration=12.739815ms location=/oauth/login?n=%2Foauth%2Fauthorize%3Fclient_id%3Dconsole%26redirect_uri%3D%252Fconsole%252Foauth%252Fcallback%26response_type%3Dcode%26state%3D4JP6pFsDuHg1VZnj method=GET namespace=web remote_addr=192.168.200.1:54389 request_id=01DZ1TYK4GB011FQD607JRG5FX response_size=0 status=302 url=/oauth/authorize?client_id=console&redirect_uri=%2Fconsole%2Foauth%2Fcallback&response_type=code&state=4JP6pFsDuHg1VZnj,
INFO Request handled                          duration=5.849146ms method=GET namespace=web remote_addr=192.168.200.1:54389 request_id=01DZ1TYK55Y60N93NPJHKW3YE1 response_size=1364 status=200 url=/oauth/login?n=%2Foauth%2Fauthorize%3Fclient_id%3Dconsole%26redirect_uri%3D%252Fconsole%252Foauth%252Fcallback%26response_type%3Dcode%26state%3D4JP6pFsDuHg1VZnj,
INFO Request handled                          duration=6.679248ms method=GET namespace=web remote_addr=192.168.200.1:54389 request_id=01DZ1TYKJ1R97GE0DV9QSZ1KSP response_size=248 status=401 url=/oauth/api/me,
INFO Request handled                          duration=155.537051ms location=/console/oauth/callback?code=MF2XI.T6FYYK6P3W52MIWQ6OCFW5BNEM6OBLCW67NCIZY.ZAK35RFXZ5ZFVDS62WODW5ANAJLPXTPEPHNB3FARMCS5IJCAWCLQ&state=4JP6pFsDuHg1VZnj method=GET namespace=web remote_addr=192.168.200.1:54392 request_id=01DZ1TYYGX6PM931E4KM1XC4J0 response_size=0 status=302 url=/oauth/authorize?client_id=console&redirect_uri=%2Fconsole%2Foauth%2Fcallback&response_type=code&state=4JP6pFsDuHg1VZnj,
INFO Request handled                          duration=123.208879ms method=POST namespace=web remote_addr=192.168.200.1:54392 request_id=01DZ1TYYC6PDB2BE9R668D5EXT response_size=0 status=204 url=/oauth/api/auth/login,
ERROR Request error                            duration=30.002094729s method=GET namespace=web remote_addr=192.168.200.1:54392 request_id=01DZ1TYYP4H6ZNGFY6DQ8Y3WND response_size=2292 status=500 url=/console/oauth/callback?code=MF2XI.T6FYYK6P3W52MIWQ6OCFW5BNEM6OBLCW67NCIZY.ZAK35RFXZ5ZFVDS62WODW5ANAJLPXTPEPHNB3FARMCS5IJCAWCLQ&state=4JP6pFsDuHg1VZnj,
INFO Request handled                          duration=708.907µs method=GET namespace=web remote_addr=192.168.200.1:54395 request_id=01DZ1TZW9A7B76SESX2HBZ2QR9 response_size=253 status=401 url=/console/api/auth/token

It’s is important to mention that im calling the web page by the static IP given to the VM: http://192.168.xxx.xx by the DHCP Server
the window.PAGE_DATA shows the following error:

attributes: Object { message: "Post http://localhost:1885/oauth/token: dial tcp: i/o timeout" }
code: 2
message_format: "Internal Server Error"
namespace: "pkg/errors/web"
​​​...
length: 1
message: "error:pkg/errors/web:unknown (Internal Server Error)"

I don’t know from where the call is made, but I assume it should be calling http://192.168.xxx.xx:1885/oauth/token instead of localhost

Any Ideas ?

UPDATE 1
I changed the setup to use the static IP. now I’m getting a different Internal Server Error:

Post https://192.168.200.98:8885/oauth/token: dial tcp 192.168.200.98:8885: connect: no route to host

I suppose this is a docker problem ?

UPDATE 2
I still don’t understand it correctly, but it is worth to mention that in my solution, the VM is working behind a proxy.
So i tried to set the proxy, the Error changed again to Forbidden, which indicates a problem with the certificates as in many Issues in the forum and Github.
I tried to add my Certificates to the trusted ca-certs in the container, but i was not successful.
My provisory solution for now is editing the Oauth token url to use http instead of https!

TTN_LW_CONSOLE_OAUTH_TOKEN_URL=http://<ip>/oauth/token

Conclusion
Use Let’s encrypt if you can, and spare yourself the trouble.

This topic was automatically closed after 30 days. New replies are no longer allowed.