KB4538356 - FIX: Secondary replica update may fail if availability group configured on Linux in SQL Server 2017

Applies to: SQL Server 2017 on Linux

Symptoms


Assume that you have Always On availability groups (AG) feature configured on Linux in SQL Server 2017. When you update the secondary replica to Cumulative Update 18 (CU18) by using the yum command, you notice that the script upgrade may fail with the following error message:

DateTime SpidNum System objects could not be updated in database 'DatabaseName' because it is read-only.
DateTime SpidNum CHECKDB for database 'DatabaseName' finished without errors on DateTime (local time). This is an informational message only; no user action is required.
DateTime SpidNum Upgrading subscription settings and system objects in database [DatabaseName].
DateTime SpidNum Failed to update database "DatabaseName" because the database is read-only.
DateTime SpidNum Error executing sp_vupgrade_replication.
DateTime SpidNum Saving upgrade script status to 'SOFTWARE\Microsoft\MSSQLServer\Replication\Setup'.
DateTime SpidNum Error saving upgrade script status.
DateTime SpidNum Database 'DatabaseName' is upgrading script 'upgrade_ucp_cmdw_discovery.sql' from level LevelNum to level LevelNum.
DateTime SpidNum Database 'DatabaseName' is upgrading script 'msdb110_upgrade.sql' from level LevelNum to level LevelNum.
DateTime SpidNum Starting execution of PRE_MSDB.SQL
DateTime SpidNum Error: 3930, Severity: 16, State: 1.
DateTime SpidNum The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
DateTime SpidNum Error: 912, Severity: 21, State: 2.
DateTime SpidNum Script level upgrade for database 'DatabaseName' failed because upgrade step 'msdb110_upgrade.sql' encountered error 3930, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'DatabaseName' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.
DateTime SpidNum Error: 3417, Severity: 21, State: 3.
DateTime SpidNum Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
DateTime SpidNum SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. 

Resolution


This issue is fixed in the following cumulative update for SQL Server:
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

References


Learn about the terminology that Microsoft uses to describe software updates.