Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chromium issue with Error initializing NSS with a peristent database NSS error code: -8023

We wrote a Print PDF lambda function generates a PDF file using puppeteer from HTML content sent to it in the SQS message. It is deployed as a lambda in aws. The function also allows uploading of pictures. The pdf is then stored in a s3 bucket. We are using chrome-aws-lambda and puppeteer. ([email protected] [email protected]). When we tried to upload pictures we are getting following:

error: Error initializing NSS with a persistent database  NSS error code: -8023.

It is then followed by

ERROR      Invoke Error       {
    "errorType": "Error",
    "errorMessage": "Navigation failed because browser has disconnected!",
    "stack": [
        "Error: Navigation failed because browser has disconnected!",
        "    at /var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js:51:147",
        "    at /var/task/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:62",
        "    at Array.map (<anonymous>)",
        "    at Object.emit (/var/task/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:43)",
        "    at CDPSession.emit (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js:72:22)",
        "    at CDPSession._onClosed (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:247:14)",
        "    at Connection._onClose (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:128:21)",
        "    at WebSocket.<anonymous> (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/node/NodeWebSocketTransport.js:17:30)",
        "    at WebSocket.onClose (/var/task/node_modules/ws/lib/event-target.js:124:16)",
        "    at WebSocket.emit (events.js:400:28)"
    ]
} 

A pdf file with "access denied" is then created in s3 bucket. Please advise and recommendation a solution.

like image 723
codeflinger Avatar asked Jul 26 '26 01:07

codeflinger


1 Answers

AWS silently updated Node version for Lambdas.

You can update the package and Node version or you can just disable auto update runtime version and lock it. I'm using v18.18 and it's working fine again.

like image 197
Lucas Besen Avatar answered Jul 28 '26 18:07

Lucas Besen