Problem Note 67845: SASĀ® Studio logon fails and returns the message "ERROR: cannot execute INSERT in a read-only transaction" in the compute log
SAS Studio logon fails, and you see a red X next to Compute Context in the top right of SAS Studio.
In this scenario, the sas-studio-app pod log contains the following error:
Unable to create compute server session. A data error occurred that prevented the successful completion of the operation.
Java service logs, such as the sas-compute pod log, contain the following error:
{"version":1,"timeStamp":"2021-03-23T22:01:33.679Z","level":"error","source":"sas-compute","message":" caused by: org.postgresql.util.PSQLException: ERROR: cannot execute INSERT in a read-only transaction","properties":{"logger":"com.sas.commons.rest.ExceptionLog","thread":"https-jsse-nio-0.0.0.0-8080-exec-6","traceId":"ec643e0e07d38654","spanId":"ec643e0e07d38654","spanExportable":"false","username":"userid@domain.org"},"messageParameters":{"0":"org.postgresql.util.PSQLException","1":"ERROR: cannot execute INSERT in a read-only transaction"}}
The Postgres cluster logs show that the Postgres cluster leader changed at some point, which caused this issue. A message similar to the following is displayed:
promoted self to leader by acquiring session lock
This issue can occur because the Postgres leader changed and certain Java services did not successfully connect to the new leader. The workaround is to perform one of the following:
- Restart all services so that they connect to the correct Postgres cluster leader.
- Delete the Java service pods so that they are re-created and connect to the current Postgres leader (such as compute, sas-studio-app, sas-launcher, sas-scheduler, sas-analytics-service, sas-job-execution, sas-identities, and sas-logon-app).
A fix for this issue is planned for a future software release.
Operating System and Release Information
| SAS System | SAS Viya | Linux for x64 | 2020.1 | | Viya | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Problem Note |
| Priority: | high |
| Date Modified: | 2021-04-30 15:05:53 |
| Date Created: | 2021-04-30 11:54:22 |