vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
787 stars 267 forks source link

Improve error message on proxy.checkHealth timeout #5161

Closed hkraal closed 4 years ago

hkraal commented 4 years ago

The same goes for the remote check of a proxy.

Context

Expected behavior

If the proxy is not reachable due network configurations I would expect a clear message which states that.

Current behavior

When the proxy is unreachable (in this case due an intermediary firewall) and a packet is dropped the following error is shown in settings/logs with a popup that "an unknown error occurred".

proxy.checkHealth
{
  "id": "11ee79c5-a766-43c3-865b-ad01d1ad0b22"
}
{
  "code": "ECONNRESET",
  "url": "https://192.168.0.2/api/v1",
  "message": "socket hang up",
  "name": "Error",
  "stack": "Error: socket hang up
    at connResetException (internal/errors.js:609:14)
    at TLSSocket.socketCloseListener (_http_client.js:400:25)
    at TLSSocket.apply (events.js:327:22)
    at TLSSocket.patchedEmit [as emit] (/usr/local/lib/node_modules/xo-server/node_modules/@xen-orchestra/log/src/configure.js:94:17)
    at net.js:674:12
    at TCP.done (_tls_wrap.js:574:7)"
}
badrAZ commented 4 years ago

Hi,

We cannot be sure that this error is due to the network configuration, it can also be triggered by a lost of connection.

What we are sure when this error is triggered is that the XOA cannot connect to the proxy but we can't know precisely the cause.

julien-f commented 4 years ago

@badrAZ Maybe we could check the error code and have special cases for the most common ones like ECONNRESET, ECONNREFUSED, etc.

badrAZ commented 4 years ago

@julien-f By adding for example a property(cause) which gives more information about these errors?

Regarding these common erros only (ECONNREFUSED, ECONNRESET, ENOTFOUND, ETIMEDOUT) are pertinent in case of a proxy health check.

julien-f commented 4 years ago

No, handle this on UI's side, test code and choose the appropriate message.

Don't hesitate to group errors together if the same message and the same user solution can apply.