Hi, I’m trying to deploy a Gatsby site using SSR. In development mode, it works but in production, I’m having this:
On the home page after deployment:
{
"errorMessage": "RequestId: 17a104fc-1a1f-482a-87cb-68f2826abc31 Error: Runtime exited with error: exit status 1",
"errorType": "Runtime.ExitError"
}
I installed the Essential Gatsby plugin and on the functions logs I have this:
10:31:24 PM 2021-12-07T04:31:24.553Z undefined INFO Start copying data
10:31:24 PM 2021-12-07T04:31:24.564Z undefined INFO End copying data
10:31:24 PM 2021-12-07T04:31:24.830Z undefined INFO could not write to cache directory, please make sure the following path exists and is writable
10:31:24 PM 2021-12-07T04:31:24.830Z undefined INFO /var/task
10:31:24 PM 2021-12-07T04:31:24.833Z undefined ERROR Error: EROFS: read-only file system, access '/var/task'
at Object.accessSync (fs.js:228:3)
at Object.3645 (/var/task/.cache/page-ssr/routes/render-page.js:4962:268)
at __webpack_require__ (/var/task/.cache/page-ssr/routes/render-page.js:9650:41)
at Object.1381 (/var/task/.cache/page-ssr/routes/render-page.js:4950:215)
at __webpack_require__ (/var/task/.cache/page-ssr/routes/render-page.js:9650:41)
at Object.9874 (/var/task/.cache/page-ssr/routes/render-page.js:4361:392)
at __webpack_require__ (/var/task/.cache/page-ssr/routes/render-page.js:9650:41)
at /var/task/.cache/page-ssr/routes/render-page.js:9775:491
at /var/task/.cache/page-ssr/routes/render-page.js:9801:3
at Object.<anonymous> (/var/task/.cache/page-ssr/routes/render-page.js:9806:12) {
errno: -30,
syscall: 'access',
code: 'EROFS',
path: '/var/task'
}
10:31:25 PM 2021-12-07T04:31:25.121Z undefined INFO directory already exists
10:31:25 PM 2021-12-07T04:31:25.505Z undefined INFO could not write to cache directory, please make sure the following path exists and is writable
10:31:25 PM 2021-12-07T04:31:25.505Z undefined INFO /var/task
10:31:25 PM 2021-12-07T04:31:25.508Z undefined ERROR Error: EROFS: read-only file system, access '/var/task'
at Object.accessSync (fs.js:228:3)
at Object.3645 (/var/task/.cache/page-ssr/routes/render-page.js:4962:268)
at __webpack_require__ (/var/task/.cache/page-ssr/routes/render-page.js:9650:41)
at Object.1381 (/var/task/.cache/page-ssr/routes/render-page.js:4950:215)
at __webpack_require__ (/var/task/.cache/page-ssr/routes/render-page.js:9650:41)
at Object.9874 (/var/task/.cache/page-ssr/routes/render-page.js:4361:392)
at __webpack_require__ (/var/task/.cache/page-ssr/routes/render-page.js:9650:41)
at /var/task/.cache/page-ssr/routes/render-page.js:9775:491
at /var/task/.cache/page-ssr/routes/render-page.js:9801:3
at Object.<anonymous> (/var/task/.cache/page-ssr/routes/render-page.js:9806:12) {
errno: -30,
syscall: 'access',
code: 'EROFS',
path: '/var/task'
}
10:31:25 PM 17a104fc Duration: 618.18 ms Memory Usage: 58 MB
10:31:25 PM RequestId: 17a104fc-1a1f-482a-87cb-68f2826abc31 Error: Runtime exited with error: exit status 1
Runtime.ExitError
I already added AWS_LAMBDA_JS_RUNTIME variable to nodejs14.x
Any idea what I’m doing wrong?