MySql crashes on startup - Snap installation

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

Tldr

MySql started crashing on startup. Given the error message the datatable is likely corrupted, see the log below. How can I reset/purge that.

I use Nextcloud only locally as a data storage with 2 users. So completely nuking the database is an option as long as my files stick around.

Running sudo nextcloud.export or sudo nextcloud.occ maintenance:mode --on doesn’t work because of mysql not starting.

The error message gives me this link https://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html however that is scary and I am not quite sure how to do that in snap.

2 questions.

  • What data does the database contain
  • Can I just snap uninstall nextcloud and start from scratch while maintaining my data

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 23.0.12snap1, I know that is old. But it kept running so there was no reason to change it.
  • Operating system and version (e.g., Ubuntu 24.04):
    • Linux Mint 19.1
  • When did this problem seem to first start?
    • I moved the server to a new router, so I changed the target IP address on my client. Started failing right away.
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • snap
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no, local only

Summary of the issue you are facing:

See the Logs, MySql crashes.

Log entries

MySql

2025-11-02T14:33:02.639380Z 0 [System] [MY-010931] [Server] /snap/nextcloud/33289/bin/mysqld: ready for connections. Version: '8.0.31'  socket: '/tmp/sockets/mysql.sock'  port: 0  Source distribution.
2025-11-02T14:33:03.123893Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: btr0cur.cc:285:btr_page_get_prev(get_block->frame, mtr) == page_get_page_no(page) thread 140298646705920
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2025-11-02T14:33:03Z UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=ec0f4cec275638b03b6929605fe1030d0e582494
Thread pointer: 0x7f99ac000b20
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 = 7f99d2ffca80 thread_stack 0x100000
/snap/nextcloud/33289/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x5592507b068d]
/snap/nextcloud/33289/bin/mysqld(print_fatal_signal(int)+0x3c3) [0x55924f7094d3]
/snap/nextcloud/33289/bin/mysqld(my_server_abort()+0x6e) [0x55924f7095ee]
/snap/nextcloud/33289/bin/mysqld(my_abort()+0xa) [0x5592507aa17a]
/snap/nextcloud/33289/bin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x2e9) [0x559250adcbd9]
/snap/nextcloud/33289/bin/mysqld(btr_cur_latch_leaves(buf_block_t*, page_id_t const&, page_size_t const&, unsigned long, btr_cur_t*, mtr_t*)+0x71f) [0x559250b2293f]
/snap/nextcloud/33289/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*)+0x18e5) [0x559250b2d4e5]
/snap/nextcloud/33289/bin/mysqld(row_search_index_entry(dict_index_t*, dtuple_t const*, unsigned long, btr_pcur_t*, mtr_t*)+0x146) [0x559250a3b4f6]
/snap/nextcloud/33289/bin/mysqld(+0x24b47e2) [0x559250a327e2]
/snap/nextcloud/33289/bin/mysqld(+0x24b5fd6) [0x559250a33fd6]
/snap/nextcloud/33289/bin/mysqld(row_purge_step(que_thr_t*)+0xf73) [0x559250a35b03]
/snap/nextcloud/33289/bin/mysqld(que_run_threads(que_thr_t*)+0xf50) [0x5592509e79d0]
/snap/nextcloud/33289/bin/mysqld(trx_purge(unsigned long, unsigned long, bool)+0x197) [0x559250a9c7b7]
/snap/nextcloud/33289/bin/mysqld(srv_purge_coordinator_thread()+0x13e2) [0x559250a6f602]
/snap/nextcloud/33289/bin/mysqld(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Detached_thread, void (*)()> > >::_M_run()+0xc4) [0x55925097a834]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xbd6df) [0x7f9a334476df]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f9a3391e6db]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f9a32b0474f]

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

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

