Please, how to fix this error, it happened after the supervisor crash during the update

Backing up sites…
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 294, in backup
odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, force=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 172, in scheduled_backup
odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 182, in new_backup
odb.get_backup(older_than, ignore_files, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 48, in get_backup
self.set_backup_file_name()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 63, in set_backup_file_name
todays_date = now_datetime().strftime(’%Y%m%d
%H%M%S’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 121, in now_datetime
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 144, in convert_utc_to_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 138, in get_time_zone
return frappe.cache().get_value(“time_zone”, _get_time_zone)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 132, in _get_time_zone
return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 889, in get_system_setting
return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 888, in _load_system_settings
return self.get_singles_dict(“System Settings”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 559, in get_singles_dict
tabSingles where doctype=%s""", doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 136, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 86, in connect
charset=‘utf8mb4’, use_unicode = True, conv = conversions)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/init.py”, line 90, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 704, in init
self.connect()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1005, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on u’localhost’ ([Errno 111] Connection refused)”)

Try restarting your mysql server.

hi @Levisir You can also check the MariaDB error logs.

Is this happening on the server? If yes, how much RAM do you have?

Thank you for your help.

smic@smicg:/home/frappe/frappe-bench$ service mysqld stop
smic@smicg:/home/frappe/frappe-bench$ service mysqld start
Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.
smic@smicg:/home/frappe/frappe-bench$ service mysqld status
● mariadb.service - MariaDB 10.2.15 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since Wed 2018-06-06 09:56:59 CET; 14s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 13475 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 13189 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=/usr/bin/galera_recovery; [ $? -eq 0 ] && syste
Process: 13185 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 13184 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 13475 (code=exited, status=1/FAILURE)
Status: “MariaDB server is down”

Jun 06 09:56:55 smicg systemd[1]: Starting MariaDB 10.2.15 database server…
Jun 06 09:56:56 smicg mysqld[13475]: 2018-06-06 9:56:56 140662751652032 [Note] /usr/sbin/mysqld (mysqld 10.2.15-MariaDB-10.2.15+maria~xenial-l
Jun 06 09:56:56 smicg mysqld[13475]: 2018-06-06 9:56:56 140662751652032 [Warning] Could not increase number of max_open_files to more than 163
Jun 06 09:56:56 smicg mysqld[13475]: 2018-06-06 9:56:56 140662751652032 [Warning] Changed limits: max_open_files: 16364 max_connections: 500
Jun 06 09:56:59 smicg systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jun 06 09:56:59 smicg systemd[1]: Failed to start MariaDB 10.2.15 database server.
Jun 06 09:56:59 smicg systemd[1]: mariadb.service: Unit entered failed state.
Jun 06 09:56:59 smicg systemd[1]: mariadb.service: Failed with result ‘exit-code’.
lines 1-22/22 (END)

try these commands.

sudo mysqld --tc-heuristic-recover=ROLLBACK

and then

sudo service mysqld start

it’ll work

3 Likes

Very good, thank you, it’s work