Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-3540

Add schema support when connecting Stash to SQL Server, PostgreSQL and Oracle

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 16
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Steps to reproduce:

      SQL Server

      1. Create a database 'atlassian'
      2. Create a schema name 'stash' in the database
      3. Create a user 'stash' with the default schema 'stash'
      4. Connect Stash server with SQL server database 'atlassian'

      All the tables are created in the default schema 'dbo' except for AO tables created in schema 'stash'

      Oracle

      1. Create a database user 'stash'
      2. Grant all the permission to the user 'stash' on the schema 'stash'
      3. Grant another access permission to the user 'stash' on the schema 'crowd' (schema 'crowd' has been used by Crowd application)
      4. Migrate Stash database from HSQLDB to Oracle through the UI
        It will fail with the following error:
        2014-02-07 12:09:03,235 ERROR [http-bio-7990-exec-7] 728x27x0 jv58e6 10.123.16.180 "POST /setup HTTP/1.1" c.a.s.i.db.DefaultDatabaseManager Failed to obtain session factory
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_allow_all in CROWD.CWD_APP_DIR_MAPPING
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
        	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1129) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
        	at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:337) [stash-service-impl-2.10.1.jar:na]
        	at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:158) [stash-service-impl-2.10.1.jar:na]
        

        it seems that Stash somehow try to use the schema 'crowd' cause the database user 'stash' have access permission to it.

            [BSERV-3540] Add schema support when connecting Stash to SQL Server, PostgreSQL and Oracle

            I have the same issue as @Sander Brienen

            Stefan Filipiak added a comment - I have the same issue as @Sander Brienen

            We have running JIRA, Confluence and Bamboo against PostgreSQL with its own schema without any problems. Only Stash breaks when trying to install it against PostgreSQL with a different schema then 'public'.

            Sander Brienen [Avisi] added a comment - We have running JIRA, Confluence and Bamboo against PostgreSQL with its own schema without any problems. Only Stash breaks when trying to install it against PostgreSQL with a different schema then 'public'.

            It actually work if you alter the stash-config.properties file manually and point out the database with user and all instead of running the database migration wizard. At least it work for PostgreSQL database.

            I stopped Stash.
            Altered the file stash-config.propterites
            Cleared the schema that the database has set as default for the user
            Started Stash - now it created all the tables correctly.

            #>*******************************************************
            #> Updated by Linus Lindroth on 2015-01-15T16:37:22.731+01:00
            #>*******************************************************
            jdbc.driver=org.postgresql.Driver
            jdbc.url=jdbc:postgresql://<servername>:5432/gjirad01
            jdbc.user=teststashgtt
            jdbc.password=**********

            Linus Lindroth added a comment - It actually work if you alter the stash-config.properties file manually and point out the database with user and all instead of running the database migration wizard. At least it work for PostgreSQL database. I stopped Stash. Altered the file stash-config.propterites Cleared the schema that the database has set as default for the user Started Stash - now it created all the tables correctly. #>******************************************************* #> Updated by Linus Lindroth on 2015-01-15T16:37:22.731+01:00 #>******************************************************* jdbc.driver=org.postgresql.Driver jdbc.url=jdbc:postgresql://<servername>:5432/gjirad01 jdbc.user=teststashgtt jdbc.password=**********

            Apparently JIRA already has such support (it's not clear) – https://ecosystem.atlassian.net/browse/AO-204

            Confluence does not – CONF-12456

            Sergey Svishchev added a comment - Apparently JIRA already has such support (it's not clear) – https://ecosystem.atlassian.net/browse/AO-204 Confluence does not – CONF-12456

            Andreas K. added a comment -

            Hi,
            Thx for opening this issue. Even if this is a minor issue it has a reasonable impact on an integrated Atlassian deployment.
            I now have to run 3 databases with SQL Server instead of 2 for running Jira, Confluence, Bamboo, Fisheye, Crowd and Stash.
            Is there any way of fixing this?
            Cheers & thx,
            Andreas

            Andreas K. added a comment - Hi, Thx for opening this issue. Even if this is a minor issue it has a reasonable impact on an integrated Atlassian deployment. I now have to run 3 databases with SQL Server instead of 2 for running Jira, Confluence, Bamboo, Fisheye, Crowd and Stash. Is there any way of fixing this? Cheers & thx, Andreas

              Unassigned Unassigned
              klfoong Foong (Inactive)
              Votes:
              16 Vote for this issue
              Watchers:
              25 Start watching this issue

                Created:
                Updated: