Error
Error Code: 1617

MariaDB Error 1617: Master Info Structure Missing

📦 MariaDB
📋

Description

This error indicates that the MariaDB server cannot find or access the necessary replication metadata, often stored in the `master.info` file or within system tables. It typically occurs in a replication setup where a replica server attempts to connect to a master or resume replication but lacks the crucial information about its master. This prevents the replica from establishing or continuing its replication stream.
💬

Error Message

The master info structure does not exist
🔍

Known Causes

4 known causes
⚠️
Missing Master Info File
The `master.info` file, which stores replication connection details, has been accidentally deleted, corrupted, or was never created on the replica server.
⚠️
Improper Replication Configuration
The replica server was not correctly configured for replication, or the `CHANGE MASTER TO` command was never executed or failed to write the necessary metadata.
⚠️
Corrupted Data Directory
Problems with the data directory permissions or integrity might prevent MariaDB from reading or writing the `master.info` file or related system tables.
⚠️
Metadata Table Corruption
For MariaDB versions storing replication metadata in system tables (e.g., `mysql.slave_master_info`), corruption or deletion of these specific tables can trigger this error.
🛠️

Solutions

3 solutions available

1. Reinitialize Replication Configuration medium

This is the most common fix and involves resetting the replication state.

1
Stop the MariaDB server.
2
Locate and back up the `master.info` and `relay-log.info` files in your MariaDB data directory. These files store replication state information.
sudo cp /var/lib/mysql/master.info /var/lib/mysql/master.info.bak
sudo cp /var/lib/mysql/relay-log.info /var/lib/mysql/relay-log.info.bak
3
Delete the `master.info` and `relay-log.info` files.
sudo rm /var/lib/mysql/master.info
sudo rm /var/lib/mysql/relay-log.info
4
Start the MariaDB server.
sudo systemctl start mariadb
5
Reconfigure replication. This typically involves using `CHANGE MASTER TO` or `CHANGE REPLICATION SOURCE TO` (for newer versions) and `START SLAVE` or `START REPLICA`.
STOP REPLICA;
CHANGE REPLICATION SOURCE TO
    SOURCE_HOST='<master_host>',
    SOURCE_USER='<replication_user>',
    SOURCE_PASSWORD='<replication_password>',
    SOURCE_PORT=<master_port>;
START REPLICA;

2. Verify Replication Configuration Variables medium

Ensure essential replication variables are correctly set and that the server is configured to be a replica.

1
Connect to the MariaDB server that is experiencing the error.
2
Check the `server_id` variable. It must be unique across all servers in the replication topology.
SHOW VARIABLES LIKE 'server_id';
3
Check the `relay_log` variable. It should be enabled and pointing to a valid file location.
SHOW VARIABLES LIKE 'relay_log';
4
Check if the server is configured to act as a replica. The `read_only` variable should generally be ON for a replica, but this is not directly related to the `master.info` missing error itself. More importantly, ensure replication is enabled in the configuration.
SHOW VARIABLES LIKE 'log_bin';
5
If any of these variables are missing or incorrectly set, you may need to adjust your `my.cnf` or `my.ini` configuration file and restart the server.

3. Manual Creation of Master Info File (Advanced) advanced

As a last resort, manually create the `master.info` file with essential information.

1
Stop the MariaDB server.
2
Determine the master host, user, password, and port. You will also need the current master log file and position from the master server (if it's operational).
3
Manually create the `master.info` file in your MariaDB data directory with the following format. Replace placeholders with your actual replication details. The `master_log_file` and `master_log_pos` should be obtained from the master server.
echo "<master_host>\n<replication_user>\n<replication_password>\n<master_port>\n<master_log_file>\n<master_log_pos>" > /var/lib/mysql/master.info
4
Ensure the file has correct ownership and permissions.
sudo chown mysql:mysql /var/lib/mysql/master.info
sudo chmod 640 /var/lib/mysql/master.info
5
Start the MariaDB server.
sudo systemctl start mariadb
6
Verify replication status. You might need to re-execute `CHANGE REPLICATION SOURCE TO` and `START REPLICA` if the server doesn't automatically pick up the new file.
SHOW REPLICA STATUS;
🔗

Related Errors

5 related errors