Issue Details (XML | Word | Printable)

Key: JRA-4815
Type: Bug Bug
Status: Closed Closed
Resolution: Resolved Locally
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Greg Perrott
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

Errors upgrading from 2.6.1 to 3.0 Enterprise Beta using Sybase

Created: 06/Oct/04 02:25 PM   Updated: 30/Jul/06 07:35 PM
Component/s: Installation
Affects Version/s: 3.0 Enterprise Beta
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Windows NT4, Resin 2.1.7, Sybase ASE 12
Issue Links:
Duplicate
 

Participants: Greg Perrott and Jeff Turner [Atlassian]
Since last comment: 3 years, 48 weeks ago
Resolution Date: 14/Mar/05 10:56 PM
Labels:


 Description  « Hide
I get the following error when attemtping to upgrade from 2.6.1 to .0 Enterprise Beta.

Error occured during export before upgrade: Error in action: com.atlassian.jira.action.admin.DataExport@bc404e, result: error
Error exporting: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, PROJECT, ISSUETYPE, FIELDTYPE, CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, cfname, DESCRIPTION, defaultvalue FROM customfield (Invalid column name 'CUSTOMFIELDTYPEKEY'.
)
com.atlassian.core.AtlassianCoreException: Error in action: com.atlassian.jira.action.admin.DataExport@bc404e, result: error
Error exporting: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, PROJECT, ISSUETYPE, FIELDTYPE, CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, cfname, DESCRIPTION, defaultvalue FROM customfield (Invalid column name 'CUSTOMFIELDTYPEKEY'.
)
at com.atlassian.core.action.ActionUtils.checkForErrors(ActionUtils.java:53)
at com.atlassian.jira.bean.export.AutoExportImpl.exportData(AutoExportImpl.java:66)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:300)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:279)
at com.atlassian.jira.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:69)
at com.caucho.server.http.Application.init(Application.java:1832)
at com.caucho.server.http.VirtualHost.initWars(VirtualHost.java:824)
at com.caucho.server.http.VirtualHost.init(VirtualHost.java:687)
at com.caucho.server.http.ServletServer.initHosts(ServletServer.java:853)
at com.caucho.server.http.ServletServer.initInternal(ServletServer.java:698)
at com.caucho.server.http.ServletServer.init(ServletServer.java:509)
at com.caucho.server.http.ResinServer.init(ResinServer.java:382)
at com.caucho.server.http.ResinServer.main(ResinServer.java:1142)
at com.caucho.server.http.HttpServer.main(HttpServer.java:103)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Greg Perrott added a comment - 06/Oct/04 02:34 PM
Here is the stack trace from stdout:

2004-10-06 15:35:46,593 WARN [webwork.dispatcher.ServletDispatcher] Unable to find 'webwork.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir
2004-10-06 15:35:46,828 WARN [atlassian.jira.upgrade.ConsistencyCheckImpl] Detected that you are using Resin - turned off all transactions as Resin TX implementation is buggy.
2004-10-06 15:37:23,796 WARN [core.entity.jdbc.DatabaseUtil] Entity "CustomField" has 9 fields but table "customfield" has 7 columns.
2004-10-06 15:37:23,796 WARN [core.entity.jdbc.DatabaseUtil] Field "customfieldsearcherkey" of entity "CustomField" is missing its corresponding column "CUSTOMFIELDSEARCHERKEY"
2004-10-06 15:37:23,843 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "CUSTOMFIELDSEARCHERKEY" to table "customfield"
2004-10-06 15:37:23,843 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE customfield ADD CUSTOMFIELDSEARCHERKEY VARCHAR(255)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'customfield' failed. Default clause is required in order to add non-NULL column 'CUSTOMFIELDSEARCHERKEY'.

2004-10-06 15:37:23,843 WARN [core.entity.jdbc.DatabaseUtil] Field "customfieldtypekey" of entity "CustomField" is missing its corresponding column "CUSTOMFIELDTYPEKEY"
2004-10-06 15:37:23,890 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "CUSTOMFIELDTYPEKEY" to table "customfield"
2004-10-06 15:37:23,890 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE customfield ADD CUSTOMFIELDTYPEKEY VARCHAR(255)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'customfield' failed. Default clause is required in order to add non-NULL column 'CUSTOMFIELDTYPEKEY'.

