Sample Header Ad - 728x90

Brew Upgrade Mysql: sdi_delete failed: Record Doesn't exist: tablespace_id: 1 Key: 1 4049

4 votes
1 answer
684 views
I ran the following commands from the cli in MacOS Monterey V 12.4:
brew update 
brew upgrade
Upon doing so, MySQL was upgraded from 8.0.30 to 8.0.31. MySQL was running in the background during the upgrade. MySql would not restart, so I rebooted the Mac as a first attempt to solve the issue. When I run
restart
I get the following list of messages:
2022-12-05T18:28:17.528347Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.31/bin/mysqld (mysqld 8.0.31) starting as process 19796
2022-12-05T18:28:17.530983Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2022-12-05T18:28:17.536857Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-12-05T18:28:17.756641Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-12-05T18:28:18.381834Z 4 [System] [MY-013381] [Server] Server upgrade from '80030' to '80031' started.
2022-12-05T18:28:29.775399Z 4 [Warning] [MY-011836] [InnoDB] sdi_delete failed: Record Doesn't exist: tablespace_id: 1 Key: 1 4049
2022-12-05T18:28:29.796888Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2018, 2022, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- Alters the sys_config table for upgrades -- ALTER TABLE sys_config CHARACTER SET utf8mb4; ' failed with error code = 3958, error message = 'Failed to delete sdi for sys.sys_config in sys/sys_config due to missing record.'.
2022-12-05T18:28:29.798728Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2022-12-05T18:28:29.798742Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-12-05T18:28:30.135378Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.31/bin/mysqld: Shutdown complete (mysqld 8.0.31)  Homebrew.
There are a few StackOverflow questions regarding the error sdi_delete failed: Record Doesn't exist: tablespace_id: 1 Key: 1 4049, but they all seem to be related to an attempted SQL command that is performed while the server is actually running.
The data directory
/usr/local/var/mysql
contains the following files:
#ib_16384_0.dblwr       ca-key.pem              private_key.pem
#ib_16384_1.dblwr       ca.pem                  public_key.pem
#innodb_redo            client-cert.pem         mysql               server-cert.pem
#innodb_temp            client-key.pem          mysql.ibd           server-key.pem
My-Mac.local.err        mysql_upgrade_info      ib_buffer_pool      sys
auto.cnf                ibdata1                 undo_001            undo_002
binlog.index            localhost.err           performance_schema
plus all the database names/data that I did not include in the list above. I have created a backup of the mysql directory and tried deleting the mysql_upgrade_info file, and the #innodb_redo directory, but that didn't help resolve the problem. What might I do to get the mysql server past the sdi_delete error so the upgrade will complete and the server will start?
Asked by Derrick (141 rep)
Dec 11, 2022, 03:34 AM
Last activity: Mar 4, 2025, 02:01 AM