Cause
This error occurs if there is an attempt to update a non-environmental object on a secondary database. The secondary database server maintains a secondary copy of the database synchronized with a primary updating copy and supports read-only access only. Application programs cannot update a secondary database.
The following environmental objects can be updated.
An attempt to update any other object on the secondary database causes this exception to be raised.
Action
Change your application code to prevent this.