Nextcloud snap on raspberry pi: mysql gets killed

Hi all, I have a Nextcloud server running as a snap on a raspberry pi with Ubuntu 20.04. Things were working fine for a long time (more than a year), but at this moment, it looks like the mysql server within the snap is not starting up anymore. When I run journalctl -u snap.nextcloud.mysql I get a list of sigkills (like ubuntu systemd[1]: snap.nextcloud.mysql.service: Killing process 871580 (mysqld) with signal SIGKILL.). Could this be a sign that my raspberry pi is running out of memory?

It’s hard to know without seeing the logs myself, but yes, potentially. Any chance you started running something new on there in addition to Nextcloud?

I have not been running new things on the raspberry pi. It’s basically the same set-up as last week, when the server was still working.

Nextcloud version: 24.0.6snap1
OS: Ubuntu 20.04.4 LTS
Hardware: Raspberry Pi 4 B (4G)

Does this help? (Thanks for looking into this).

mysql_errors.log:

Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0xffff24000b20
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = ffff377fd620 thread_stack 0x100000
/snap/nextcloud/31759/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x44) [0xaaaadbb574e4]
/snap/nextcloud/31759/bin/mysqld(print_fatal_signal(int)+0x2b4) [0xaaaadacf56fc]
/snap/nextcloud/31759/bin/mysqld(my_server_abort()+0xb0) [0xaaaadacf5880]
/snap/nextcloud/31759/bin/mysqld(my_abort()+0x14) [0xaaaadbb517f4]
/snap/nextcloud/31759/bin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x290) [0xaaaadbe41668]
/snap/nextcloud/31759/bin/mysqld(btr_cur_latch_leaves(buf_block_t*, page_id_t const&, page_size_t const&, unsigned long, btr_cur_t*, mtr_t*)+0x5d4) [0xaaaadbe80844]
/snap/nextcloud/31759/bin/mysqld(btr_cur_search_to_nth_level(dict_index_t*, unsigned long, dtuple_t const*, page_cur_mode_t, unsigned long, btr_cur_t*, unsigned long, char const*, unsigned long, mtr_t*)+0x127c) [0xaaaadbe8944c]
/snap/nextcloud/31759/bin/mysqld(btr_pcur_t::restore_position(unsigned long, mtr_t*, ut::Location)+0x1e4) [0xaaaadbe8ba04]
/snap/nextcloud/31759/bin/mysqld(+0x2140d50) [0xaaaadbda8d50]
/snap/nextcloud/31759/bin/mysqld(row_purge_step(que_thr_t*)+0x3a4) [0xaaaadbdac4b4]
/snap/nextcloud/31759/bin/mysqld(que_run_threads(que_thr_t*)+0xd78) [0xaaaadbd68140]
/snap/nextcloud/31759/bin/mysqld(srv_worker_thread()+0x354) [0xaaaadbddd05c]
/snap/nextcloud/31759/bin/mysqld(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Detached_thread, void (*)()> > >::_M_run()+0xe8) [0xaaaadbd04248]
/usr/lib/aarch64-linux-gnu/libstdc++.so.6(+0xbbe94) [0xffff9f202e94]
/lib/aarch64-linux-gnu/libpthread.so.0(+0x7088) [0xffff9f2e2088]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): is an invalid pointer
Connection ID (thread ID): 0
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2022-10-17T16:58:02.253989Z 0 [System] [MY-010116] [Server] /snap/nextcloud/31759/bin/mysqld (mysqld 8.0.30) starting as process 1120944
2022-10-17T16:58:02.309543Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-17T16:58:06.305154Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-17T16:58:07.083103Z 0 [Warning] [MY-013829] [Server] Missing data directory for ICU regular expressions: //lib/private/.
2022-10-17T16:58:07.085841Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-10-17T16:58:07.085963Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-10-17T16:58:07.092525Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
2022-10-17T16:58:07.152892Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /tmp/mysqlx.sock
2022-10-17T16:58:07.153206Z 0 [System] [MY-010931] [Server] /snap/nextcloud/31759/bin/mysqld: ready for connections. Version: '8.0.30'  socket: '/tmp/sockets/mysql.sock'  port: 0  Source distribution.
2022-10-17T16:58:07.153336Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.30).

Output from journalctl -u snap.nextcloud.mysql:

Oct 17 19:19:33 ubuntu systemd[1]: snap.nextcloud.mysql.service: State 'stop-sigterm' timed out. Killing.
Oct 17 19:19:33 ubuntu systemd[1]: snap.nextcloud.mysql.service: Killing process 1205066 (mysqld_safe) with signal SIGKILL.
Oct 17 19:19:33 ubuntu systemd[1]: snap.nextcloud.mysql.service: Killing process 1206815 (mysqld) with signal SIGKILL.
Oct 17 19:19:33 ubuntu systemd[1]: snap.nextcloud.mysql.service: Killing process 1206891 (mysqld) with signal SIGKILL.
Oct 17 19:19:51 ubuntu systemd[1]: snap.nextcloud.mysql.service: Failed with result 'timeout'.
Oct 17 19:19:52 ubuntu systemd[1]: snap.nextcloud.mysql.service: Scheduled restart job, restart counter is at 115.
Oct 17 19:19:52 ubuntu systemd[1]: Stopped Service for snap application nextcloud.mysql.
Oct 17 19:19:52 ubuntu systemd[1]: Started Service for snap application nextcloud.mysql.
Oct 17 19:19:52 ubuntu nextcloud.mysql[1207389]: Starting MySQL
Oct 17 19:19:52 ubuntu nextcloud.mysql[1207389]:  *
Oct 17 19:19:52 ubuntu nextcloud.mysql[1207293]: Waiting for MySQL...
Oct 17 19:19:57 ubuntu nextcloud.mysql[1207293]: done
Oct 17 19:20:01 ubuntu nextcloud.mysql[1208257]:  * MySQL server PID file could not be found!

(Sorry I don’t know yet how to hide big log files under a drop-down symbol on this forum).

Do you have any idea on the basis of the logs above? Thanks!