2004-10-06 15:37:23,890 WARN [core.entity.jdbc.DatabaseUtil] Entity "CustomFieldOption" has 6 fields but table "customfieldoption" has 4 columns.
2004-10-06 15:37:23,890 WARN [core.entity.jdbc.DatabaseUtil] Field "type" of entity "CustomFieldOption" is missing its corresponding column "optiontype"
2004-10-06 15:37:23,921 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "optiontype" to table "customfieldoption"
2004-10-06 15:37:23,921 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE customfieldoption ADD optiontype VARCHAR(60)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'customfieldoption' failed. Default clause is required in order to add non-NULL column 'optiontype'.

2004-10-06 15:37:23,921 WARN [core.entity.jdbc.DatabaseUtil] Field "parentoptionid" of entity "CustomFieldOption" is missing its corresponding column "PARENTOPTIONID"
2004-10-06 15:37:23,953 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "PARENTOPTIONID" to table "customfieldoption"
2004-10-06 15:37:23,953 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE customfieldoption ADD PARENTOPTIONID NUMERIC(18,0)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'customfieldoption' failed. Default clause is required in order to add non-NULL column 'PARENTOPTIONID'.

2004-10-06 15:37:23,953 WARN [core.entity.jdbc.DatabaseUtil] Entity "CustomFieldValue" has 9 fields but table "customfieldvalue" has 7 columns.
2004-10-06 15:37:23,953 WARN [core.entity.jdbc.DatabaseUtil] Field "parentkey" of entity "CustomFieldValue" is missing its corresponding column "PARENTKEY"
2004-10-06 15:37:23,984 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "PARENTKEY" to table "customfieldvalue"
2004-10-06 15:37:23,984 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE customfieldvalue ADD PARENTKEY VARCHAR(255)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'customfieldvalue' failed. Default clause is required in order to add non-NULL column 'PARENTKEY'.

2004-10-06 15:37:23,984 WARN [core.entity.jdbc.DatabaseUtil] Field "valuetype" of entity "CustomFieldValue" is missing its corresponding column "VALUETYPE"
2004-10-06 15:37:24,015 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "VALUETYPE" to table "customfieldvalue"
2004-10-06 15:37:24,015 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE customfieldvalue ADD VALUETYPE VARCHAR(255)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'customfieldvalue' failed. Default clause is required in order to add non-NULL column 'VALUETYPE'.

2004-10-06 15:37:24,015 WARN [core.entity.jdbc.DatabaseUtil] Entity "FieldLayoutSchemeAssociation" has no table in the database
2004-10-06 15:37:24,312 WARN [core.entity.jdbc.DatabaseUtil] Entity "IssueLink" has 5 fields but table "issuelink" has 4 columns.
2004-10-06 15:37:24,312 WARN [core.entity.jdbc.DatabaseUtil] Field "sequence" of entity "IssueLink" is missing its corresponding column "SEQUENCE"
2004-10-06 15:37:24,343 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "SEQUENCE" to table "issuelink"
2004-10-06 15:37:24,343 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE issuelink ADD SEQUENCE NUMERIC(18,0)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'issuelink' failed. Default clause is required in order to add non-NULL column 'SEQUENCE'.

2004-10-06 15:37:24,343 WARN [core.entity.jdbc.DatabaseUtil] Entity "IssueLinkType" has 5 fields but table "issuelinktype" has 4 columns.
2004-10-06 15:37:24,343 WARN [core.entity.jdbc.DatabaseUtil] Field "style" of entity "IssueLinkType" is missing its corresponding column "pstyle"
2004-10-06 15:37:24,375 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "pstyle" to table "issuelinktype"
2004-10-06 15:37:24,375 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE issuelinktype ADD pstyle VARCHAR(60)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'issuelinktype' failed. Default clause is required in order to add non-NULL column 'pstyle'.

2004-10-06 15:37:24,375 WARN [core.entity.jdbc.DatabaseUtil] Entity "IssueType" has 6 fields but table "issuetype" has 5 columns.
2004-10-06 15:37:24,375 WARN [core.entity.jdbc.DatabaseUtil] Field "style" of entity "IssueType" is missing its corresponding column "pstyle"
2004-10-06 15:37:24,406 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "pstyle" to table "issuetype"
2004-10-06 15:37:24,406 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE issuetype ADD pstyle VARCHAR(60)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'issuetype' failed. Default clause is required in order to add non-NULL column 'pstyle'.

2004-10-06 15:37:24,406 WARN [core.entity.jdbc.DatabaseUtil] Entity "PortalPage" has 5 fields but table "portalpage" has 3 columns.
2004-10-06 15:37:24,406 WARN [core.entity.jdbc.DatabaseUtil] Field "sequence" of entity "PortalPage" is missing its corresponding column "SEQUENCE"
2004-10-06 15:37:24,437 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "SEQUENCE" to table "portalpage"
2004-10-06 15:37:24,437 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE portalpage ADD SEQUENCE NUMERIC(18,0)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'portalpage' failed. Default clause is required in order to add non-NULL column 'SEQUENCE'.

