I would love to remove the Not Secure notice in my browser for my local installation. Would this work for local installations too? I own the key and crt files, would it be simple to swap them out?
No the certbot will not work for localhost environment. Also it won’t really make sense as the localhost is accessible only on your system. If you still want to access localhost via https:// then you can try the mkcert
option as below;
@shashank_shirke or to anyone:
First of all thanks for this guide. I’ve been able to follow it all the way to Step 5.5 bench new-site.
I run into mariadb/mysql error "Access Denied . . ". Have read a few threads and i think it has something to do with not being able to invoke mysql (need to SUDO) because of Mariadb 10.6, but it is not clear how the problem is solved. Have tried the ff with no avail:
- Grant all Privileges to root (seems doesn’t make sense to me since root has all access, but nevertheless tried it, no avail same error)
- Created a new mysql user (Frappe), grant all privileges to it, specified it as the mariadb root user with password during BENCH NEW-SITE, no avail same error
Can you or someone please provide some insight as to how this was solved? Much thanks!
Chris
Hi @cphoa28
Which cloud service provider are you using? This is a commonly reported issue on AWS EC2 instances and Azure virtual machines. Primary reason being, both providers don’t allow actual root access and instead create a system user with sudo permissions.
In your case, which user are you logged into when running the mysql installation? You can run sudo -i
to enter as root user and then create a new user that has will be added to root group. Use this newly created user (with root privileges) to run the MySQL installation after which you should not get the access denied error when running bench new-site
Thanks,
Shashank
@shashank_shirke ,
Thanks for the quick reply!!
Yes, running on Digital Ocean Droplet.
Logged in as root but SU as frappe. Followed your instructions on creating that frappe user. I’ll figure out how to give it root privs and see if that will work.
Super thanks mate! Been tearing my hair out for 4 days now trying to make this work. Will update and see.
Chris
DigitalOcean works the best since they allow direct root access. You don’t need to do anything special to allow root privileges. Step 1.4 does it for you already.
Unfortunately, same error.
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
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
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
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.
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