You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to run a Python script using PM2 6.x with the --interpreter option, the process immediately fails with a SyntaxError from PM2 internals, specifically referencing ProcessContainerForkBun.js.
This same script runs perfectly fine on PM2 version 5.4.2.
The script should start normally in fork_mode as it does in PM2 5.x. PM2 is expected to launch the Python process using the specified interpreter without attempting to parse it as JavaScript.
Logs
SyntaxError: unterminated string literal (detected at line 29)
File "/usr/local/lib/node_modules/pm2/lib/ProcessContainerForkBun.js", line 29
It seems PM2 6.0.6 is attempting to launch the script through Bun, which incorrectly tries to parse the .py file as JavaScript, resulting in syntax errors.
This regression appears to be introduced due to Bun integration, and it affects all non-JS runtime scripts that rely on --interpreter.
Suggested resolution
Please ensure .py and other external scripts are handled using traditional child_process.spawn behavior as in PM2 5.x, and avoid applying Bun execution paths to non-JavaScript files.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When trying to run a Python script using PM2 6.x with the --interpreter option, the process immediately fails with a SyntaxError from PM2 internals, specifically referencing ProcessContainerForkBun.js.
This same script runs perfectly fine on PM2 version 5.4.2.
To Reproduce
Steps to reproduce the behavior:
This works on PM2 5.4.2
pm2 start main.py --name kookmin-feed --interpreter /path/to/venv/bin/python3
This fails on PM2 6.0.6
pm2 start main.py --name kookmin-feed --interpreter /path/to/venv/bin/python3
Expected behavior
The script should start normally in fork_mode as it does in PM2 5.x. PM2 is expected to launch the Python process using the specified interpreter without attempting to parse it as JavaScript.
Logs
SyntaxError: unterminated string literal (detected at line 29)
File "/usr/local/lib/node_modules/pm2/lib/ProcessContainerForkBun.js", line 29
PM2 Version
• ✅ Works: 5.4.2
• ❌ Fails: 6.0.6
System Information
• OS: Ubuntu 22.04
• Node.js: 18.x
• Python: 3.12
• PM2 Mode: fork
• Command: pm2 start main.py --interpreter /path/to/python3
Additional context
It seems PM2 6.0.6 is attempting to launch the script through Bun, which incorrectly tries to parse the .py file as JavaScript, resulting in syntax errors.
This regression appears to be introduced due to Bun integration, and it affects all non-JS runtime scripts that rely on --interpreter.
Suggested resolution
Please ensure .py and other external scripts are handled using traditional child_process.spawn behavior as in PM2 5.x, and avoid applying Bun execution paths to non-JavaScript files.
The text was updated successfully, but these errors were encountered: