ERPNext installation issues Ubuntu 20.04

Next command, by following the tutorial, was: bench new-site dcode.com
That rendered this error:

Let’s set-up that character_set and collation_server! (again).

Error, again!

Summary

ERROR:
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 121, in cli
raise e
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 111, in cli
bench_command()
File “/usr/lib/python3/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/commands/make.py”, line 142, in get_app
get_app(
File “/usr/local/lib/python3.8/dist-packages/bench/app.py”, line 371, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/app.py”, line 198, in install
install_app(
File “/usr/local/lib/python3.8/dist-packages/bench/app.py”, line 436, in install_app
bench.reload()
File “/usr/local/lib/python3.8/dist-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/bench.py”, line 142, in reload
restart_supervisor_processes(bench_path=self.name, web_workers=web)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/bench.py”, line 280, in restart_supervisor_processes
bench.run(f"{sudo}supervisorctl restart {group}")
File “/usr/local/lib/python3.8/dist-packages/bench/bench.py”, line 43, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/init.py”, line 126, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

I’ve removed site (bench drop-site …)
tried again, just errors and errrors.

Can someone help me out here, why I get errors, I followed the tutorial: ERPNext-installation-Guide The complete guide to install ERPNext in your Ubuntu system
Still, I don’t have ERPNext running in production.

Have you created a currentsite.txt file with your site name?

That what I kept missing when I first started installing ERPNext.

1 Like

Thank you for reply, I’ll try with that, after I do a new Ubuntu install.
Things get messy when bench starts to spit random errors, so, new OS, ahoy.

dCodE has the best guide. So you came to right place.

Just follow the steps exactly and it will work.

I recommend a development bench to start with as it is easier to troubleshoot configuration problems.

Regarding the MariaDB encoding, be sure to restart MariaDB after the configuration changes.

The currentsite.txt file is important to tell bench which site to serve.

dCodE’s guide is this one: ERPNext-installation-Guide The complete guide to install ERPNext in your Ubuntu system ?
If I start development bench, can I easily switch to production?
I’ve been able to start dev bench following the tutorial from first post, but not the production one.
Yes, I’ve restarted the MariaDB after editing the /etc/mysql/my.cnf

Yes ofcourse you can switch to production easily. However, bare in mind it is less straightforward to switch back to development from production - as far as I know.

1 Like

So after the

bench --site dcode.com install-app erpnext

(in step 15 on: GitHub - D-codE-Hub/ERPNext-installation-Guide: The complete guide to install ERPNext in your Ubuntu system )

I’ve done:
cd [bench directory]/sites/

sudo touch currentsite.txt
sudo nano currentsite.txt
and enter just your site name for example: site1.local
ctrl+s and ctrl-x

Then
bench --site [sitename] set-config maintenance_mode 0
bench start

Login screen: ↓

Summary

So, for production version I need to follow STEP 16 and, as it says, “Follow the steps from Step 12 to Step 15”, again?
Can I use the same site name as for the dev bench, or can I “transform” the existing dev to the production?

If you really get stuck, wipe the server and start over with Debian v10 (buster)

Then try this set of instructions:

I am still using this myself.

As always… Your Mileage May Vary! :sunglasses:

BKM

1 Like

Production bench, error, after the bench restart:

Summary

dcode-frappe@erp:~/frappe-bench$ sudo bench restart
$ supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
ERROR:
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 121, in cli
raise e
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 111, in cli
bench_command()
File “/usr/lib/python3/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/lib/python3/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/lib/python3/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python3/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python3/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/commands/utils.py”, line 29 , in restart
Bench(“.”).reload(web, supervisor, systemd)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/bench.py”, line 142, in rel oad
restart_supervisor_processes(bench_path=self.name, web_workers=web)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/bench.py”, line 280, in restart_supervisor_processes
bench.run(f"{sudo}supervisorctl restart {group}")
File “/usr/local/lib/python3.8/dist-packages/bench/bench.py”, line 43, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/init.py”, line 12 6, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

On port 80:

After restart of Ubuntu virtual machine, and after bench start, ERPNext faced this issue:


After more than 12 hours straight dealing with installation, my mind is unable to process this user permission issue.
If someone can help, don’t hesitate, surely I’d be grateful.

Which username did you use to setup production?

bench restart is supposed to be run without sudo using the same user you have configured for production.

If you configured frappe as a user for production, you to have to switch to that user before running any bench commands.

To switch to frappe user run the following command:

su - frappe

For experimental production setup I recommend the same user you normally use.

1 Like

bench start is only used for a development bench.

Use this command to check the status of a production bench

sudo supervisorctl status

To restart the bench

bench restart

You do not need to convert existing sites to production, just enabling bench production will allow it to serve the sites directly.

Easy Install Script still works. Why don’t you try that?

Currently I get few problems with easy install script which I mention here. I also mention workarounds.

https://github.com/frappe/bench/issues/1290

1 Like

Thank you, very much!
I’ve managed to install ERPNext on (currently) latest Debian 11.
Hints for installing ERPNext on Debian 11:

  • before this part (first step) →

Just type: su
hit enter and and enter the pass for root, as Debian 11 locks-out root access via SSH by default and if your user acc is not in sudoers or wheel group.
If any command you enter is not recognized, use sudo.

Hello I’m using the easy install but getting this error, any help. I’m running sudo python3 install.py --production with Frappe user with sudo priviledges
Traceback (most recent call last):
File “/root/install.py”, line 497, in
install_bench(args)
File “/root/install.py”, line 278, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “/root/install.py”, line 413, in run_playbook
success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.9/subprocess.py”, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

Try running it without sudo.

Hi, @why!

I came back to ERPNext, I once installed year ago with no problem (I think it was v11)… now I came back trying to install v13 following official guides Installation and they are maybe just for ERPNext gurus or the guides havent been tested… its a pitty it makes it really hard to get started on Ubuntu 20.04 LTS ERPNextr 13. Will keep trying…

1 Like

on a clean ubuntu 20.04 installation try the following tutorial

would take a little more time than the easy install script… but would work without errors…