Mariadb silently restarting

I need help, Maiadb is constantly restarting and the ERPNext web page puts out the bong of death when ever a query fails. I need to get an “uncorrupted??” database working again, and then hopefully start upgrading it.

When I try to restore the new data into a working backup VM, I get errors. Is there a simple tutorial that I can follow somewhere?

Thanks

version 12, ubuntu 18

Can you share some additional details?

  • Do the log files indicate why MariaDB is restarting?
  • Is there sufficient CPU, Memory, and Disk Space on the host?
  • You mentioned errors while restoring a backup. What kind of errors?

I’ve been using MariaDB a long time. Though I’ve had my share of problems with it, automatic restarts is not one of them.

2 Likes

Hi Brian,
This is what I get in the syslog:
Sep 5 19:27:54 ubuntu systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
Sep 5 19:27:54 ubuntu systemd[1]: mariadb.service: Unit entered failed state.
Sep 5 19:27:54 ubuntu systemd[1]: mariadb.service: Failed with result ‘signal’.
Sep 5 19:27:59 ubuntu systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.

I’ve tried increasing memory & CPU’s and no luck.

I increased a few settings as per mysql - 10.1.31-MariaDB keeps restarting no errors nor warnings - Database Administrators Stack Exchange, But still doing the same thing

Here are the errors when trying to do a restore:
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, 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.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/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 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 129, in restore
force=context.force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 86, in _new_site
db_password=db_password, db_type=db_type, db_host=db_host, db_port=db_port, no_mariadb_socket=no_mariadb_socket)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 35, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File “/home/frappe/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, no_mariadb_socket=no_mariadb_socket)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 43, in setup_database
dbman.drop_database(db_name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 45, in drop_database
self.db.sql(“DROP DATABASE IF EXISTS %s;” % target)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 171, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 657, in _read_packet
packet_header = self._read_bytes(4)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 707, in _read_bytes
CR.CR_SERVER_LOST, “Lost connection to MySQL server during query”)
pymysql.err.OperationalError: (2013, ‘Lost connection to MySQL server during query’)

Hi,

Does sudo journalctl -u mariadb.service return anything that might help diagnose the problem?

As best I can tell, this link is your same issue (status=6/ABRT)

https://jira.mariadb.org/browse/MDEV-29380

From what I’m reading in there, they fixed this beginning with MariaDB 10.6.10 and onward.

I know this will sound extremely cliché (and I personally cringe when I hear people flippantly give this advice). But with that said…you may want to upgrade your MariaDB to a newer release. And see if that makes any difference at all.

For what it’s worth, I have an acquaintance who’s been running ERPNext v12 on MariaDB version 10.6.7 for many years, with reliability and stability (:fist: :wood: )

1 Like

It seems everything is just out of date. Ubuntu 18, MariaDB 10.2, ERPNext 12. I can’t seem to update anything due to dependencies. I got it working again by bringing up an older VM and updating it from Backup. What I now think I need to do is start building an ERPNext 12 VM on a newer Ubuntu so I can update everything, and then get an ERPNext 13 VM, then a 14 VM, and hopefully get to ERP 15 and then maybe actually keep things updated.

Does anyone need a consulting job? This really isn’t my job scope.