We are running a Node.js backend on a Windows Server with PM2
. For PDF generation we use Puppeteer
.
Chromium started with pm2 as Local Service user uses wrong temp folder
Current installation:
PM2 is running as Service installed by using pm2-installer
https://github.com/jessety/pm2-installer) (using the offline installer, as the target is a windows server without internet). This PM2 starts a node application which starts a puppeteer-Chromium instance.
So this Chrome is running with the Local Service user.
Puppeteer is started using a specific userDataDir.
The Problem is now that Puppeteer tries to write to C:\Users\Administrator\AppData\Local\Temp\...
where it does not have the permissions to write to as it is not running as Administrator.
Chrome debug log says: Failed to create temporary file
So the questions are:
- Why is Chrome writing to the Temp folder of the admin and not to a temp folder specific to the Local Service User or to the configured userDataDir (which is used by chrome for other files, so it's correctly configured)?
- How can I change Chromium to use a Temp folder it has permissions to?