-
Bug
-
Resolution: Timed out
-
Medium
-
None
-
5.8.1, 5.9.10
-
9
-
Severity 2 - Major
-
Summary
Upgrading Bamboo to 5.8.1 with an older database can lead to Bamboo not creating the CREDENTIALS table. However, Bamboo will successfully start but not flag any errors at the UI level.
Customers who try to create a new Git repository will be presented with the standard new repository dialog box - but no pull down field to specify the Authentication type will be presented as we can't refer to the table in the DB.
This same issue causes further problems when upgrading to 5.9.x with upgrade task 5907 : Update SSH credentials configuration
Environment
- Prominently occurs on Microsoft SQL Server however may also occur on other DBMS due to case-sensitivity configuration.
Expected Results
CREDENTIALS Table should have been created by the schema update.
Actual Results
Below exception is shown in the atlassian-bamboo.log:
2017-07-12 13:46:35,908 INFO [13-UpgradeTaskBackgroundThread:pool-28-thread-1] [AbstractUpgradeManager] ------------------------------------------- 2017-07-12 13:46:35,908 INFO [13-UpgradeTaskBackgroundThread:pool-28-thread-1] [AbstractUpgradeManager] 5907 : Update SSH credentials configuration 2017-07-12 13:46:35,908 INFO [13-UpgradeTaskBackgroundThread:pool-28-thread-1] [AbstractUpgradeManager] ------------------------------------------- 2017-07-12 13:46:35,923 WARN [13-UpgradeTaskBackgroundThread:pool-28-thread-1] [JDBCExceptionReporter] SQL Error: 208, SQLState: S0002 2017-07-12 13:46:35,923 ERROR [13-UpgradeTaskBackgroundThread:pool-28-thread-1] [JDBCExceptionReporter] Invalid object name 'CREDENTIALS'. 2017-07-12 13:46:35,923 ERROR [13-UpgradeTaskBackgroundThread:pool-28-thread-1] [AbstractUpgradeManager] org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select this_.CREDENTIALS_ID as CREDENTI1_89_0_, this_.PLUGIN_KEY as PLUGIN2_89_0_, this_.NAME as NAME89_0_, this_.XML as XML89_0_ from CREDENTIALS this_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642) .... com.atlassian.bamboo.upgrade.tasks.v5_9.UpgradeTask5907UpdateSshCredentialsConfiguration.doUpgrade(UpgradeTask5907UpdateSshCredentialsConfiguration.java:23) at com.atlassian.bamboo.upgrade.AbstractUpgradeManager.runUpgradeTask(AbstractUpgradeManager.java:206) ... Caused by: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) ... Caused by: java.sql.SQLException: Invalid object name 'CREDENTIALS'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894) ...
Schema update failed to alter the table as it didn't exist:
2017-07-12 13:46:15,408 INFO [localhost-startStop-1] [UpgradeLauncher] Checking if schema update is required... alter table CREDENTIALS add CREDENTIALS_ID numeric(19,0) not null 2017-07-12 13:46:16,344 ERROR [localhost-startStop-1] [SchemaUpdate] Unsuccessful: alter table CREDENTIALS add CREDENTIALS_ID numeric(19,0) not null 2017-07-12 13:46:16,344 ERROR [localhost-startStop-1] [SchemaUpdate] Cannot find the object "CREDENTIALS" because it does not exist or you do not have permissions.
Workaround
- Stop Bamboo
Backup your Bamboo database and <bamboo-home> for rollback purposes
- Create the table manually with the below example SQL (MS SQL):
CREATE TABLE [dbo].[CREDENTIALS] ( [CREDENTIALS_ID] [numeric](19, 0) NOT NULL, [NAME] [nvarchar](255) NULL, [XML] [ntext] NULL, PRIMARY KEY CLUSTERED ( [CREDENTIALS_ID] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
- Start Bamboo
Or:
- Stop Bamboo
Backup your Bamboo database and <bamboo-home> for rollback purposes
- Set the system property using Configuring your system properties to make Bamboo recreate its schema:
-Datlassian.forceSchemaUpdate=true - Restart Bamboo
- was cloned as
-
BDEV-9579 Loading...