Plugin 'auth_socket' is not loaded. Error during site creation

Have installed bench using the instructions on github. When I try to create a site, it asks to set a MySQL root password. After entering the password it gives the following error:

mt frappe-bench $ bench new-site site1.local
MySQL root password:
Traceback (most recent call last):
File “/home/mt/miniconda3/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/home/mt/miniconda3/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/mt/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/mt/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/mt/frappe-bench/apps/frappe/frappe/commands/site.py”, line 33, in new_site
db_type = db_type)
File “/home/mt/frappe-bench/apps/frappe/frappe/commands/site.py”, line 66, in _new_site
source_sql=source_sql,force=force, reinstall=reinstall, db_type=db_type)
File “/home/mt/frappe-bench/apps/frappe/frappe/installer.py”, line 35, in install_db
setup_database(force, source_sql, verbose)
File “/home/mt/frappe-bench/apps/frappe/frappe/database/init.py”, line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)
File “/home/mt/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 13, in setup_database
if force or (db_name not in dbman.get_database_list()):
File “/home/mt/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 58, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/mt/frappe-bench/apps/frappe/frappe/database/database.py”, line 121, in sql
self.connect()
File “/home/mt/frappe-bench/apps/frappe/frappe/database/database.py”, line 74, in connect
self._conn = self.get_connection()
File “/home/mt/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 87, in get_connection
local_infile = frappe.conf.local_infile)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/init.py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 325, in init
self.connect()
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 599, in connect
self._request_authentication()
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 861, in _request_authentication
auth_packet = self._read_packet()
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/mt/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1524, “Plugin ‘auth_socket’ is not loaded”)

Facing this issue also with the manual setup instructions on this article

Have you set the mysqld parameters to be something like this…
…use the Barracuda storage enginein the DB’s my.cnf

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4

Also check the DB password

After inserting above codes restart your db with following commands:

  • sudo systemctl restart mariadb

  • sudo systemctl enable mariadb

Sorry I tried both. Doesn’t seem to be working. Is there a MySQL root password being set by the installation? I don’t think I have ever set one myself.

I am looking to install a stable version of ERPNext for testing but am unable to install it manually. Would appreciate any help.

To clarify I’m trying to install this on my existing ubuntu machine - its not bare shell. Is this known to cause issues?

Can you list down what are the steps have you done till now…further i can help you.

I have followed the steps for manual install with prerequesites and hitchhikers guide to installing frappe on linux (separately).

Both times bench is installing fine and bench --version shows 4.1.0

When I try to create a new site, it first asks for the MySQL root password and then throws this exception.

Did you give the password for mariadb on install mariadb command.

I just tried uninstalling and reinstalling mariaDB and setting the root password again at startup. I get this error:

Checking service mysql status gives me this:

Try this…

      DBname=$(cat ~/frappe-bench/sites/site1.local/site_config.json | awk '/db_name/ {print $2}' | sed "s/\"//g" | sed "s/,//g")
      DBpass=$(cat ~/frappe-bench/sites/site1.local/site_config.json | awk '/db_password/ {print $2}' | sed "s/\"//g")
      #
      mysql -uroot -pMYSQLROOTPassword -Bse "GRANT ALL PRIVILEGES ON *.* TO '$DBname'@'localhost' IDENTIFIED BY '$DBpass' WITH GRANT OPTION;"
      mysql -uroot -pMYSQLROOTPassword -Bse "GRANT ALL PRIVILEGES ON *.* TO '$DBname'@'127.0.0.1' IDENTIFIED BY '$DBpass' WITH GRANT OPTION;"
      #
      mysql -uroot -pMYSQLROOTPassword -Bse "set password for '$DBname'@'localhost' = password('$DBpass');"
      mysql -uroot -pMYSQLROOTPassword -Bse "set password for '$DBname'@'127.0.0.1' = password('$DBpass');"
      #then delete the DB and re-run
      bench new-site site1.local

Thanks for sharing. Unfortunately, getting the same error on step 3 and 4:

Is there any other documentation that I am missing?

let me help with the steps where are you lagging kindly tell me in which command are you stuck?

I am able to install bench fine. I get stuck when trying to create a site. As soon as it asks for the mysql password, no matter what I put I get the error pymysql.err.InternalError: (1524, “Plugin ‘auth_socket’ is not loaded”)

Based on what I have found so far, it appears that the mariadb root password is not being set. Also service mysql status shows some errors and warnings.

Is there a dependency / step that installs / loads this plugin auth_socket that seems to be causing the error?

On installation of mariadb did it asked for any password ? I think it the password would be root.

Yes it asked for a password. However when trying to set it I got an error

So it seems like the password was not set.

In any case I have also tried using ‘root’ as the password, but keep getting the auth_socket not loaded error. I don’t think it is related to the password being wrong as it would say that in that case.

Kindly follow this link will help you out linux - MySQL fails on: mysql "ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded" - Stack Overflow

After about 4 days of trial and error, have finally managed to install bench, frappe and erpnext on my ubuntu machine. Finally what seemed to do the trick was purging mysql, mariadb and all their dependencies and reinstalling those packages before trying again.

There is one inconsistency between the documentation in the 2 articles, one asks for bench to be started BEFORE creating the new site and the other seems to imply that bench does not need to be started until after the sites are created. When it worked for me, I had started bench before creating the site. If someone can reconfirm which approach is “correct”, I can make a pull request to update the docs.

Thank you @trentmu, @arokia for your help with this. Even though in the end it turns out this was probably an issue with my local system, both of you definitely helped push me in the right direction to solve it!

Just for the record…
the commands I listed included
mysql -uroot -pMYSQLROOTPassword.....

You would have had to change the “MYSQLROOTPassword” to match your actual password to get those commands to work correctly :slight_smile:

Yes, I figured that out :grinning:

You are welcome…this is a community where you can get solution… :v: