Bamboo not starting after upgrage
Asked by rvcsupport:

|---------------------|-------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 2017-08-29 14:23:13 | fatal | bootstrap | Bamboo bootstrap failed: Failed to run pre-bootstrap upgrade tasks. Please contact Atlassian Support at [https://support.atlassian.com](https://support.atlassian.com/) |

I tried updating license key in cfg.xml - this didn't work.

The log seems to indicate an issue with removing constraints

2017-08-29 14:17:57,786 INFO \[localhost-startStop-1\] \[AbstractUpgradeManager\] -----------------------------------------------------------  
2017-08-29 14:17:57,786 INFO \[localhost-startStop-1\] \[AbstractUpgradeManager\] 51605 : Remove foreign keys from renamed tables (bootstrap)  
2017-08-29 14:17:57,786 INFO \[localhost-startStop-1\] \[AbstractUpgradeManager\] -----------------------------------------------------------  
2017-08-29 14:17:57,786 DEBUG \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select object_schema_name(object_id('PROJECT'))\]  
2017-08-29 14:17:57,786 TRACE \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select object_schema_name(object_id('PROJECT'))\] took 957.9 ?s  
2017-08-29 14:17:57,786 INFO \[localhost-startStop-1\] \[AbstractDbmsBean\] Detected schema: dbo  
2017-08-29 14:17:57,801 DEBUG \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select dc.NAME as CONSTRAINT_NAME, c.NAME as COLUMN_NAME, 'CHECK' as CONSTRAINT_TYPE from sys.tables t inner join sys.default_constraints dc on t.OBJECT_ID = dc.PARENT_OBJECT_ID inner join sys.columns c on dc.PARENT_OBJECT_ID = c.OBJECT_ID AND c.COLUMN_ID = dc.PARENT_COLUMN_ID inner join sys.schemas sc on sc.SCHEMA_ID = t.SCHEMA_ID where lower(t.NAME) = 'external_members' and sc.NAME = 'dbo'\]  
2017-08-29 14:17:57,801 TRACE \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select dc.NAME as CONSTRAINT_NAME, c.NAME as COLUMN_NAME, 'CHECK' as CONSTRAINT_TYPE from sys.tables t inner join sys.default_constraints dc on t.OBJECT_ID = dc.PARENT_OBJECT_ID inner join sys.columns c on dc.PARENT_OBJECT_ID = c.OBJECT_ID AND c.COLUMN_ID = dc.PARENT_COLUMN_ID inner join sys.schemas sc on sc.SCHEMA_ID = t.SCHEMA_ID where lower(t.NAME) = 'external_members' and sc.NAME = 'dbo'\] took 1.344 ms  
2017-08-29 14:17:57,801 DEBUG \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select obj.NAME as CONSTRAINT_NAME, col1.NAME as COLUMN_NAME, 'FOREIGN KEY' as CONSTRAINT_TYPE from sys.foreign_key_columns fkc inner join sys.objects obj on obj.OBJECT_ID = fkc.CONSTRAINT_OBJECT_ID inner join sys.tables t on t.OBJECT_ID = fkc.PARENT_OBJECT_ID inner join sys.columns col1 on col1.COLUMN_ID = fkc.PARENT_COLUMN_ID and col1.OBJECT_ID = t.OBJECT_ID inner join sys.schemas sc on sc.SCHEMA_ID = t.SCHEMA_ID where lower(t.NAME) = 'external_members' and sc.NAME = 'dbo'\]  
2017-08-29 14:17:57,801 TRACE \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select obj.NAME as CONSTRAINT_NAME, col1.NAME as COLUMN_NAME, 'FOREIGN KEY' as CONSTRAINT_TYPE from sys.foreign_key_columns fkc inner join sys.objects obj on obj.OBJECT_ID = fkc.CONSTRAINT_OBJECT_ID inner join sys.tables t on t.OBJECT_ID = fkc.PARENT_OBJECT_ID inner join sys.columns col1 on col1.COLUMN_ID = fkc.PARENT_COLUMN_ID and col1.OBJECT_ID = t.OBJECT_ID inner join sys.schemas sc on sc.SCHEMA_ID = t.SCHEMA_ID where lower(t.NAME) = 'external_members' and sc.NAME = 'dbo'\] took 1.761 ms  
2017-08-29 14:17:57,801 DEBUG \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select kc.NAME as CONSTRAINT_NAME, c.NAME AS COLUMN_NAME,(case kc.type_desc when 'PRIMARY_KEY_CONSTRAINT' then 'PRIMARY KEY' when 'UNIQUE_CONSTRAINT' then 'UNIQUE' end) as CONSTRAINT_TYPE from sys.key_constraints kc inner join sys.tables t on t.OBJECT_ID = kc.PARENT_OBJECT_ID inner join sys.index_columns ic on ic.OBJECT_ID = t.OBJECT_ID and ic.index_id = kc.UNIQUE_INDEX_ID inner join sys.columns c on c.OBJECT_ID = t.OBJECT_ID and c.COLUMN_ID = ic.COLUMN_ID inner join sys.schemas sc on sc.SCHEMA_ID = t.SCHEMA_ID where lower(t.NAME) = 'external_members' and sc.NAME = 'dbo'\]  
2017-08-29 14:17:57,801 TRACE \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[select kc.NAME as CONSTRAINT_NAME, c.NAME AS COLUMN_NAME,(case kc.type_desc when 'PRIMARY_KEY_CONSTRAINT' then 'PRIMARY KEY' when 'UNIQUE_CONSTRAINT' then 'UNIQUE' end) as CONSTRAINT_TYPE from sys.key_constraints kc inner join sys.tables t on t.OBJECT_ID = kc.PARENT_OBJECT_ID inner join sys.index_columns ic on ic.OBJECT_ID = t.OBJECT_ID and ic.index_id = kc.UNIQUE_INDEX_ID inner join sys.columns c on c.OBJECT_ID = t.OBJECT_ID and c.COLUMN_ID = ic.COLUMN_ID inner join sys.schemas sc on sc.SCHEMA_ID = t.SCHEMA_ID where lower(t.NAME) = 'external_members' and sc.NAME = 'dbo'\] took 4.089 ms  
2017-08-29 14:17:57,817 DEBUG \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[alter table EXTERNAL_MEMBERS drop constraint FK_O35Y9WAFG8GXRHFEDX6P840A9\]  
2017-08-29 14:17:57,817 TRACE \[localhost-startStop-1\] \[JdbcUtils\] Executing: \[alter table EXTERNAL_MEMBERS drop constraint FK_O35Y9WAFG8GXRHFEDX6P840A9\] took 9.783 ms  
2017-08-29 14:17:57,817 ERROR \[localhost-startStop-1\] \[AbstractUpgradeManager\] java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: 'FK_O35Y9WAFG8GXRHFEDX6P840A9' is not a constraint.  
java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: 'FK_O35Y9WAFG8GXRHFEDX6P840A9' is not a constraint.


