Docker erpnext: install ERPNext version 15 with Frappe version 14. This is not supported and will

You’re attempting to install ERPNext version 15 with Frappe version 14. This is not supported and will result in broken install. Switch to correct branch be

My apps.json

[
  {
    "url": "https://github.com/frappe/payments",
    "branch": "version-14"
  },
  {
    "url": "https://github.com/frappe/education",
    "branch": "develop"
  },
  {
    "url": "https://github.com/frappe/insights",
    "branch": "main"
  },
  {
    "url": "https://github.com/frappe/hrms",
    "branch": "version-14"
  },
  {
    "url": "https://github.com/frappe/erpnext",
    "tag": "v14.27.0"
  },
  {
    "url": "https://..@github.com/103DITECH/smartcrm.git",
    "branch": "main"
  },
  {
    "url": "https://..@github.com/103DITECH/smarthr.git",
    "branch": "main"
  }
]

My Docker build

docker build \
  --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
  --build-arg=FRAPPE_BRANCH=version-14 \
  --build-arg=PYTHON_VERSION=3.10.5 \
  --build-arg=NODE_VERSION=16.18.0 \
  --build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 \
  --tag=ABC/xyz:latest \
  --file=images/custom/Containerfile .
1 Like

Following json worked for me

[
  {
    "url": "https://github.com/frappe/payments",
    "branch": "version-14"
  },
  {
    "url": "https://github.com/frappe/education",
    "branch": "develop"
  },
  {
    "url": "https://github.com/frappe/insights",
    "branch": "v0.9.2"
  },
  {
    "url": "https://github.com/frappe/hrms",
    "branch": "v14.4.2"
  },
  {
    "url": "https://github.com/frappe/erpnext",
    "tag": "v14.27.0"
  }
]

Command:

docker build \                             
  --build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
  --build-arg=FRAPPE_BRANCH=v14.38.3 \
  --build-arg=PYTHON_VERSION=3.10.5 \
  --build-arg=NODE_VERSION=16.18.0 \
  --build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 \
  --tag=custom/image:latest \
  --file=images/custom/Containerfile .

I suggest keep erpnext before the dependencies are installed and try to use release tags instead of branches where possible.

Recommended json change:

[
  {
    "url": "https://github.com/frappe/payments",
    "branch": "version-14"
  },
  {
    "url": "https://github.com/frappe/insights",
    "branch": "v0.9.2"
  },
  {
    "url": "https://github.com/frappe/erpnext",
    "tag": "v14.27.0"
  },
  {
    "url": "https://github.com/frappe/education",
    "branch": "develop"
  },
  {
    "url": "https://github.com/frappe/hrms",
    "branch": "v14.4.2"
  }
]
1 Like

not work for me I followed yours.

You’re attempting to install ERPNext version 15 with Frappe version 14. This is not supported and will result in broken install. Switch to correct branch before installing.

Did you remove your custom apps?

It is working for the json I shared. I don’t get any errors. I removed your custom apps from json

No, I didn’t remove my custom app,

so I cannot use my custom app in the json?

Have you built the custom app using frappe develop branch?

You’ll need to either share the code of your custom app or create a repo that reproduce the error when installed so I try on my end.

Public apps are not causing the problem.

If they are error free they should work. I can use my custom apps.

Have you built the custom app using frappe develop branch?

Maybe yes, anyway we can check or we update the version of customer app accordingly.
( because my customer app just a very simple one)

After I reamoved my cutom app from app.json and build image, and

bench new-site abc.dt.com --mariadb-root-password StrongPassw0rd --install-app erpnext --admin-password StrongPassw0rd
Installing frappe...
Updating DocTypes for frappe        : [========================================] 100%
Updating country info               : [========================================] 100%
Updating Dashboard for frappe
Could not find app "erpnext": 
No module named 'erpnext'
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/caching.py", line 55, in wrapper
    return frappe.local.request_cache[func][args_key]
KeyError: -5779490757706972651

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 77, in new_site
    _new_site(
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 106, 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 262, in install_app
    app_hooks = frappe.get_hooks(app_name=name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1494, in get_hooks
    hooks = _dict(_load_app_hooks(app_name))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/caching.py", line 57, in wrapper
    return_val = func(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1466, in _load_app_hooks
    app_hooks = get_module(f"{app}.hooks")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1328, in get_module
    return importlib.import_module(modulename)
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'erpnext'
administrator@ditech1:~/gitops$

Make sure your sites/app.txt has all the apps

You can execute ls -1 apps > sites/apps.txt to add all apps from image to apps.txt

1 Like