Stash 2.2.0 Upgrade - DB authentication issues

I'm trying to upgrade our sandbox/test instance of Stash from 2.1.2 (what Prod is currently on) to the 2.2.0 release, and after the upgrade (which on our test instance is merely unzipping the new 2.2.0 folder, stopping the old release, updating the service wrapper in /etc/init.d, and starting the new version) the web UI shows the following:

A fatal error has occurred

The following problem occurred which prevents Atlassian Stash from starting correctly:

  • The database, as currently configured, is not accessible.

The stash log shows the following:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'crowdUserDao' defined in class path resource [crowd-spi-context.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.transaction.PlatformTransactionManager]: : Error creating bean with name 'pluginConfiguration' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginPersistentStateStore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginPersistentStateStore' defined in class path resource [stash-context.xml]: Cannot create inner bean 'com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore#79720870' of type [com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.stash.internal.plugin.DefaultPluginPersistentStateStore#79720870' defined in class path resource [stash-context.xml]: Cannot resolve reference to bean 'pluginStateDao' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pluginStateDao' defined in URL [jar:file:/opt/atlassian/atlassian-stash-2.2.0/atlassian-stash/WEB-INF/lib/stash-dao-impl-2.2.0.jar!/com/atlassian/stash/internal/plugin/HibernatePluginStateDao.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.hibernate.SessionFactory]: : Error creating bean with name 'databaseService': Invocation of init method failed; nested exception is com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:sqlserver://XXX;databaseName=XXX;, username = XXX. Terminating connection pool. Original Exception: ------

com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'XXX'. ClientConnectionId:656e6fe7-88c3-4d39-9e70-4642c5135447

The stash-config.properties was migrated to jdbc in the 2.1.x upgrade, and is the following (anonymized of course):

jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver

jdbc.url=jdbc:sqlserver://XXX;databaseName=XXX

jdbc.user=XXX

jdbc.password=XXX

If I shut Stash 2.2.0 down and go to the 2.1.2 folder, I can run start-stash.sh in the bin subfolder and it starts right up. I switch back to 2.2.0 and I go back to "login failed". Since I can go back to 2.1.2 with the same jdbc values and the same file, I don't feel it's likely the ms-sql account is locked out.
Did something change in 2.2.0? Our username and password contains special characters consisting from the pool of !@#$%^&*() (the shift-number values on a US keyboard). Could 2.2.0 not be thrilled with our characters now?

2 answers

1 accepted

I figured it out. There was a space at the end of the password line. Whatever Atlassian used in Stash 2.1.2 stopped at the end of the alpha-numeric character string, Stash 2.2.0's parser is now including everything, including the space. I removed the space and now Stash 2.2.0 starts up fine. Marking as resolved.

0 vote
Bryan Turner Atlassian Team Mar 05, 2013

Kelly,

There were some changes around how the connections are opened in 2.2, though nothing that should affect how it handles special characters in the username or password. Could you please open a support request so that we can work with you more directly? Once we've found the root cause, we can then update this question with an answer to hopefully benefit anyone else who encounters the issue.

Looking forward to hearing from you,
Bryan Turner

I did open up a support request, just refreshing this so it quits bugging me to close this. I plan on closing this with the resolution that Atlassian support comes up with, in case anyone else has the same issue.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

170 views 20 8
Join discussion

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