Error on New Installation

Hello,

I’ve made a brand new installation and have performed it more than 8 times on my VPS trying to have it working. i had to use the following commands in order to successfully install bench:
sudo -H pip install python-ldap
./env/bin/pip install -e ./apps/frappe

once fully installed, i try accessing the front end, and get to the login, i put my credentials and follow the steps to get the Internal server error Page. the only way to get back to the home page is to restart my droplet VPS.

so i went to my command line to check what’s going on wrong and tried to do a Bench Update so i start getting the following error after patching site and migrating.
Backing up sites…
Patching sites…
Migrating site1.local
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, 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/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 24, in run_all
executed = [p[0] for p in frappe.db.sql(“”“select patch from tabPatch Log”“”)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 123, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 69, in connect
use_unicode=True, charset=‘utf8mb4’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 86, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 204, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, ‘Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111 “Connection refused”)’)
root@ubuntu-512mb-fra1-01:/home/frappe/frappe-bench# bench restore
Usage: bench restore [OPTIONS] SQL_FILE_PATH

Error: Missing argument “sql-file-path”.

Kindly advise!

Thank you

please check your mysql is running or not

Thanks

Dear Sagar,

Thank you for your prompt response

Mysql is running on reboot, but once i do an operation online it hangs apparently and get the internal server error

This is the status of mysql after reboot.

root@ubuntu-512mb-fra1-01:~# mysqladmin -u root -p status
Enter password:
Uptime: 50 Threads: 1 Questions: 159 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 27 Queries per second avg: 3.180.

Once i perform any action on site on the frontend i get the mysql crashing more probably. even the same thing happens while doing bench Update

below is the mysql status after operation:

root@ubuntu-512mb-fra1-01:~# mysqladmin -u root -p status
Enter password:
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111 “Connection refused”)’
Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!

Try restarting it manually:

sudo systemctl status mysql
sudo systemctl stop mysql
sudo systemctl start mysql

1 Like