Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One of the provided PIDs are invalid when running script in another users directory #5750

Open
crackedpotato007 opened this issue Jan 25, 2024 · 2 comments

Comments

@crackedpotato007
Copy link

crackedpotato007 commented Jan 25, 2024

## What's going wrong?
Script doesn't start, no PID assigned in pm2 list. using no-daemon gives that error

How could we reproduce this issue?

Have the script in C:\Users\foo\Desktop and execute the script as the user bar using pm2 start C:\Users\foo\Desktop\index.js

Supporting information

I went through #5496 and the last comment, specifically moving the project to C: fixes the issue but moving the project is not feasible for my usecase.

--- PM2 report ----------------------------------------------------------------                                           Date                 : Fri Jan 26 2024 02:39:34 GMT+1100 (Australian Eastern Daylight Time)                               ===============================================================================                                           --- Daemon -------------------------------------------------                                                              pm2d version         : 5.2.2                                                                                              node version         : 20.10.0                                                                                            node path            : not found                                                                                          argv                 : C:\Program Files\nodejs\node.exe,C:\ProgramData\pm2\service\index.js                               argv0                : C:\Program Files\nodejs\node.exe                                                                   user                 : undefined                                                                                          uid                  : N/A                                                                                                gid                  : N/A                                                                                                uptime               : 65min                                                                                              ===============================================================================                                           --- CLI ----------------------------------------------------                                                              local pm2            : 5.2.2                                                                                              node version         : 20.10.0                                                                                            node path            : not found                                                                                          argv                 : C:\Program Files\nodejs\node.exe,C:\ProgramData\npm\npm\node_modules\pm2\bin\pm2,report            argv0                : node                                                                                               user                 : Administrator                                                                                      ===============================================================================                                           --- System info --------------------------------------------                                                              arch                 : x64                                                                                                platform             : win32                                                                                              type                 : Windows_NT                                                                                         cpus                 : AMD Ryzen 7 5800X 8-Core Processor                                                                 cpus nb              : 16                                                                                                 freemem              : 5209092096                                                                                         totalmem             : 103002312704                                                                                       home                 : C:\Users\Administrator                                                                             ===============================================================================                                           --- PM2 list -----------------------------------------------                                                              ┌─────┬───────────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐                                                                                            │ id  │ name                      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │                                                                                            ├─────┼───────────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤                                                                                            │ 3   │ server                    │ default     │ N/A     │ fork    │ N/A      │ 63m    │ 0    │ online    │ 0%       │ 0b       │ Adm… │ disabled │                                                                                                └─────┴───────────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘                                                                                            Modules                                                                                                                   ┌────┬──────────────────────────────┬───────────────┬──────────┬──────────┬──────┬──────────┬──────────┬──────────┐       │ id │ module                       │ version       │ pid      │ status   │ ↺    │ cpu      │ mem      │ user     │       ├────┼──────────────────────────────┼───────────────┼──────────┼──────────┼──────┼──────────┼──────────┼──────────┤       │ 0  │ @jessety/pm2-logrotate       │ 2.7.1         │ 23340    │ online   │ 0    │ 0%       │ 0b       │ Adm… │           │ 2  │ @jessety/pm2-logrotate       │ 2.7.1         │ 17176    │ online   │ 0    │ 0%       │ 0b       │ Adm… │           │ 4  │ @jessety/pm2-logrotate       │ 2.7.1         │ 21348    │ online   │ 0    │ 0%       │ 0b       │ Adm… │           └────┴──────────────────────────────┴───────────────┴──────────┴──────────┴──────┴──────────┴──────────┴──────────┘       [PM2][WARN] Current process list is not synchronized with saved list. Type 'pm2 save' to synchronize.                     ===============================================================================                                           --- Daemon logs --------------------------------------------                                                          
@crackedpotato007
Copy link
Author

Sorry, for the broken formatting. Lost access to my account shortly after creating this issue. This issue occurs in 5.3.1 and not in 5.2.2

@JeffEmery
Copy link

I think I have the same issue. I'm using pm2-installer https://github.com/jessety/pm2-installer which creates a Windows service to run PM2 as LocalService. If I move the script to a root folder like C:\MyApp\index.js, it seems to work. I suspect the LocalService does not have access rights to the user folder C:\Users\jane...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants