Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the host is not reachable/time's out through volto-corsproxy, the nodejs/razzele/webpack-dev-server crashes #26

Open
fredvd opened this issue Oct 17, 2024 · 4 comments

Comments

@fredvd
Copy link

fredvd commented Oct 17, 2024

This might be related to #2 where missing error handling is also mentionned. When in dev mode the content cannot be fetched, the whole frontend/ssr servers crashes. I need to restart the volto server to be able to retrieve any frontend pages. For example:

proxy error connect ETIMEDOUT 10.31.14.100:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) {
  errno: -60,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '10.31.14.100',
  port: 443
}
Error: connect ETIMEDOUT 10.31.14.100:443
    at ProxyServer.onError (/Users/fred/projects/my-project/frontend/frontend/node_modules/@eeacms/volto-corsproxy/src/index.js:48:1)
    at ProxyServer.emit (/Users/fred/projects/my-project/frontend/node_modules/eventemitter3/index.js:210:27)
    at RedirectableRequest.proxyError (/Users/fred/projects/my-project/frontend/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:165:18)
    at RedirectableRequest.emit (node:events:531:35)
    at ClientRequest.eventHandlers.<computed> (/Users/fred/projects/my-project/frontend/node_modules/follow-redirects/index.js:38:24)
    at ClientRequest.emit (node:events:519:28)
    at emitErrorEvent (node:_http_client:108:11)
    at TLSSocket.socketErrorListener (node:_http_client:511:5)
    at TLSSocket.emit (node:events:519:28)
@fredvd
Copy link
Author

fredvd commented Oct 22, 2024

@avoinea @tiberiuichim Is this something you recognise as an issue with the current implementation of the proxy?

@avoinea
Copy link
Member

avoinea commented Oct 22, 2024

@fredvd Can you provide your allowed_cors_destinations config?

@fredvd
Copy link
Author

fredvd commented Oct 24, 2024

Sure, it is is a list of the allowed api URL's:

allowed_cors_destinations: [
  'api.vmm.vlaanderen.be',
],

The error doesn't happen consistently, only when the API itself is flakey. And we know it sometimes times out. The problem is that is then somehow crashes/locks up the volto node process. Hopefully, if the cors destination isn't allowed according tot he list, an incoming request to /volto-corsproxy would also keep the node process running.

@tiberiuichim
Copy link
Member

@fredvd I'm not sure how that would crash the express server. I can see that the foreign API errors is caught, as the error is logged and then thrown again. https://github.com/eea/volto-corsproxy/blob/75aed18ad62c3174acfbd2da88abf1f42932fc7c/src/index.js#L48C9-L48C30

Maybe something more needs to be done around that area of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants