Error with Backup/Restore Stash 2.10.1 -> 2.12.1

I followed the Stash backup-restore document and I'm running into an issue with the database schema. I did a backup of version 2.10.1 and I restored the data into a newer version 2.12.1 then ran the startup script. I went to the servername:port/setup to connect to our oracle database and it gave me the below error.

Error:

The Hibernate SessionFactory could not be created. The database schema may not have been correctly applied

com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:339)

com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:159)

com.atlassian.stash.internal.maintenance.SpringMaintenanceTaskFactory.setupTask(SpringMaintenanceTaskFactory.java:145)

...

Missing column: is_active in JIRA.CWD_APPLICATION

org.hibernate.mapping.Table.validateColumns(Table.java:365)

org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1336)

org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)

...

Is there a reason it is looking for Jira.cwd_application? Just a note, we also have Jira DB running on the same server as Stash DB, but I checked the user and the database and they look fine. Is there an error with either the backup/restore or the initial setup page in Stash?

DB Properties File:

#>*******************************************************

#> Migrated to database at jdbc:oracle:thin:@//asdbsxxxxxxx:port/stash_dev

#> Updated by StashAdmin on 2014-01-02T09:39:53.326-05:00

#>*******************************************************

#jdbc.driver=oracle.jdbc.driver.OracleDriver

#jdbc.url=jdbc:oracle:thin:@//asdxxxxxxxxx:port/stash_dev

#jdbc.user=stash_dev

#jdbc.password=password

#>********************************************************************************

#> Overridden during restore from backup by stashuser on Apr 22, 2014 8:54:56 AM

#>********************************************************************************

jdbc.driver=oracle.jdbc.driver.OracleDriver

jdbc.url=jdbc:oracle:thin:@//asdxxxxxxx:port/CSD11UTF

jdbc.user=STASH_UAT

jdbc.password=password

3 answers

We are having the same issue too. Just installed stash and then when restarting it wouldn't start up. I cleared out the database and the stash home directory, pulled down the latest (2.12.2) and it crashed with the same message during database setup.

We also have a JIRA databse on the same server that is registered under the JIRA user which may be causing trouble.

I received a response through Atlassian support on the issue. It seems like it's directly related to using the backup client on Stash 2.10.

"We have not established the root cause of the upgrade failure. The failure was on the SQL side RE the Answers post https://answers.atlassian.com/questions/279568/stash-upgrade-from-2-10-1-to-2-12-1-failed-database-scheme-could-not-be-updated?utm_source=SAC&utm_medium=provide_details:

Caused by: liquibase.exception.DatabaseException: Error executing SQL ALTER TABLE `atlassian_stash`.`sta_cmt_discussion` ADD CONSTRAINT `fk_sta_cmt_disc_repo` FOREIGN KEY (`repository_id`) REFERENCES `atlassian_stash`.`repository` (`id`) ON DELETE CASCADE: Can't create table 'atlassian_stash.#sql-2eb1_7462' (errno: 121)

The latest backup client version 1.2.1 will work with Stash 2.11.2 - 2.12.2 .

See this page for updates: https://marketplace.atlassian.com/plugins/com.atlassian.stash.backup.client

"

The answer turned out to be that the database needs a unique service.

Incorrect: jdbc.url=jdbc:oracle:thin:@//asdxxxxxxx:port/CSD11UTF

Correct: jdbc:oracle:thin:@//asdbsxxxxxxx:port/stash_dev

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

635 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot