Nodejs SSL issues with connection to prismic api

Hi,
we are having an issue with prismic api when building our project with docker image node:16.7-buster:
I get following errors in Gitlab CI job:

info - Generating static pages (2113/8453)
Unhandled error during request: FetchError: request to https://gambolaweb.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=1&lang=fi-fi&ref=YXaaghEAACAAbrPn&q=[[at(document.type%2C%20"footer")]] failed, reason: 139869216447816:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:../deps/openssl/openssl/ssl/record/ssl3_record.c:677:
at ClientRequest. (/app/.next/serverless/chunks/2674.js:108394:11)
at ClientRequest.emit (events.js:400:28)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
at TLSSocket._emitTLSError (_tls_wrap.js:893:10)
at TLSWrap.onerror (_tls_wrap.js:416:11) {
type: 'system',
errno: 'ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC',
code: 'ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC'
}
Error occurred prerendering page "/fi-fi/game/huluwa/play". Read more: prerender-error | Next.js
FetchError: request to https://gambolaweb.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=1&lang=fi-fi&ref=YXaaghEAACAAbrPn&q=[[at(document.type%2C%20"footer")]] failed, reason: 139869216447816:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:../deps/openssl/openssl/ssl/record/ssl3_record.c:677:
at ClientRequest. (/app/.next/serverless/chunks/2674.js:108394:11)
at ClientRequest.emit (events.js:400:28)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
at TLSSocket._emitTLSError (_tls_wrap.js:893:10)
at TLSWrap.onerror (_tls_wrap.js:416:11)

I've already tried with node:16.7-alpine , node:17.0.1-buster, node:14-alpine and node:16.12-buster without any success so far.
Issue started 3 days ago with no changes to code whatsoever.
Gitlab-runner is on google kubernetes with version 14.2.

Please help.

Hey there @onladv, welcome to the forum.

I think the problem comes from the lang= parameter. I checked your repository’s endpoint and noticed the Finish (Finland) locale code is set to fi, whereas the one in the query string appears as fi-fi.

If you change this, the URL should work:

https://gambolaweb.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=1&lang=fi&ref=YXaaghEAACAAbrPn&q=%5B%5Bat(document.type%2C%20%22footer%22)%5D%5D

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.