rtCamp / Frappe-Manager

A CLI tool based on Docker Compose to easily manage Frappe based projects.
MIT License
107 stars 22 forks source link

service "frappe" is not running in fm.log file #143

Closed SujinIn closed 5 months ago

SujinIn commented 5 months ago

This issue tracker is only for issues related to Frappe-Manager. Please use https://github.com/rtcamp/frappe-manager/discussions for support questions.

Describe the bug A clear and concise description of what the bug is. -> I failed create website.

To Reproduce Steps to reproduce the behavior:

  1. Run command '...'
  2. See error

Here is error message. my account name is zfradmin. And I wrote my typing by Bold.

zfradmin@zfrerp:~$ fm --version 0.12.0 zfradmin@zfrerp:~$ fm create erp --apps erpnext:version-15 --apps hrms:version-15 βœ… fm directory doesn't exists! Created at -> /home/zfradmin/frappe βœ… πŸ” It seems like the first installation. Pulling images... πŸ–ΌοΈ βœ… Pulling image ghcr.io/rtcamp/frappe-manager-frappe:v0.12.0 : Done βœ… Pulling image ghcr.io/rtcamp/frappe-manager-nginx:v0.10.0 : Done βœ… Pulling image ghcr.io/rtcamp/frappe-manager-mailhog:v0.8.3 : Done βœ… Pulling image adminer:latest : Done βœ… Pulling image redis:alpine : Done 🚧 Creating services βœ… Pulling services images: Done βœ… Creating services: Done βœ… Creating Compose directories: Done βœ… Starting Docker Containers: Done β£» Creating Site ⣟ Creating Site ❌ Failure in generating, supervisor.conf file.The docker command executed was docker compose -f /home/zfradmin/frappe/sites/erp.localhost/docker-compose.yml exec --user frappe --workdir /workspace/frappe-bench frappe bench setup supervisor --skip-redis --skip-supervisord --yes --user frappe. It returned with code 1 The content of stdout can be found above the stacktrace (it wasn't captured). The content of stderr is 'service "frappe" is not running'

βœ… Rolling back to previous workers configuration. βœ… Workers compose not present. Generating... βœ… Getting Workers info: Done βœ… Starting Workers Containers: Done ❌ There has been some error creating/starting the site. Please check the logs at /home/zfradmin/frappe/logs/fm.log πŸ€” Do you want to remove 'erp.localhost' [yes/no] (no): yes Please select one of the available options πŸ€” Do you want to remove 'erp.localhost' [yes/no] (no): yes ⚠ Remove DB User: Failed ⚠ Remove DB: Failed βœ… Removing Containers: Done

Expected behavior A clear and concise description of what you expected to happen. -> So, I've checked the fm.log file.

System information (please complete the following information):

Attach log Please attach logs from ~/frappe/logs/fm.log for faster resolution. fm.log

Additional context Add any other context about the problem here.

I've instelled from fm v 0.10.0 it worked well. I have some problem from v 0.11.0 version. So I've uninstall frappe-manager and delete the Frappe folder. And next install Frappe-manager v 0.12.0 again. but..I have this problem. Thank you

Xieyt commented 5 months ago

As I can see in the logs and tried to recreate the issue

This issue arises when a user deletes the fm directory i.e ~/frappe, and then attempts to use fm, when fm gets invoked it recreated the ~/frappe directory and also services compose project and with new random db secret.

The problem is that when the services got recreated it didn't remove the existing Docker containers and volumes and then started the compose project ( old containers got started ).

These containers were initially configured with previous database credentials. However, since these credentials were regenerated upon deletion, they no longer match, leading to authentication failures with the database then the site fails to set up correctly.

Xieyt commented 5 months ago

@SujinIn For now you can follow these steps to fix the issue. Warning: Since you will be removing ~/frappe all your data will be deleted.

  1. Go to dir ~/frappe/services, run command docker compose down -v.
  2. Then delete the dir ~/frappe.
  3. Create site fm create erp --apps erpnext:version-15 --apps hrms:version-15
Xieyt commented 5 months ago

This is fixed in #147. Will be rolled out in next release.

SujinIn commented 5 months ago

Ah...So the docker containers are alived. Thank you very much. Now I can connect to 'erp.localhost' now!!!