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

bench setup production <user> create wrong node path in supervisor.conf #1615

Open
3 tasks done
tamburro92 opened this issue Jan 9, 2025 · 0 comments
Open
3 tasks done
Labels

Comments

@tamburro92
Copy link

tamburro92 commented Jan 9, 2025

Issue: Bug report

Do the checklist before filing an issue:

  • Can you replicate the issue on the supported bench versions?
  • Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome

Describe the bug 📉
When running sudo bench setup production <user> the nodejs path is wrong in supervisor.conf, bench loads node from system path instead using the user environment installed like nvm install 18.
This behavior creates problem on OS which ship node < 16 like Ubuntu 22 and consequentially fail to start socketio process
This is the affected row in supervisor.conf

[program:frappe-15-node-socketio]
command=/usr/bin/node /home/ubuntu/frappe-15/apps/frappe/socketio.js

To Reproduce 📃
Steps to reproduce the behavior:
Install node

nvm install 18
sudo bench setup production <user>

Expected behavior 📈
supervisor.conf should use node from user environment like:
command=/home/ubuntu/.nvm/versions/node/v18.20.5/bin/node /home/ubuntu/frappe-15/apps/frappe/socketio.js

Screenshots 🔮
If applicable, add screenshots to help explain your problem.

OS (please complete the following information): 🌀

  • Linux: Ubuntu:22

Version Information

Can be found out by running bench version in your respective bench folder.

  • Bench Branch: latest,
  • Frappe Version: v15

Additional context 📄
Add any other context about the problem here.

Possible Solution 📑
In git which("node") should use user context instead of sudo

	config = template.render(
		**{
			"bench_dir": bench_dir,
			"sites_dir": os.path.join(bench_dir, "sites"),
			"user": user,
			"use_rq": use_rq(bench_path),
			"http_timeout": config.get("http_timeout", 120),
			"redis_server": which("redis-server"),
			"node": which("node") or which("nodejs"),
@tamburro92 tamburro92 added the bug label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant