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

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)

2 Likes

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.

Same issue with me when trying to update phew!!

I’m glad it’s not a unique issue.

Please help :pray:

:boom: BENCH UPDATE :boom:

After productions is up. Update the Bench

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

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 update --reset
sudo service supervisor start
sudo service nginx start
bench --site site1.local clear-website-cache

are you sure that works when you add space?

I just install a new installation. and got file not error.

Guys please avoid to miss leads. we already have troubles since years to install flawless erpnext.

Thanks All

Thank you @Usman_Ali

Same issue, though, after bench update --reset (while having another session running with bench start)

frappe@erpserver:/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.

Please help!

how. ?? sorry I didn’t understand that only one terminal work

Final installation steps should be done with 2 terminal sessions open (like image below)

I imagine this is what he means.

U stopped supervisor and nginx?

Thank you, yes, both. Tried a couple of times, same issue with my original installation:

image

Would you recommend I back up (something, don’t know what), start a new fresh 14.0.2 installation from scratch and restore?

Install with develop versions. If you want to update frequently. Check dev version installation

Well, I was hoping for a standard production setup, while being able to update it for security and stability issues, as updates are released by the developers.

Which would you say is my most direct path to achieve this?

Dear @Usman_Ali
Thank you for the update. I have followed the steps as mentioned in the bench update but not working and giving the same issue. Attached the screen shot. Is this due to any permission issue?

install dev versions