Erpnext 14 Installation DEVELOPMENT & PRODUCTIONS [UBUNTU/SERVER 22.04]

Quote marks appear being changed from straight to curly quote marks.

It’s the style of single quote marks the risk for confusion, straight style being changed to curly style by the forum platform. But I’m not sure if it matters to report it or not?

@Usman_Ali I have some questions to clarify things, if you may:

  1. Can ERPNext be installed on Ubuntu desktop version?
  2. Can it work without internet access?

should be work in desktop. coz all requirements will be install on setup.
for installation u need internet connection. after Production up. as i know. after installation. should be no need of internet. but never try.

for internet. please any one can help?

Hi @Usman_Ali I think giving execution permission on the entire /home directory is a serious security issue.

I would suggest that instead of installing bench in /home/bench/, it is better to install it in the frappe user’s home directory i.e. /home/[frappe-user]/bench/

This way the entire /home directory is not exposed.

Hi @Usman_Ali , would you say line 1 here should be

Switch to unix_socket authentication [Y/n]?

image

Yes i forget. You can go through with yes or not. I tried both. It always works

Thank you!

1 Like

Please help us with SSL configuration instructions for local installation something like localerp.mydomain.com :pray:

Dear @Usman_Ali

I have used the same way that you used, but with every get-app I have got the same error.

$ supervisorctl restart frappe:
error: <class 'PermissionError'>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560
ERROR:
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/cli.py", line 127, in cli
    bench_command()
  File "/home/frappe/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/frappe/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/commands/make.py", line 159, in get_app
    get_app(
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 432, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 230, in install
    install_app(
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/app.py", line 577, in install_app
    bench.reload()
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/bench.py", line 150, in reload
    restart_supervisor_processes(bench_path=self.name, web_workers=web)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/bench.py", line 304, in restart_supervisor_processes
    bench.run(f"{sudo}supervisorctl restart {group}")
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/bench.py", line 47, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
  File "/home/frappe/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 155, in exec_cmd
    raise CommandFailedError
bench.exceptions.CommandFailedError

Even when I do bench restart I got the same error.

1 Like

After productions is up. if you want to add any other app. just go through with below setup to avoid
error: <class ‘PermissionError’>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560

===========================================

sudo su - frappe
cd /home/bench/frappe
sudo service supervisor stop
sudo service nginx stop
bench start

OPEN NEW SESSION

sudo su - frappe
cd /home/bench/frappe

bench get-app chat
make sure bench is runing in other terminal

bench get-app https://github.com/libracore/woocommerceconnector.git
make sure bench is runing in other terminal

bench get-app healthcare
make sure bench is runing in other terminal

bench get-app hospitality
make sure bench is runing in other terminal

bench --site site1.local install-app chat
make sure bench is runing in other terminal

bench --site site1.local install-app woocommerceconnector
make sure bench is runing in other terminal

bench --site site1.local install-app healthcare
make sure bench is runing in other terminal

bench --site site1.local install-app hospitality
make sure bench is runing in other terminal

bench use site1.local
bench migrate
sudo service supervisor start
sudo service nginx start
bench --site site1.local clear-website-cache

THANKS A LOT FOR THE POST.
IT WAS WORKING FINE BUT AFTER RESTART OF THE SERVER I AM GETTING THIS ERROR:

how many users are there. should be only 2 users. root and {Your User}
run again production command with exact second user. should be ok all

actually 3 user there root, frappe and ubuntu. it is on oracle cloud and we should not remove user ‘ubuntu’.
I run production command on ‘frappe’ user again but facing same problem.

install whole process with ubuntu. dont make/use frappe user

FINALLY, I FOUND THE PROBLEM: after ‘pwd’ there must be a space (browser is not showing it)

bench setup supervisor
sudo ln -s pwd /config/supervisor.conf /etc/supervisor/conf.d/frappe.conf​
sudo bench setup sudoers $(whoami)

1 Like

error in installing apps

An error occurred while installing hospitality: (1146, “Table ‘_2a66d27bcafdf54b.tabDefaultValue’ doesn’t exist”)
Traceback (most recent call last):
File “apps/frappe/frappe/utils/caching.py”, line 55, in wrapper
return frappe.local.request_cache[func][args_key]
KeyError: 5740354900026072187

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/utils/caching.py”, line 55, in wrapper
return frappe.local.request_cache[func][args_key]
KeyError: 6353385137041107217

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 413, in install_app
_install_app(app, verbose=context.verbose, force=force)
File “apps/frappe/frappe/installer.py”, line 256, in install_app
frappe.clear_cache()
File “apps/frappe/frappe/init.py”, line 877, in clear_cache
frappe.cache_manager.clear_user_cache()
File “apps/frappe/frappe/cache_manager.py”, line 89, in clear_user_cache
clear_global_cache()
File “apps/frappe/frappe/cache_manager.py”, line 102, in clear_global_cache
clear_website_cache()
File “apps/frappe/frappe/website/utils.py”, line 387, in clear_website_cache
clear_cache(path)
File “apps/frappe/frappe/website/utils.py”, line 382, in clear_cache
for method in frappe.get_hooks(“website_clear_cache”):
File “apps/frappe/frappe/init.py”, line 1489, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, _load_app_hooks))
File “apps/frappe/frappe/utils/redis_wrapper.py”, line 81, in get_value
val = generator()
File “apps/frappe/frappe/utils/caching.py”, line 57, in wrapper
return_val = func(*args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1454, in load_app_hooks
apps = [app_name] if app_name else get_installed_apps(sort=True)
File “apps/frappe/frappe/utils/caching.py”, line 57, in wrapper
return_val = func(*args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1421, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “[]”)
File “apps/frappe/frappe/database/database.py”, line 931, in get_global
return self.get_default(key, user)
File “apps/frappe/frappe/database/database.py”, line 935, in get_default
d = self.get_defaults(key, parent)
File “apps/frappe/frappe/database/database.py”, line 951, in get_defaults
defaults = frappe.defaults.get_defaults_for(parent)
File “apps/frappe/frappe/defaults.py”, line 219, in get_defaults_for
frappe.qb.from
(table)
File “apps/frappe/frappe/query_builder/utils.py”, line 76, in execute_query
return frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
File “apps/frappe/frappe/database/database.py”, line 209, in sql
self._cursor.execute(query, values)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, “Table ‘_2a66d27bcafdf54b.tabDefaultValue’ doesn’t exist”)

help

If you install exact as guide then should be no problem. It looks mariadb connection error. While the table is not exist. Uninstall the app and install again. Make sure bench is runing in other terminal

Just a tip. Sometimes. If you got error. Then try once more. If still get error then check the solution.

1 Like

Dear @Usman_Ali
The Installation worked perfectly and the site also running as expected. Now how we will update. The bench update or bench update --reset gives following error.

frappe@erpnext:/home/bench/frappe$ bench update --reset
ERROR: Command ‘basename $(git symbolic-ref -q HEAD)’ returned non-zero exit status 1.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.10/dist-packages/bench/cli.py”, line 127, in cli
bench_command()
File “/usr/lib/python3/dist-packages/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/commands/update.py”, line 59, in update
update(
File “/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py”, line 407, in update
validate_branch()
File “/usr/local/lib/python3.10/dist-packages/bench/utils/bench.py”, line 601, in validate_branch
branch = get_current_branch(app)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/app.py”, line 175, in get_current_branch
return get_cmd_output(“basename $(git symbolic-ref -q HEAD)”, cwd=repo_dir)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 214, in get_cmd_output
output = subprocess.check_output(
File “/usr/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘basename $(git symbolic-ref -q HEAD)’ returned non-zero exit status 1.