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

ModuleNotFoundError: No module named 'india_compliance' #1612

Open
aquiveal opened this issue Dec 30, 2024 · 2 comments
Open

ModuleNotFoundError: No module named 'india_compliance' #1612

aquiveal opened this issue Dec 30, 2024 · 2 comments

Comments

@aquiveal
Copy link

aquiveal commented Dec 30, 2024

Issue: Easy Install

Do the checklist before filing an issue:

  • [Y] Did you retain the logfile (path of logfile is shared while the script is run)? We definitely need the logfile to debug any easy install related issues.
  • [N] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome

Distro Information (Required)

6.8.0-1020-gcp #22-Ubuntu SMP Mon Dec 9 17:09:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Command Run (Required)

python3 easy-install.py build --no-ssl --http-port=80 --email=REDACTED --sitename=REDACTED --app=erpnext --app=india_compliance --app=ecommerce_integrations --apps-json=/home/frappe/apps.json --tag=erpnext:custom-15 --deploy

app.json

[
  {
    "url": "https://github.com/frappe/erpnext.git",
    "branch": "version-15"
  },
  {
    "url": "https://github.com/resilient-tech/india-compliance.git",
    "branch": "version-15"
  },
  {
    "url": "https://github.com/frappe/ecommerce_integrations.git",
    "branch": "main"
  }
]

Log File (Required)
Creating site: REDACTED

--no-mariadb-socket is DEPRECATED; use --mariadb-user-host-login-scope='%' (wildcard) or --mariadb-user-host-login-scope=, instead. The name of this option was misleading: it had nothing to do with sockets.

Installing frappe...
Updating DocTypes for frappe : [========================================] 100%
Updating Dashboard for frappe

Installing erpnext...
Updating DocTypes for erpnext : [========================================] 100%
Updating customizations for Address
Updating customizations for Contact
Updating Dashboard for erpnext
Could not find app "india_compliance":
No module named 'india_compliance'
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/caching.py", line 57, in wrapper
return frappe.local.request_cache[func][args_key]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 4408257986769628895

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 "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 114, in
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
click.Group(commands=commands)(prog_name="bench")
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1161, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 99, in new_site
_new_site(
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 117, in _new_site
install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 281, in install_app
app_hooks = frappe.get_hooks(app_name=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 1596, in get_hooks
hooks = _dict(_load_app_hooks(app_name))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/caching.py", line 59, in wrapper
return_val = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 1568, in _load_app_hooks
app_hooks = get_module(f"{app}.hooks")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 1434, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1126, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'india_compliance'
Bench Site creation failed for erpnext.capybaara.com
Command '['docker', 'compose', '-p', 'frappe', 'exec', 'backend', 'bench', 'new-site', '--no-mariadb-socket', '--db-root-password=REDACTED', '--admin-password=REDACTED', '--install-app', 'erpnext', '--install-app', 'india_compliance', '--install-app', 'ecommerce_integrations', 'REDACTED']' returned non-zero exit status 1.

Screenshots

Additional context

Possible Solution

@aquiveal
Copy link
Author

aquiveal commented Dec 30, 2024

When I use the --deploy argument to the build command, it reverts to the original ERPNext image instead of the newly built one.

I have to first upload the image to a public/private repository because the script deploy command doesn't accept just the image name. Additionally, the script appends "v15.47.1" to every image name when I use the deploy command, forcing me to tag my image with "v15.47.1" for it to be accepted.

python3 easy-install.py deploy --project=frappe --image=ghcr.io/OWNER/REPO/erpnext:capybaara-15 --no-ssl --http-port=80 --email=REDACTED --sitename=REDACTED --app=erpnext --app=india_compliance --app=ecommerce_integrations

unable to get image 'ghcr.io/OWNER/REPO/erpnext:capybaara-15ghcr.io/OWNER/REPO/erpnext:capybaara-15:v15.47.1': Error response from daemon: invalid reference format
Docker Compose failed, please check the container logs
Command '['docker', 'compose', '-p', 'frappe', '-f', '/root/frappe-compose.yml', 'up', '--force-recreate', '--remove-orphans', '-d']' returned non-zero exit status 1.

@revant
Copy link
Collaborator

revant commented Jan 3, 2025

Following command worked for me. Note the --image and --version.

python3 easy-install.py build --no-ssl --http-port=8080 --sitename=apps.localhost --app=erpnext --app=india_compliance --app=ecommerce_integrations --apps-json=./apps.json --tag=erpnext:custom-15 --deploy --image=erpnext --version=custom-15
  • Start with clean setup
  • Remove ~/passwords.txt, ~/<project-name>-compose.yml, ~/<project-name>.env, ~/<project-name>-passwords.txt, and frappe_docker
  • remove easy-install.py
  • Download latest easy-install.py and try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants