Request to api v2 failed

Hi there

I’m using nextjs to build static page from

During ma build stage, I got sometimes this kind of errors

reason: 140180047560008:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:…/deps/openssl/openssl/ssl/record/ssl3_record.c:677

Any idea ?


Hi Yoann,

Thanks for contributing to the Prismic community.

I haven’t seen this error before but it seems and an issue on your end.

I will try to investigate this with you but I need some extra information such as your repository name, and it would be great if you can share with us your project code (you can send me a direct message if confidential).

Looking forward to your reply,

Hi Fares,

How can i can send you a direct message ?


To send a private message you simply need to click on my profile and click Message.

Just moving this info from a private message for the community benifit

I had a look at your code, and I don't think that the issue is related to this code snippet, I would guess that this is an issue related to your Node/App config.

Anyway, I will create an issue in our issue tracker to have somebody from our dev team to have a look at it.
Also what I advise you to do is to post this question publically in our forums so somebody from the community might have encountered the same issue.

I encountered the same exact error. It's hard to say whether it's fixed 100% for sure now because it was a bit flaky but it seems like that was it:

I'm using Vercel with next.js and I think what's happening is that an http request being launched independently from the page request/response cycle (so, one where its promise is not merged in the result of getserversideprops, etc) either fails naturally without a catch() block or fails unnaturally due to the serverless platform killing your http connections after a while. Somehow Vercel couldn't recover from such errors and displayed a 502.

Hopefully that helps you debugging :slight_smile: