Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
BC2
Contributor
Contributor

Failed to update database "DatabaseName" because the database is read-only

Dear team,

We have encountered this error suddenly a few hours ago, and only one replication task is experiencing this issue with the same target (Azure SQL Managed Instance). The database is still functioning normally with other tasks, but only this one is affected.

Failed to update database "FLXXX" because the database is read-only

BC2_0-1701512996142.png

I need advice on what to do to resolve this. 

Please help. Thank you

Labels (1)
1 Reply
john_wang
Support
Support

Hello @BC2 ,

Welcome and thanks for reaching out to Qlik Community!
In Azure SQL Managed Instance (MI), the error message "Failed to update database because the database is read-only" indicates that there is an attempt to perform a write or update operation on a database that is currently in read-only mode, attempting to modify data in such databases will result in this error.
Many various reasons may lead to the same error, not very sure what's the status, if the problem disappeared now.

Here are some common reasons why a database might be in read-only mode and how you can address the issue (if the problem persists still, please check step 1 below. if it's random then see 2, and 3):

  1. Check the database status 
    SELECT DATABASEPROPERTYEX('FLXXX', 'Updateability');
    or
    SELECT state_desc FROM sys.databases WHERE name = 'FLXXX';
  2. Geo-Replication: If you are using Azure SQL Geo-Replication, the secondary databases are typically in read-only mode. Ensure that your connection string is directing write operations to the primary (read-write) database. or there was switch over between primary database and secondary databases.
  3. Logs and Auditing: As this error comes from backend SQL MI databases, reviewing the logs and auditing features available may help to identify the root reason. This may include Azure Monitor logs, SQL Server logs, and auditing features etc.
  4. BTW, were other tasks connected to the same Azure SQL Managed Instance by same connecting string, and/or same account name? if the account name is different, then please make sure sufficient permissions were granted to the account (in this task), or any locks or conflicts occurred in the backend database during the time.

    Hope this helps.
    Regards,
    John.

 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!