2004-10-06 15:37:24,437 WARN [core.entity.jdbc.DatabaseUtil] Field "description" of entity "PortalPage" is missing its corresponding column "DESCRIPTION"
2004-10-06 15:37:24,453 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "DESCRIPTION" to table "portalpage"
2004-10-06 15:37:24,453 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE portalpage ADD DESCRIPTION VARCHAR(255)
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'portalpage' failed. Default clause is required in order to add non-NULL column 'DESCRIPTION'.

2004-10-06 15:37:24,453 WARN [core.entity.jdbc.DatabaseUtil] Entity "Version" has 9 fields but table "version" has 8 columns.
2004-10-06 15:37:24,453 WARN [core.entity.jdbc.DatabaseUtil] Field "releasedate" of entity "Version" is missing its corresponding column "RELEASEDATE"
2004-10-06 15:37:24,484 ERROR [core.entity.jdbc.DatabaseUtil] Could not add column "RELEASEDATE" to table "version"
2004-10-06 15:37:24,484 ERROR [core.entity.jdbc.DatabaseUtil] SQL Exception while executing the following:
ALTER TABLE version ADD RELEASEDATE DATETIME
Error was: com.sybase.jdbc2.jdbc.SybSQLException: ALTER TABLE 'version' failed. Default clause is required in order to add non-NULL column 'RELEASEDATE'.

2004-10-06 15:37:24,484 WARN [core.entity.jdbc.DatabaseUtil] Entity "Workflow" has no table in the database
2004-10-06 15:37:24,609 WARN [core.entity.jdbc.DatabaseUtil] Entity "WorkflowScheme" has no table in the database
2004-10-06 15:37:24,750 WARN [core.entity.jdbc.DatabaseUtil] Entity "WorkflowSchemeEntity" has no table in the database
2004-10-06 15:37:31,375 WARN [webwork.dispatcher.ServletDispatcher] Unable to find 'webwork.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir
2004-10-06 15:38:04,187 ERROR [jira.action.admin.DataExport] Error exporting: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, PROJECT, ISSUETYPE, FIELDTYPE, CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, cfname, DESCRIPTION, defaultvalue FROM customfield (Invalid column name 'CUSTOMFIELDTYPEKEY'.
)
org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, PROJECT, ISSUETYPE, FIELDTYPE, CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, cfname, DESCRIPTION, defaultvalue FROM customfield (Invalid column name 'CUSTOMFIELDTYPEKEY'.
)
at org.ofbiz.core.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:311)
at org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(GenericDAO.java:1050)
at org.ofbiz.core.entity.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:178)
at org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(GenericDelegator.java:995)
at org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(GenericDelegator.java:968)
at com.atlassian.jira.action.admin.DataExport.execute(DataExport.java:92)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131)
at com.atlassian.core.action.DefaultActionDispatcher.execute(DefaultActionDispatcher.java:34)
at com.atlassian.jira.bean.export.AutoExportImpl.exportData(AutoExportImpl.java:57)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:300)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:279)
at com.atlassian.jira.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:69)
at com.caucho.server.http.Application.init(Application.java:1832)
at com.caucho.server.http.VirtualHost.initWars(VirtualHost.java:824)
at com.caucho.server.http.VirtualHost.init(VirtualHost.java:687)
at com.caucho.server.http.ServletServer.initHosts(ServletServer.java:853)
at com.caucho.server.http.ServletServer.initInternal(ServletServer.java:698)
at com.caucho.server.http.ServletServer.init(ServletServer.java:509)
at com.caucho.server.http.ResinServer.init(ResinServer.java:382)
at com.caucho.server.http.ResinServer.main(ResinServer.java:1142)
at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
com.sybase.jdbc2.jdbc.SybSQLException: Invalid column name 'CUSTOMFIELDTYPEKEY'.

