tornjak icon indicating copy to clipboard operation
tornjak copied to clipboard

No UI error when Tornjak socket misconfigured

Open mrsabath opened this issue 3 years ago • 0 comments

When Tornjak socket is incorrectly specified, the UI does not show any useful message.

For example when selecting Agent List panel, the backend calls are made as follow:

Request URL: http://localhost:10000/api/tornjak/selectors/list
Request Method: GET
Status Code: 200 OK
Remote Address: [::1]:10000
Referrer Policy: strict-origin-when-cross-origin

and

equest URL: http://localhost:10000/api/agent/list
Request Method: GET
Status Code: 400 Bad Request
Remote Address: [::1]:10000
Referrer Pol

Direct call shows:

curl -vvv http://localhost:10000/api/agent/list
*   Trying 127.0.0.1:10000...
* Connected to localhost (127.0.0.1) port 10000 (#0)
> GET /api/agent/list HTTP/1.1
> Host: localhost:10000
> User-Agent: curl/7.79.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Access-Control-Allow-Headers: Content-Type, access-control-allow-origin, access-control-allow-headers, access-control-allow-credentials, Authorization, access-control-allow-methods
< Access-Control-Allow-Methods: POST, GET, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: *, Authorization
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 16 Mar 2023 19:56:08 GMT
< Content-Length: 183
< 
Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /tmp/spire-server/private/api.sock: connect: no such file or directory"
* Connection #0 to host localhost left intact

mrsabath avatar Mar 16 '23 19:03 mrsabath