I have successfully run ERP next on WSL2 Ubunut-22.04 following frappe_docker/docs/setup-options.md at main · frappe/frappe_docker · GitHub
Now, I am trying to install custom apps, but am getting an error while mimicking production install on local using WSL2.
Steps followed for WSL2 Ubuntu22.04 installation
- wsl --install Ubuntu-22.04 (PowerShell)
- Install Docker Desktop
- mkdir ~/.certs → cd .certs
- openssl genrsa -out mysite.key 2048
- openssl req -new -newkey rsa:2048 -nodes -keyout mysite.key -out mysite.csr -subj “proper inputs”
- openssl x509 -req -days 365 -in mysite.csr -signkey mysite.key -out mysite.crt
- cd …
- git clone GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext
- cd frappe_docker
- mkdir ~/gitops
- nano ~/gitops/apps.json
[ { "url": "https://github.com/frappe/erpnext", "branch": "version-15" }, { "url": "https://github.com/frappe/payments", "branch": "version-15" }, { "url": "https://github.com/frappe/hrms", "branch": "version-15" }, { "url": "https://github.com/frappe/crm", "branch": "main" }, { "url": "https://github.com/resilient-tech/india-compliance", "branch": "version-15" } ]
-
export APPS_JSON_BASE64=$(base64 -w 0 ~/gitops/apps.json)
-
docker build
–build-arg=FRAPPE_PATH=GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
–build-arg=FRAPPE_BRANCH=version-15
–build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64
–tag=user/repo:1.0.0
–file=images/layered/Containerfile . -
docker login (Using docker hub)
-
docker push image:tag
-
cp example.env .env (change variables) (changed DB_PASSWORD, LETSENCRYPT_EMAIL, SITES=
erp.mysite.com
-
export CUSTOM_IMAGE=‘user/repo’, export CUSTOM_TAG=‘1.0.0’
-
docker compose -f compose.yaml
-f overrides/compose.mariadb.yaml
-f overrides/compose.redis.yaml
-f overrides/compose.https.yaml
config > ~/gitops/docker-compose.yml -
add to traefik volumes for self-signed certificates
- type: bind
source: /.certs
target: /certs
-
docker compose --project-name mysite -f ~/gitops/docker-compose.yml up -d
-
docker-compose --project-name mysite -f ~/gitops/docker-compose.yml exec backend bench new-site --no-mariadb-socket --mariadb-root-password ‘my_password’ --admin-my_another_password admin erp.mysite.com
-
docker-compose --project-name mysite-f ~/gitops/docker-compose.yml exec backend bench --site erp.mysite.com --install-app erpnext
Step 22 worked while installing steps from setp_operations followed by site_operations from frappe_docker docs, but fails with error in custom apps method.
Site is getting installed but apps are not.
Error stack trace:
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/caching.py”, line 57, in wrapper
return frappe.local.request_cache[func][args_key]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 34185387060134908
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 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/frappe/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 “/home/frappe/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 “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 783, 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 1595, 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 1567, in _load_app_hooks
app_hooks = get_module(f"{app}.hooks")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1433, 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 ‘erpnext’