RDBMS - CAST Storage Service - Azure server- SQL Error - ERROR - cannot execute INSERT in a read-only transaction

Description

This page provides the solution to the error "SQL Error: ERROR: cannot execute INSERT in a read-only transaction" seen during an analysis or other database operation.

Observed in CAST AIP


Release
Yes/No
8.3.x(tick)
Observed on RDBMS
RDBMS
Yes/No
CSS(tick)
Step by Step Scenario

Below is the step-by-step scenario leading to the problem:

  1. Analysis fails
  2. Analysis logs reports error - SQL Error: ERROR: cannot execute INSERT in a read-only transaction

 

Impact of the Problem

The impact of the problem on the analysis or the dashboard is: Analysis cannot be completed.

Action Plan

The error during an analysis or database operation:

SQL Error: ERROR: cannot execute INSERT in a read-only transaction

can occur whenever you have space issues on an Azure server.

Please see this article for Azure:
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-compute-storage#scaling-resources

Reaching the storage limit

When you reach the storage limit, the server starts returning errors and prevents any further modifications. Reaching the limit might also cause problems with other operational activities, such as backups and write-ahead log (WAL) archiving.
To avoid this situation, the server is automatically switched to read-only mode when the storage usage reaches 95 percent or when the available capacity is less than 5 GiB.
We recommend that you actively monitor the disk space that's in use and increase the disk size before you run out of storage. You can set up an alert to notify you when your server storage is approaching an out-of-disk state. For more information, see Use the Azure portal to set up alerts on metrics for Azure Database for PostgreSQL - Flexible Server.
 
So read-only mode can be due to the fact that there is no more storage on the Azure server.
                        




Notes/comments
Ticket 43102
Related Pages