File not found error with node JS app

I am running a node js app on the free tier but i keep getting this error with running a puppeteer script

Nov 2 02:25:02 AM node:internal/process/promises:289
Nov 2 02:25:02 AM triggerUncaughtException(err, true /* fromPromise */);
Nov 2 02:25:02 AM ^
Nov 2 02:25:02 AM
Nov 2 02:25:02 AM [Error: ENOENT: no such file or directory, open ‘./a/b/myFile.png’] {
Nov 2 02:25:02 AM errno: -2,
Nov 2 02:25:02 AM code: ‘ENOENT’,
Nov 2 02:25:02 AM syscall: ‘open’,
Nov 2 02:25:02 AM path: ‘./a/b/myFile.png’
Nov 2 02:25:02 AM }

What is strange is that the script works perfectly offline. I am wondering if the problem has to do with the fact that the free tier doesn’t have persistent storage and as such the file is deleted before the script has a chance to work on it

What could be the cause? I’m open to ideas since the script just fails silently, trycatch, debug statements etc are of no help

Hi there,

By default, no service on Render has a persistent filesystem. All instance types use an ephemeral file system unless you add a disk.

If your service was trying to access this file after the service was restarted, it will be lost. If you just created it, then it should exist.

It’s hard to give a specific answer here without knowing more about how your service works. If you open a ticket directly with us we may be able to provide a better answer.


Render Support, UTC+10 :australia:

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