[Guide] How to install ERPNext v14 on Linux Ubuntu (step-by-step instructions)

@shashank_shirke

Unfortunately, same error. :frowning:

Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/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
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 74, in new_site
_new_site(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 75, in _new_site
install_db(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 151, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py”, line 20, in setup_database
return frappe.database.mariadb.setup_db.setup_database(
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 41, in setup_database
if force or (db_name not in dbman.get_database_list()):
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 49, in get_database_list
return self.db.sql(“SHOW DATABASES”, pluck=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 190, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 115, in connect
self._conn = self.get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 90, in get_connection
conn = self._get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 96, in _get_connection
return self.create_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 99, in create_connection
return pymysql.connect(**self.get_connection_settings())
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 353, in init
self.connect()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 633, in connect
self._request_authentication()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 907, in _request_authentication
auth_packet = self._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, “Access denied for user ‘frappe’@‘localhost’ (using password: YES)”)

Any other clues?

Chris

@shashank_shirke

Ran without specifying frappe as user, this is what i get. Same error, root as user:

frappe@APD-PROD01:~/frappe-bench$ bench new-site site1.local
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/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
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 74, in new_site
_new_site(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 75, in _new_site
install_db(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 151, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py”, line 20, in setup_database
return frappe.database.mariadb.setup_db.setup_database(
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 41, in setup_database
if force or (db_name not in dbman.get_database_list()):
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 49, in get_database_list
return self.db.sql(“SHOW DATABASES”, pluck=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 190, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 115, in connect
self._conn = self.get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 90, in get_connection
conn = self._get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 96, in _get_connection
return self.create_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 99, in create_connection
return pymysql.connect(**self.get_connection_settings())
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 353, in init
self.connect()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 633, in connect
self._request_authentication()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 907, in _request_authentication
auth_packet = self._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1698, “Access denied for user ‘root’@‘localhost’”)

Chris

If you want to install SSL on localhost, follow this tutorial, it helped me.

You must reset the MySQL password, I executed the steps described in the following guide depending on the version I had installed on my machine and I was able to continue with the installation.

https://devanswers.co/how-to-reset-mysql-root-password-ubuntu/

@Leo_Sarmiento
I had to follow same instructions for MariaDB instead of MySql, and miraculously, IT WORKED!!! I can now continue the install!

For some reason even if you set a password for root during MariaDB install, it somehow doesn’t take it???

Furthermore you have to set to safe mode to actually change the root password.

Anyway, super thanks for this!! I can continue the install now.

@shashank_shirke
Suggest to include this little tidbit in your instructions in case someone else encounters it.

Chris

1 Like

Ran into this error isntall HRMS onto my site:

pdating DocTypes for hrms : [========================================] 100%

Patching Existing Data…
An error occurred while installing hrms: Error 111 connecting to localhost:13000. Connection refused.
Traceback (most recent call last):
File “env/lib/python3.10/site-packages/redis/connection.py”, line 559, in connect
sock = self._connect()
File “env/lib/python3.10/site-packages/redis/connection.py”, line 615, in _connect
raise err
File “env/lib/python3.10/site-packages/redis/connection.py”, line 603, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused

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 299, in install_app
frappe.get_attr(after_install)()
File “apps/hrms/hrms/setup.py”, line 19, in after_install
run_post_install_patches()
File “apps/hrms/hrms/setup.py”, line 654, in run_post_install_patches
frappe.get_attr(f"hrms.patches.post_install.{patch_name}.execute")()
File “apps/hrms/hrms/patches/post_install/rename_stop_to_send_birthday_reminders.py”, line 10, in execute
rename_field(“HR Settings”, “stop_birthday_reminders”, “send_birthday_reminders”)
File “apps/frappe/frappe/model/utils/rename_field.py”, line 55, in rename_field
update_user_settings(doctype, old_fieldname, new_fieldname)
File “apps/frappe/frappe/model/utils/rename_field.py”, line 166, in update_user_settings
sync_user_settings()
File “apps/frappe/frappe/model/utils/user_settings.py”, line 49, in sync_user_settings
for key, data in frappe.cache().hgetall(“_user_settings”).items():
File “apps/frappe/frappe/utils/redis_wrapper.py”, line 177, in hgetall
value = super().hgetall(self.make_key(name))
File “env/lib/python3.10/site-packages/redis/client.py”, line 3014, in hgetall
return self.execute_command(‘HGETALL’, name)
File “env/lib/python3.10/site-packages/redis/client.py”, line 898, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File “env/lib/python3.10/site-packages/redis/connection.py”, line 1192, in get_connection
connection.connect()
File “env/lib/python3.10/site-packages/redis/connection.py”, line 563, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:13000. Connection refused.

Any clue?

Chris

Are you in production or development mode?

I set it to production.

You can ignore that message.
You can check if the HRMS app was correctly fetched by running

bench version --format table

I am able to install the ERPNext v14 successfully, but after installation, I am not able to access the welcome page. I was wondering last week I try the same above steps and was working fine. But today I tried the install I am not able to see the welcome screen. Any help would be appreciated. Thank you

I don’t understand the different with develop mode and production mode

If at step 6.1 and step 6.2
Instead of :
bench get-app --branch version-14 erpnext

bench --site site1.local install-app erpnext

by :
bench get-app erpnext --branch version-14
bench --site site1.local install-app erpnext

If I do that, can I install production mode of ERPNext? and then I can skip step 7 ?

Hi @vinodjp

What error are you seeing on the welcome page? Please share a screenshot of the error that you’re seeing. Also, make sure that the correct ports are open in your firewall settings.

Hi @Nguyen_Quoc_Dat

When you run bench get-app, you’re essentially pulling in the app from a particular GitHub repo and a particular branch within that repo. By default master branch will be fetched.

Regarding production mode and development mode, that is related to how you setup your server. In development mode, you have to manually start and stop the bench server, whereas in production mode all the processes are autorun by a manager service called Supervisor and NGINX server is configured to serve the site.

Both are conceptually different things: Code Branch vs Server Setup

Continuing the discussion from [Guide] How to install ERPNext v14 on Linux Ubuntu (step-by-step instructions):

the python3.10-dev package is not in the 20.04 repo. Upgrade to 22.04 or find a way to install the package. I ran into this error bc I though a was on Ubuntu 22.04 but it was 20.04

The only issue that happened was during the installation of the APPs (Step6). Any help solving the problem is greatly apricated.

WARN Cannot connect to redis_cache to update assets_json
WARN Cannot connect to redis_cache to update assets_json
WARN Cannot connect to redis_cache to update assets_json

Hi @giga

Please try the below;

Login as [frappe-user] and edit the following file.

sudo nano /etc/supervisor/supervisord.conf

Add the code line below (chown) to grant permission to [frappe-user]

[unix_http_server]
file=/var/tmp/supervisord.sock
chmod=0700
chown=frappe:frappe

This should fix the issue.

1 Like

[fixed]

Firstly, I’m a newbie, this is only the second application I’ve installed on my server lol

Anyway, I believe my install was successful, however when I attempt to access it by going to [server-ip]:80 much of the javascript and css does not load properly and I am unable to log in. I can’t post the inspector log here, but basically I get several 404 errors for .js files and a few .css files.

For anyone else, I just restarted my server and reran some of step 6 and 7 and it seeeeems to work now. Still have some issues though (see below)

On signup, I’m getting this issue in my inspector while the page hangs on “verifying.” Might this be a port forward issue?

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 66, in application
response = frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1585, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/core/doctype/user/user.py”, line 859, in sign_up
user.insert()
File “apps/frappe/frappe/model/document.py”, line 281, in insert
self.run_post_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1087, in run_post_save_methods
self.run_method(“on_update”)
File “apps/frappe/frappe/model/document.py”, line 928, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1268, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1250, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 925, in fn
return method_object(*args, **kwargs)
File “apps/frappe/frappe/core/doctype/user/user.py”, line 124, in on_update
self.send_password_notification(self.__new_password)
File “apps/frappe/frappe/core/doctype/user/user.py”, line 264, in send_password_notification
self.send_welcome_mail_to_user()
File “apps/frappe/frappe/core/doctype/user/user.py”, line 335, in send_welcome_mail_to_user
self.send_login_mail(
File “apps/frappe/frappe/core/doctype/user/user.py”, line 367, in send_login_mail
frappe.sendmail(
File “apps/frappe/frappe/init.py”, line 708, in sendmail
builder.process(send_now=now)
File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 656, in process
queue_data = self.as_dict(include_recipients=False)
File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 697, in as_dict
mail = self.prepare_email_content()
File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 625, in prepare_email_content
sender=self.sender,
File “apps/frappe/frappe/email/doctype/email_queue/email_queue.py”, line 523, in sender
return email_account.default_sender
AttributeError: ‘NoneType’ object has no attribute ‘default_sender’

Hi @echoiguess

If you’re facing a broken CSS issue on your login page then follow the instructions (step 2) in this post :point_down:

for anyone else having issues with python3.10 and this error module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

install python3.10 using the guide here Install Python 3.10

OpenSSL error lib has no attribute can be resolved by;

sudo apt update
sudo apt upgrade

pip install pip --upgrade
pip install pyopenssl --upgrade