JIRA throws SQLException with Table is read only errno 165 when starting
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
After starting JIRA the following error is displayed when attempting to access the application:
The following appears in the atlassian-jira.log
2015-06-08 14:53:14,682 localhost-startStop-1 ERROR [atlassian.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event '[com.atlassian.plugin.event.events.PluginEnabledEvent@59cad9e6, SingleParameterMethodListenerInvoker{method=public void com.atlassian.webhooks.plugin.WebHookEventsProcessor.onEvent(java.lang.Object), listener=com.atlassian.webhooks.plugin.WebHookEventsProcessor@2fffef24}]' from the invoker 'java.lang.RuntimeException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM propertytext WHERE ID=? (Can't lock file (errno: 165 "Table is read only")))'
Diagnosis
Environment
- JIRA is connected to a MySQL database server
Diagnostic Steps
- Any specific steps necessary to reproduce the issue that will ensure that the customer is actually experiencing the same problem as the one that that is being described.
- Steps like these will often involve checking data using SQL
SELECT
queries to see if the application is in a particular state OR any checks to ensure that the customers environment is in a state that will bring about the described problem
This section is optional, especially if the problem is triggered regardless of the environment and diagnosis
Cause
Corrupted InnoDB tables due to unknown reasons.
Resolution
Edit the MySQL option file (eg. /etc/my.cnf)
to include the innodb_force_recovery option.
See MySQL documentation for details on what values to use when setting this option: Forcing InnoDB Recovery