Answers:
author: rvcsupport
body: **RESOLVED:**

Case Sensitive.

Recreated constraints with uppercase names, deleted the lowercase names.

**Process:**

Start service

check log

stop service

fix constraint

start service

check log

stop service

fix constraint.... repeat until no more errors.


author: somethingblue
body: Hi Earl,

You may be running into [BAM-18471](https://jira.atlassian.com/browse/BAM-18471). Can you please run the following and then restart Bamboo and let us know the results:

```
ALTER TABLE EXTERNAL_MEMBERS DROP CONSTRAINT FK_O35Y9WAFG8GXRHFEDX6P840A9;
```

Cheers,

Branden

comments: author: rvcsupport
body: No go...

Effectively the same error:

Msg 3728, Level 16, State 1, Line 2  
'FK_O35Y9WAFG8GXRHFEDX6P840A9' is not a constraint.  
Msg 3727, Level 16, State 0, Line 2  
Could not drop constraint. See previous errors.


author: rvcsupport
body: ![bamboo-constraint.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/5380i9266D83F5E6D9957/image-size/large?v=v2&px=999 "bamboo-constraint.PNG")

in the DB there is nothing in 'Constraints' the FK_... object is in 'keys'


author: rvcsupport
body: Im thinking of creating the contraint so it can be deleted.