"class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/AppInfo/Application.php","line":75,"function":"getAllConfiguredEvents","class":"OCA\\WorkflowEngine\\Manager","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":67,"function":"registerRuleListeners","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/BootContext.php","line":51,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/AppInfo/Application.php","line":67,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/Coordinator.php","line":181,"function":"boot","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/legacy/OC_App.php","line":206,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/legacy/OC_App.php","line":140,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/console.php","line":99,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/occ","line":11,"args":["/snap/nextcloud/33289/htdocs/console.php"],"function":"require_once"}],"File":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":101,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":2006,"Trace":[{"file":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1057,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/DB/Connection.php","line":237,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":345,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":287,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/Manager.php","line":164,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/AppInfo/Application.php","line":75,"function":"getAllConfiguredEvents","class":"OCA\\WorkflowEngine\\Manager","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":67,"function":"registerRuleListeners","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/BootContext.php","line":51,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/AppInfo/Application.php","line":67,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/Coordinator.php","line":181,"function":"boot","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/legacy/OC_App.php","line":206,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/legacy/OC_App.php","line":140,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/console.php","line":99,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/occ","line":11,"args":["/snap/nextcloud/33289/htdocs/console.php"],"function":"require_once"}],"File":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":"HY000","Trace":[{"file":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1057,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/DB/Connection.php","line":237,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":345,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":287,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/Manager.php","line":164,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/AppInfo/Application.php","line":75,"function":"getAllConfiguredEvents","class":"OCA\\WorkflowEngine\\Manager","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":67,"function":"registerRuleListeners","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/BootContext.php","line":51,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/apps/workflowengine/lib/AppInfo/Application.php","line":67,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/AppFramework/Bootstrap/Coordinator.php","line":181,"function":"boot","class":"OCA\\WorkflowEngine\\AppInfo\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/legacy/OC_App.php","line":206,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/legacy/OC_App.php","line":140,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/lib/private/Console/Application.php","line":119,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/snap/nextcloud/33289/htdocs/console.php","line":99,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/snap/nextcloud/33289/htdocs/occ","line":11,"args":["/snap/nextcloud/33289/htdocs/console.php"],"function":"require_once"}],"File":"/snap/nextcloud/33289/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":92}},"message":"Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","exception":{},"CustomMessage":"Could not boot workflowengine: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away"}}
1 Like

Hey @ChrisLend, welcome to the Nextcloud community and thanks for supporting Nextcloud snap :handshake:

Sorry to hear you are having issues with your Nextcloud snap installation. If you’ve come this far, you’re on the right track! There is a good chance someone in the community has had a similar issue and knows how to resolve it. That depends on how you request assistance. So read your request for tone, avoiding hyperbole and assuming good intentions.

In order to help you we’ll need some Information to get an Idea of your setup, so complete the required support template if you haven’t done so already or run the debugging script and post the result here.

Below are some links to how-to’s answering frequently asked questions and may help you help yourself;

that’s not what Nextcloud or Nextcloud snap were designed for… see here How to configure Nextcloud snap the first recommendation we make for a successful installation

yeah that’s old and no longer supported… sorry

if that’s an option, be sure to backup your raw data, also consider backing up your database see https://github.com/nextcloud-snap/nextcloud-snap/wiki/Export-and-Import

Depending on the type of failure you’ve experienced, there is a good chance of recovering your data. By default all the stuff you care about is in the /var/snap/nextcloud directory. So just copy the entire directory to another drive or machine. In the worst case you could lose your database, but at least you’ll preserve your raw data. Your data can be found in /var/snap/nextcloud/common/nextcloud/data if you haven’t changed your data directory. See where is my stuff.

Did you follow the mentioned link to find the reason or solution of corruption?

Thanks for the replies.

yeah that’s old and no longer supported… sorry

That is understandable. But I don’t think there would be a way to trace random database corruption to that version. It has been working flawlessly the last few years.

if that’s an option, be sure to backup your raw data

that’s what I will do next once more drives arrive. I already checked the files on disk and they are fine.

Did you follow the mentioned link to find the reason or solution of corruption?

I did check the link but it doesn’t help me figure out where exactly the problem is. Also the warning basically tells me that my DB is toast and I’d better be off rebuilding it.

I ran the debug script but I cannot post it here since I cannot upload txt files and the output is over the character limit.

yeah that’s difficult inside the snap,

that’s how it is with old things, they work fine until they break and then they’re hard to fix because people forget how the old stuff worked…

but can you recall what you did prior to your failure? if you could post your app list it would be great, but if the snap isn’t starting we’re in a bad state… I’ve checked known issues to no avail

if you’d like to give this a try… database maintenance but if the database doesn’t start up there’s no way to access via mysql client

that sounds promising and probably your best option and it would be great if you opt for the snap again as your support keeps us going :star_struck:

Your MySQL inside the Nextcloud snap is corrupted that crash log confirms it. The DB only stores users, shares, and settings; your actual files are safe in /var/snap/nextcloud/common/nextcloud/data.

Easiest fix: back up that data folder, nuke Nextcloud, reinstall, and rescan files:

sudo snap stop nextcloud
sudo cp -r /var/snap/nextcloud/common/nextcloud/data ~/nextcloud_backup
sudo snap remove nextcloud --purge
sudo snap install nextcloud
sudo nextcloud.occ files:scan --all

That gives you a clean slate without losing files.

If you really want to try fixing the DB, you can enable InnoDB recovery mode inside the snap, but it’s messy and not worth it for a local setup.

For deeper recovery later, you could try Stellar Repair for MySQL — it sometimes fixes corrupted tables.

1 Like