at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2636)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1996)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:204)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:187)
at com.sybase.jdbc2.jdbc.SybStatement.queryLoop(SybStatement.java:1510)
at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:1495)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java:70)
at org.ofbiz.core.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:309)
at org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(GenericDAO.java:1050)
at org.ofbiz.core.entity.GenericHelperDAO.findListIteratorByCondition(GenericHelperDAO.java:178)
at org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(GenericDelegator.java:995)
at org.ofbiz.core.entity.GenericDelegator.findListIteratorByCondition(GenericDelegator.java:968)
at com.atlassian.jira.action.admin.DataExport.execute(DataExport.java:92)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131)
at com.atlassian.core.action.DefaultActionDispatcher.execute(DefaultActionDispatcher.java:34)
at com.atlassian.jira.bean.export.AutoExportImpl.exportData(AutoExportImpl.java:57)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:300)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:279)
at com.atlassian.jira.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:69)
at com.caucho.server.http.Application.init(Application.java:1832)
at com.caucho.server.http.VirtualHost.initWars(VirtualHost.java:824)
at com.caucho.server.http.VirtualHost.init(VirtualHost.java:687)
at com.caucho.server.http.ServletServer.initHosts(ServletServer.java:853)
at com.caucho.server.http.ServletServer.initInternal(ServletServer.java:698)
at com.caucho.server.http.ServletServer.init(ServletServer.java:509)
at com.caucho.server.http.ResinServer.init(ResinServer.java:382)
at com.caucho.server.http.ResinServer.main(ResinServer.java:1142)
at com.caucho.server.http.HttpServer.main(HttpServer.java:103)
2004-10-06 15:38:04,515 ERROR [atlassian.jira.upgrade.UpgradeManagerImpl] Error occured during export before upgrade.
com.atlassian.core.AtlassianCoreException: Error in action: com.atlassian.jira.action.admin.DataExport@bc404e, result: error
Error exporting: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID, PROJECT, ISSUETYPE, FIELDTYPE, CUSTOMFIELDTYPEKEY, CUSTOMFIELDSEARCHERKEY, cfname, DESCRIPTION, defaultvalue FROM customfield (Invalid column name 'CUSTOMFIELDTYPEKEY'.
)
at com.atlassian.core.action.ActionUtils.checkForErrors(ActionUtils.java:53)
at com.atlassian.jira.bean.export.AutoExportImpl.exportData(AutoExportImpl.java:66)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:300)
at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:279)
at com.atlassian.jira.upgrade.UpgradeLauncher.contextInitialized(UpgradeLauncher.java:69)
at com.caucho.server.http.Application.init(Application.java:1832)
at com.caucho.server.http.VirtualHost.initWars(VirtualHost.java:824)
at com.caucho.server.http.VirtualHost.init(VirtualHost.java:687)
at com.caucho.server.http.ServletServer.initHosts(ServletServer.java:853)
at com.caucho.server.http.ServletServer.initInternal(ServletServer.java:698)
at com.caucho.server.http.ServletServer.init(ServletServer.java:509)
at com.caucho.server.http.ResinServer.init(ResinServer.java:382)
at com.caucho.server.http.ResinServer.main(ResinServer.java:1142)
at com.caucho.server.http.HttpServer.main(HttpServer.java:103)


Greg Perrott added a comment - 06/Oct/04 03:55 PM
I disocvered the probelm and have fixed it.

With Sybase databases you need to set an option on the database 'ALLOW DEFAULTS ON' so when columns are created they weill allow NULL values by default.

This has got me before.

Wiould it be possible for the upgrade process that creates the tables to explicitly specify NULL or NOT NULL for the columns when altering/creating tables.

this would avoid this problem under Sybase.


Jeff Turner [Atlassian] added a comment - 07/Oct/04 07:20 PM
Greg,

Do you know if the ALLOW DEFAULTS ON option is set by default in Sybase? If not, we'll need to fix it in JIRA's persistence engine, or at least document it.

By the way, I've raised an issue with the makers of the persistence engine JIRA uses:

http://jira.undersunconsulting.com/browse/OFBIZ-43


Greg Perrott added a comment - 07/Oct/04 08:54 PM
ALLOW DEFAULTS ON is a database option in Sybase which by default is not enabled.

Therefore if you create tab les/columns and you do not explicitly specify how to handle defaults (NULL, NOT NULL) in the sql then columns will default to NOT NULL.

This obviously causes problems with JIRA and although I am aware of this issue, each time we upgrade I also overlook it and it creates a bit of extra work. Each time we test new versions of JIRA by loading a copy of the production database onto another server, we need to set the is option again or else there will be problems (hence this issue logged).

My preference would be to handle this in the SQL that the upgrade process generates by explicitly specify NOT NULL for each column (where appropriate).


Jeff Turner [Atlassian] added a comment - 07/Oct/04 09:34 PM
Thanks for the explanation.

For now I'll document this on our website, but hopefully we'll be able to fix this permanently by generating more explicit SQL.