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> doesn't create symlink for supervisor.conf #1613

Open
2 of 6 tasks
Mutantpenguin opened this issue Jan 3, 2025 · 1 comment
Open
2 of 6 tasks
Labels

Comments

@Mutantpenguin
Copy link

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 bench setup production <user>, the symlink for supervisor.conf doesn't get created. Running it a second time creates the symlink.

I mean this symlink, as described in the documentation:

To Reproduce 📃
Steps to reproduce the behavior:

  1. install a bench
  2. run sudo bench setup production <user>
  3. directory /etc/supervisor/conf.d/ is empty
  4. run it again
  5. symlink got created

Expected behavior 📈
I expect the symlink to be created on the first run.

OS (please complete the following information): 🌀

  • Linux: Ubuntu 24.04.1
  • macOS: version
  • Windows version
  • Others? haros:distro:version

Version Information

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

  • Bench Branch: 5.23.0
  • Frappe Version: 15.51.1
  • ERPNext Version: not installed

Additional context 📄
Yeah I know I can do this by hand, but the documentation states that this command automates the manual steps.

@Mutantpenguin
Copy link
Author

Mutantpenguin commented Jan 6, 2025

We figured out whats happening, but I don't think I can fix this myself:

  • in bench/config/production_setup.py on line 52, the supervisor.conf file gets created via the function generate_supervisor_config
  • inside this function, update_config({"restart_supervisor_on_update": True}, bench_path=bench_path) is called which changes the config on disk, but not in the running bench instance
  • later in bench/config/production_setup.py on line 53, the config is checked if restart_supervisor_on_update is `true´
  • since the config only got changed on disk, this code doesn't know about this change and therefore doesn't create the symlink

Our workaround for now:

  • do bench set-config restart_supervisor_on_update true -g before running sudo bench setup production frappe

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