Runtime version getting timeout
my nextjs application using optimizer but last 24 hours getting runtime version timeout error, also this happen before 3-4 months ago maybe google cloud outages happen latelty.
so we need some fallback version for runtime-version
https://github.com/ampproject/amp-toolbox/blob/master/packages/runtime-version/lib/RuntimeVersion.js#L76-L86
update:
{ FetchError: request to https://cdn.ampproject.org/rtv/metadata failed, reason: connect ETIMEDOUT 216.58.206.193:443
at ClientRequest.<anonymous> (/usr/src/node_modules/node-fetch/lib/index.js:1455:11)
at ClientRequest.emit (events.js:198:13)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
message:
'request to https://cdn.ampproject.org/rtv/metadata failed, reason: connect ETIMEDOUT 216.58.206.193:443',
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT' }
I haven't heard of any google cloud outages. Did this happen in prod?
But we definitely should have some kind of fallback. This is also a DevX problem as development is hindered while offline.
My suggestion would be:
- download and cache the latest runtime version + v0.css on install.
- fallback to cached version on time out (500ms?)
- update cached version on every successful download
@sebastianbenz this happen in production.
@sebastianbenz also we can't controll this behavior see https://github.com/zeit/next.js/blob/2ba352da39ee00b6595aecdc9ffb2f103e803a85/packages/next/next-server/server/optimize-amp.ts#L9
Thanks for the details. This was most likely an issue in your prod environment. The runtime version is served from the same endpoint as the AMP runtime which had no outages. Nevertheless, we should fix optimizer falling because of this.
Sidenote: it's going to be possible to configure optimizer in Next.js once https://github.com/zeit/next.js/pull/10705 has landed in prod.
@sebastianbenz thanks again maybe my server had some issue, either way following next pull request
I'm getting the same issue when using the optimizer to build from my dev machine...
FetchError: request to https://cdn.ampproject.org/rtv/metadata failed, reason: read ECONNRESET
at ClientRequest.
I'm having the same issue in production from time to time with my NextJS App, unfortunately this results in an Internal server error even if the user is not navigating an AMP page. Anyone found a workaround or a solution for this?
Yeah, I'm also seeing this issue in production. Curious if anyone found a workaround to the 502 in production
I fixed it by porting over all my code to a new nextjs project and redeploying it. Sucks, but it seemed to have worked.
The fix is already in the latest Next.js canary. Would be great if someone could verify this.
I'm not using Next.js but had the same error in my server using amp-optimizer-express. The error seems to be fixed by #747. Thanks for opening this issue and fixing it.
any update on how to solve this problem?