rtCamp / Frappe-Manager

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

Site is unreachable. #79

Closed keerthanamuruge closed 6 months ago

keerthanamuruge commented 9 months ago

I tried to locally set up ERP next using Frappe Manager:

Followed steps

Step 1: Create a separate folder Step 2: Create a virtual environment Step 3: Installation pip install frappe-manager Step 4: Create a site fm create frappe.localhost --apps erpnext:version-15 Step 5: Complete the setup. Containers started running

Using

Os Ubuntu 22 python 3.11.7 fm 0.9.0 docker 24.0.7

Faced Issue:

image

Logs yarn run v1.22.19 $ node esbuild --production --run-build-command node:internal/modules/cjs/loader:1080 throw err; ^ Error: Cannot find module 'fast-glob' Require stack: - /workspace/frappe-bench/apps/frappe/esbuild/esbuild.js - /workspace/frappe-bench/apps/frappe/esbuild/index.js at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:110:18) at Object. (/workspace/frappe-bench/apps/frappe/esbuild/esbuild.js:3:14) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/workspace/frappe-bench/apps/frappe/esbuild/esbuild.js', '/workspace/frappe-bench/apps/frappe/esbuild/index.js' ] } Node.js v18.17.0 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/workspace/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in main() File "/workspace/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main click.Group(commands=commands)(prog_name="bench") File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/commands/utils.py", line 72, in build bundle( File "/workspace/frappe-bench/apps/frappe/frappe/build.py", line 257, in bundle frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env(), raise_err=True) File "/workspace/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 97, in popen raise subprocess.CalledProcessError(return_, command) subprocess.CalledProcessError: Command 'yarn run production --run-build-command' returned non-zero exit status 1. Traceback (most recent call last): File "/workspace/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 644, in connect sock = socket.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/.pyenv/versions/3.11.0/lib/python3.11/socket.py", line 850, in create_connection raise exceptions[0] File "/opt/.pyenv/versions/3.11.0/lib/python3.11/socket.py", line 835, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/workspace/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in main() File "/workspace/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main click.Group(commands=commands)(prog_name="bench") File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/commands/site.py", line 76, in new_site _new_site( File "/workspace/frappe-bench/apps/frappe/frappe/installer.py", line 85, in _new_site install_db( File "/workspace/frappe-bench/apps/frappe/frappe/installer.py", line 160, in install_db setup_database(force, source_sql, verbose, no_mariadb_socket) File "/workspace/frappe-bench/apps/frappe/frappe/database/__init__.py", line 20, in setup_database return frappe.database.mariadb.setup_db.setup_database( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 36, in setup_database if force or (db_name not in dbman.get_database_list()): ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 49, in get_database_list return self.db.sql("SHOW DATABASES", pluck=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 194, in sql self.connect() File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 109, in connect self._conn = self.get_connection() ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 102, in get_connection conn = self._get_connection() ^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 108, in _get_connection return self.create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 111, in create_connection return pymysql.connect(**self.get_connection_settings()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 358, in __init__ self.connect() File "/workspace/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 711, in connect raise exc pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 111] Connection refused)") Traceback (most recent call last): File "/workspace/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 644, in connect sock = socket.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/.pyenv/versions/3.11.0/lib/python3.11/socket.py", line 850, in create_connection raise exceptions[0] File "/opt/.pyenv/versions/3.11.0/lib/python3.11/socket.py", line 835, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/workspace/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in main() File "/workspace/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main click.Group(commands=commands)(prog_name="bench") File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func ret = f(frappe._dict(ctx.obj), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/commands/scheduler.py", line 106, in scheduler toggle_scheduler(state == "enable") File "/workspace/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 132, in toggle_scheduler frappe.db.set_single_value("System Settings", "enable_scheduler", int(enable)) File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 737, in set_single_value to_update = self._get_update_dict( ^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 708, in _get_update_dict modified = modified or now() ^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/utils/data.py", line 351, in now return now_datetime().strftime(DATETIME_FORMAT) ^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/utils/data.py", line 298, in now_datetime dt = convert_utc_to_system_timezone(datetime.datetime.utcnow()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/utils/data.py", line 338, in convert_utc_to_system_timezone time_zone = get_system_timezone() ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/utils/data.py", line 319, in get_system_timezone return frappe.cache.get_value("time_zone", _get_system_timezone) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 100, in get_value val = generator() ^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/utils/data.py", line 312, in _get_system_timezone return frappe.get_system_settings("time_zone") or "Asia/Kolkata" # Default to India ?! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/__init__.py", line 2336, in get_system_settings local.system_settings = get_cached_doc("System Settings") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/__init__.py", line 1170, in get_cached_doc doc = get_doc(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/__init__.py", line 1298, in get_doc doc = frappe.model.document.get_doc(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/model/document.py", line 80, in get_doc controller = get_controller(doctype) ^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/model/base_document.py", line 69, in get_controller site_controllers = import_controller(doctype) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/model/base_document.py", line 80, in import_controller doctype_info = frappe.db.get_value("DocType", doctype, fieldname="*") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 466, in get_value result = self.get_values( ^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 563, in get_values out = self._get_values_from_table( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 827, in _get_values_from_table return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 194, in sql self.connect() File "/workspace/frappe-bench/apps/frappe/frappe/database/database.py", line 109, in connect self._conn = self.get_connection() ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 102, in get_connection conn = self._get_connection() ^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 108, in _get_connection return self.create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 111, in create_connection return pymysql.connect(**self.get_connection_settings()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 358, in __init__ self.connect() File "/workspace/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py", line 711, in connect raise exc pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 111] Connection refused)") 2023-12-15 06:33:11,659 INFO RPC interface 'supervisor' initialized 2023-12-15 06:33:11,659 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2023-12-15 06:33:11,659 INFO supervisord started with pid 1082 2023-12-15 06:33:12,661 INFO spawned: 'bench-dev' with pid 1083 2023-12-15 06:33:13,150 INFO exited: bench-dev (exit status 1; not expected) 2023-12-15 06:33:14,153 INFO spawned: 'bench-dev' with pid 1154 2023-12-15 06:33:14,665 INFO exited: bench-dev (exit status 1; not expected) 2023-12-15 06:33:16,668 INFO spawned: 'bench-dev' with pid 1225 2023-12-15 06:33:17,135 INFO exited: bench-dev (exit status 1; not expected) 2023-12-15 06:33:20,140 INFO spawned: 'bench-dev' with pid 1296 2023-12-15 06:33:20,588 INFO exited: bench-dev (exit status 1; not expected) 2023-12-15 06:33:21,589 INFO gave up: bench-dev entered FATAL state, too many start retries too quickly
Xieyt commented 9 months ago

The issue arises from fm failing to detect the yarn install node packages failure during Frappe installation. I've labeled this as a bug and it will be addressed in the next update. This occurs specifically when the internet connection weakens while installing the Frappeverse apps.

As a temporary fix, you can resolve the problem by deleting the site with fm delete <sitename and then recreating it using fm create <sitename>.

Xieyt commented 6 months ago

Now sites are checked after creation, so this should not happen again.