JIRA Upgrade Fails with Invalid Column Name Error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When upgrading JIRA to 5.x or greater using an in-place database upgrade, the upgrade process fails when it attempts to auto-export and the following appears in the web interface: 

com.atlassian.core.AtlassianCoreException: Error exporting data: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, NAME, DESCRIPTION, mailfrom, PREFIX, smtp_port, protocol, server_type, SERVERNAME, JNDILOCATION, mailusername, mailpassword, ISTLSREQUIRED, TIMEOUT, socks_port, socks_host FROM mailserver (Invalid column name 'socks_port'.)

The following is found within the atlassian-jira.log:

2012-08-13 14:27:50,366 main ERROR      [atlassian.jira.upgrade.UpgradeManagerImpl] Exception thrown during upgrade: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT pkey, PROJECT, REPORTER, ASSIGNEE, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT FROM jiraissue WHERE ID=? (Unknown column 'WATCHES' in 'field list')

Cause

This currently has three known causes:

  1. The auto-export has failed as the export functionality is expecting new columns to exist in the DB that do not exist yet. This is a known bug tracked under  JRA-28526 - Getting issue details... STATUS  and has been fixed in 5.1.7.
  2. As in our KB, JIRA User Does Not Have Permission to Access the Database. If certain permissions are not provided, the upgrade tasks will fail and the above symptoms will be present.
  3. The upgrade was attempted to be performed with an incorrectly configured dbconfig.xml, for example MySQL has a schema when it should not as per our JIRA throws table already exist error due to incorrect MySQL Schema KB article.


Workaround

  1. Stop JIRA.
  2. Backup JIRA using the native DB tools.
  3. Check that the $JIRA_HOME/dbconfig.xml has the correct schema, as in Connecting JIRA to a Database. If it does not, enter it as detailed in the documentation for the database that JIRA instance is using.
  4. Check if the database user has the necessary permission on the JIRA database, specifically the alter permissions as in the Connecting JIRA to a Database documentation.
  5. Disable auto-export as in our Disabling Auto-Export documentation.
  6. Start JIRA and verify the instance is able to complete the upgrade tasks successfully.

OR

OR

Last modified on Mar 22, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.