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

Can't execute set-mariadb-host mariadb correctly #1254

Closed
1 task done
lucasvazq opened this issue Jan 12, 2022 · 6 comments
Closed
1 task done

Can't execute set-mariadb-host mariadb correctly #1254

lucasvazq opened this issue Jan 12, 2022 · 6 comments
Labels

Comments

@lucasvazq
Copy link

lucasvazq commented Jan 12, 2022

Issue: Bug report

Describe the bug 📉

In the develop branch, when I try to execute bench set-mariadb-host mariadb the return that I get is:

Usage: bench frappe [OPTIONS] COMMAND [ARGS]...
Try 'bench frappe --help' for help.

Error: No such command 'set-mariadb-host'.

I think the CLI is looking for the mariadb frappe command instead of the set-mariadb-host bench command. If I run bench set-mariadb-host I get:

Usage: bench set-mariadb-host [OPTIONS] HOST
Try 'bench set-mariadb-host --help' for help.

Error: Missing argument 'HOST'.

Expected behavior 📈
Bench command is expected to be executed instead of the Frappe one.

OS (please complete the following information): 🌀

  • Linux: Zorin:15.3

Version Information

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

  • Bench Branch: develop
  • Frappe Version: 13.11.0
  • ERPNext Version: 13.11.0

Possible Solution 📑

1)
Use bench set-config -g db_host mariadb

2)
Manually add "db_host": "mariadb" to sites/common_site_config.json

3)
Replace the lines 98 to 102 of the file bench/cli.py with:

		if (
			sys.argv[1] != "set-mariadb-host" and (
				sys_argv.commands.intersection(get_cached_frappe_commands())
				or sys_argv.commands.intersection(get_frappe_commands())
			)
		):
			frappe_cmd()
@lucasvazq lucasvazq added the bug label Jan 12, 2022
@lucasvazq lucasvazq changed the title Cant execute set-mariadb-host mariadb Can't execute set-mariadb-host mariadb correctly Jan 12, 2022
@daraul
Copy link

daraul commented Jan 12, 2022

I had this problem today; it's worked fine for months .

@nazarialireza
Copy link

I have same issue and adding the "db_host": "mariadb" to the frappe-bench/site/common_site_config.json works for me.

@Shubham-frappe
Copy link

I tried all above solutions still it is not working , giving this error:

Usage: bench frappe [OPTIONS] COMMAND [ARGS]...
Try 'bench frappe --help' for help.

Error: No such command 'set-mariadb-host'.

i also can't find /bench/cli.py file on my workspace , actually i am trying to install erpnext and frappe using frappe_docker

@lucasvazq
Copy link
Author

@Shubham-frappe you can also add this setting manually directly in your sites/common_site_config.json.

Find it and add:

  "db_host": "mariadb"`,

@mojerro
Copy link

mojerro commented Apr 8, 2022

met the same problem today, and the following method works for me~

I have same issue and adding the "db_host": "mariadb" to the frappe-bench/site/common_site_config.json works for me.

@gavindsouza
Copy link
Collaborator

gavindsouza commented Aug 5, 2022

There were long-standing issues in the CLI resolution, which has gotten some attention in the past two quarters. However, these should be fixed via #1334

PS: Tried bench set-mariadb-host mariadb with Bench 5.14.0 and it works fine

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

6 participants