Stash SQLServer Setup

Dave May 13, 2013

Hi,

I am trying to setup a new stash server with Sqlserver 2012 SP1

When getting up to the web based stash installer I put in my DB details I get

A database error has occurred.

I was wondering where I could find more details on what the error actually is?

Thanks,

4 answers

1 accepted

1 vote
Answer accepted
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2013

dkaing,

Foremost, apologies for the difficulties here. It appears I regressed our error handling while I was making other changes. I've created STASH-3448 to track this issue. The fix will be included in our 2.4.2 release.

In the interim, since I know that doesn't benefit you much, there are two possible approaches for getting more useful messaging.

Option 1: Turn up debug logging

Modify stash-config.properties (in your STASH_HOME directory--you may need to create it if it doesn't already exist) to include the following:

logging.logger.ROOT=DEBUG
logging.logger.com.atlassian.stash=DEBUG

The exception that is preventing setup should appear in the debug logs.

Option 2: Directly configure the database

If you are trying to migrate, you cannot use this approach. For a clean setup, though, you can directly modify stash-config.properties to add the following 4 properties:

jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://HOST:PORT;databaseName=NAME;
jdbc.user=USER
jdbc.password=PASSWORD

Where "HOST" is the database host, "PORT" is the port (may be omitted if SQL Server is listening on 1433), and "NAME" is the database name.

If you're attempting to use some of the more interesting/exotic SQL Server options, you must modify stash-config.properties directly in this fashion. Attempting to tease non-standard settings into the JDBC URL via the UI is unsupported and almost certain to cause failures.

If there is an error with your configuration, Stash will fail to start and display an error page in the browser. In the logs you'll be able to see the exception thrown by the JDBC driver.

Again, my apologies for the ugliness of both possible approaches.

Best regards,
Bryan Turner
Atlassian Stash

Dave May 13, 2013

Is there a way to use windows auth instead of SQL auth?

Thanks,

Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2013

dkaing,

Yes, it is possible. However, it is not supported (or even possible) via the Stash UI. See Connecting Stash to SQL Server, specifically the "Use Integrated Authentication (Optional)" section, at the bottom of the page, for a description of how to do it.

Best regards,
Bryan Turner
Atlassian Stash

Matthew Crockett May 15, 2013

Bryan Turner,

In order to use 'Option 2' as given above - is there a preferred method to get past the Stash Installer screen that requires the user to select an Internal or External database?

Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2013

Matthew,

As dkaing has noted, if you manually configure the database in stash-config.properties, Stash detects that in setup and, if it is able to connect using your configured settings, automatically skips over the database setup screen.

If you manually configure the database and Stash is unable to connect, you will not get a setup screen. Instead, you'll get an error page stating "The database, as currently configured, is not accessible." Because that error screen will be shown to unauthenticated users, the exact error is not displayed. However, the server logs will include it.

Additionally, I have fixed the error handling regression that hides the errors during database migration. That fix will be included in 2.4.2, which will be relased early next week.

Best regards,
Bryan Turner
Atlassian Stash

0 votes
Dave May 16, 2013

If you do option 2 that prompt will not happen.

0 votes
Dave May 13, 2013

Nothing really useful in there. See below:

2013-05-14 11:40:03,654 INFO  [localhost-startStop-1]  c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory E:\Resources\StashHome for 2704@GIT01
2013-05-14 11:40:04,964 WARN  [localhost-startStop-1]  com.jolbox.bonecp.BoneCPConfig JDBC password not set in driver properties, copying it from pool config
2013-05-14 11:40:10,175 INFO  [localhost-startStop-1]  c.a.s.i.l.SetHierarchyIdsChange No repositories exist; no hierarchy IDs need to be set
2013-05-14 11:40:28,224 WARN  [localhost-startStop-1]  c.a.s.i.license.LicenseServiceImpl No license has been configured.
2013-05-14 11:40:32,436 INFO  [localhost-startStop-1]  c.a.s.i.server.ApplicationInfoLogger Starting Stash 2.4.1 (9f6e2ca0ba built on Tue May 07 17:38:31 EST 2013)
2013-05-14 11:40:32,436 INFO  [localhost-startStop-1]  c.a.s.i.server.ApplicationInfoLogger JVM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b11
2013-05-14 11:40:32,686 INFO  [localhost-startStop-1]  c.a.s.i.hook.DefaultHookService Hook callback socket listening on 127.0.0.1:63732
2013-05-14 11:40:41,516 WARN  [localhost-startStop-1]  c.a.p.o.f.t.s.ScanDescriptorForHostClassesStage The plugin 'atlassian-universal-plugin-manager-plugin-2.10.1.jar' uses a package 'org.apache.commons.fileupload.servlet' that is also exported by the application.  It is highly recommended that the plugin use its own packages.
2013-05-14 11:40:50,174 WARN  [Spring executor 4]  o.s.beans.TypeConverterDelegate PropertyEditor [com.sun.beans.editors.EnumEditor] found through deprecated global PropertyEditorManager fallback - consider using a more isolated form of registration, e.g. on the BeanWrapper/BeanFactory!
2013-05-14 11:40:56,320 INFO  [Spring executor 34]  c.a.stash.ssh.server.SshServer Starting SSH server on port 7999...
2013-05-14 11:40:56,352 INFO  [Spring executor 34]  c.a.stash.ssh.server.SshServer Started SSH server successfully.
2013-05-14 11:40:57,038 WARN  [localhost-startStop-1]  c.a.s.r.SoyResourceModuleDescriptor soy-resource is deprecated. Please convert com.atlassian.auiplugin:aui-experimental-soy-templates to a web-resource and/or a soy-function
2013-05-14 11:40:57,038 WARN  [localhost-startStop-1]  c.a.s.r.SoyResourceModuleDescriptor soy-resource is deprecated. Please convert com.atlassian.auiplugin:aui-experimental-soy-templates-2 to a web-resource and/or a soy-function
2013-05-14 11:40:57,038 WARN  [localhost-startStop-1]  c.a.s.r.SoyResourceModuleDescriptor soy-resource is deprecated. Please convert com.atlassian.auiplugin:aui-experimental-soy-templates-legacy1 to a web-resource and/or a soy-function
2013-05-14 11:40:58,021 INFO  [localhost-startStop-1]  c.a.stash.internal.home.HomeTracker Capturing benchmark home directory: E:\Resources\StashHome
2013-05-14 11:40:58,021 INFO  [localhost-startStop-1]  c.a.s.i.s.g.u.ConfigReflogExpiryTask Updating configuration of existing git repositories
2013-05-14 11:40:58,021 INFO  [localhost-startStop-1]  c.a.s.i.s.g.u.ConfigReflogExpiryTask Configuration update completed
2013-05-14 11:41:22,872 INFO  [localhost-startStop-1]  c.a.s.internal.scm.PluginScmService Stash is using C:\Program Files (x86)\Git\cmd\git.exe version 1.8.1
2013-05-14 11:48:22,049 INFO  [localhost-startStop-2]  c.a.s.i.server.ApplicationInfoLogger Shutting down Stash 2.4.1
2013-05-14 11:48:22,938 INFO  [Timer-2]  c.a.stash.ssh.server.SshServer Stopping SSH server...
2013-05-14 11:48:22,938 INFO  [Timer-2]  c.a.stash.ssh.server.SshServer Stopped SSH server successfully.
2013-05-14 11:48:23,204 INFO  [localhost-startStop-2]  c.a.s.internal.home.HomeLockAcquirer Releasing lock on E:\Resources\StashHome
2013-05-14 12:03:56,343 INFO  [localhost-startStop-1]  c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory E:\Resources\StashHome for 2884@GIT01
2013-05-14 12:03:57,654 WARN  [localhost-startStop-1]  com.jolbox.bonecp.BoneCPConfig JDBC password not set in driver properties, copying it from pool config
2013-05-14 12:04:16,202 WARN  [localhost-startStop-1]  c.a.s.i.license.LicenseServiceImpl No license has been configured.
2013-05-14 12:04:20,820 INFO  [localhost-startStop-1]  c.a.s.i.server.ApplicationInfoLogger Starting Stash 2.4.1 (9f6e2ca0ba built on Tue May 07 17:38:31 EST 2013)
2013-05-14 12:04:20,820 INFO  [localhost-startStop-1]  c.a.s.i.server.ApplicationInfoLogger JVM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b11
2013-05-14 12:04:21,054 INFO  [localhost-startStop-1]  c.a.s.i.hook.DefaultHookService Hook callback socket listening on 127.0.0.1:53880
2013-05-14 12:04:31,459 WARN  [Spring executor 17]  o.s.beans.TypeConverterDelegate PropertyEditor [com.sun.beans.editors.EnumEditor] found through deprecated global PropertyEditorManager fallback - consider using a more isolated form of registration, e.g. on the BeanWrapper/BeanFactory!
2013-05-14 12:04:35,453 INFO  [Spring executor 15]  c.a.stash.ssh.server.SshServer Starting SSH server on port 7999...
2013-05-14 12:04:35,484 INFO  [Spring executor 15]  c.a.stash.ssh.server.SshServer Started SSH server successfully.
2013-05-14 12:04:37,388 WARN  [localhost-startStop-1]  c.a.s.r.SoyResourceModuleDescriptor soy-resource is deprecated. Please convert com.atlassian.auiplugin:aui-experimental-soy-templates to a web-resource and/or a soy-function
2013-05-14 12:04:37,388 WARN  [localhost-startStop-1]  c.a.s.r.SoyResourceModuleDescriptor soy-resource is deprecated. Please convert com.atlassian.auiplugin:aui-experimental-soy-templates-2 to a web-resource and/or a soy-function
2013-05-14 12:04:37,388 WARN  [localhost-startStop-1]  c.a.s.r.SoyResourceModuleDescriptor soy-resource is deprecated. Please convert com.atlassian.auiplugin:aui-experimental-soy-templates-legacy1 to a web-resource and/or a soy-function
2013-05-14 12:04:38,090 INFO  [localhost-startStop-1]  c.a.s.internal.scm.PluginScmService Stash is using C:\Program Files (x86)\Git\cmd\git.exe version 1.8.1

Harry Chan
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.
May 13, 2013

Are there any logs found in the database server?

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.
May 13, 2013

Hi dkaing,

You can find the logs in $STASH_HOME/log/atlassian-stash.log. Do they give you anything more useful?

Cheers,

Charles

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events