Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

On Stash startup: A fatal error has occurred

Matt Riley
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2013

I have this exact issue: https://confluence.atlassian.com/display/STASHKB/The+database,+as+currently+configured,+is+not+accessible

The difference is that I'm running on Linux, connecting to SQL Server (not the internal DB) and the service is running as the root user. The root user owns and has proper permissions to STASH_HOME.

This error showed up right after I switched the link /opt/atlassian-stash-latest from /opt/atlassian-stash-2.1.0 to /opt/atlassian-stash-2.1.1.

My question: What changed in the point release that might cause this on Linux and how do I fix it?

Everything worked fine under 2.1.0. I'm hoping I don't have to reinitilize STASH_HOME from scratch.

Thanks

4 answers

1 accepted

0 votes
Answer accepted
Matt Riley
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2013

My problem was found in the <STASH_HOME>/stash-config.properties file. The SQL Server jdbc connection string that worked under 2.1.0 did not work under 2.1.1. The key difference is that I use a named instance on my SQL Server.

Below I have the two jdbc connection strings:

Broken (worked under 2.1.0 not 2.1.1)

jdbc:sqlserver://myServer\namedInstance:1433;databaseName=stash;

Fixed

jdbc:sqlserver://myServer:1433;instanceName=namedInstance;databaseName=stash;

This solution may be specific to my environment but if you run into this issue on Linux, you might want to check the jdbc connection string in your <STASH_HOME>/stash-config.properties file.

seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2013

Thanks Matt,

We've raised an issue for this to ensure that other SQLServer users don't run into this as well. Most appreciate the diagnosis!

https://jira.atlassian.com/browse/STASH-3108

Seb

0 votes
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2013

Matt,

First off, thanks for taking the time both to raise the question and to post your answer with your solution. As one of the Stash developers, I'm sorry for the inconvenience.

Correct me if I'm wrong, but did you install Stash 2.1.0 and set it up (or migrate it) to SQL Server, and then restart to upgrade to 2.1.1? I'm guessing when you configured it you entered "myServer\namedInstance" in the hostname box, and migration or setup completed normally. The upgrade to 2.1.1 was probably the first time you had restarted the server after that.

As Charles has correctly pointed out, there are no changes to how the database is accessed between 2.1.0 and 2.1.1 (though 2.1.2 does include fixes for SQL Server 2005 users). However, I believe that you have uncovered a bug in how our database configuration screens work. I've raised https://jira.atlassian.com/browse/STASH-3108 to fix that issue.

To sum up, "myServer\namedInstance" in the hostname box will correctly connect to SQL Server during migration or setup, but the first time the system is restarted, because saving the configuration did not escape the \ (because that usage not actually supported by Stash), the \ is lost and the value becomes "myServernamedInstance", which causes the connection to fail.

Your solution is fine, or you could modify the configuration manually and change it to this:

jdbc:sqlserver://myServer\\namedInstance:1433;databaseName=stash;

That should also connect correctly. This has the additional advantage that your details will appear correctly (with only a single \) on the database configuration screens in Stash.

Please watch the linked issue to be updated on when a fix for this bug will be shipped.

Best regards
Bryan Turner

0 votes
seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2013

Hi Matt,

The best thing to do here would be to raise a support ticket at http://support.atlassian.com - there we can identify the root cause of the issue and hopefully it's not a bug in Stash.

Out of interest, which database server are you using?

Seb

0 votes
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2013

Hi Matt,

This is most surprising given that the major fix for 2.1.1 was a Javascript change only. This obviously shouldn't be causing the error you're seeing. It's more likely that there is a connection problem to the database (or something like that). Your STASH_HOME directory will be fine and won't require any reinitialization.

At this point it would be handy to see the full exception which tell us more. If you wouldn't mind creating a support ticket with your full logs attached that will help us dialog the problem further.

https://support.atlassian.com/

Cheers,

Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events