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

Stash fails to connect to MySQL database if the user password contains special symbols

    XMLWordPrintable

Details

    Description

      Steps to reproduce:

      1. Create a mysql user with password 'test¡' (containing inverted exclamation mark)
      2. Migrate Stash database to a new database at Administration >> Settings >> Database
      3. Change the user to the new user with password 'test¡' (database migration successful)
      4. Restart Stash
      5. Stash can't startup with the following error:
        2013-04-22 19:34:25,194 ERROR [localhost-startStop-1]  o.s.web.context.ContextLoader Context initialization failed
        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#dce1387' 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#dce1387' 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:/Users/foong/Desktop/CustomWare/stash/atlassian-stash-2.3.1/atlassian-stash/WEB-INF/lib/stash-dao-impl-2.3.1.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:mysql://localhost:3306/stash_db?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=storage_engine%3DInnoDB, username = stash_usr. Terminating connection pool. Original Exception: ------
        
        com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        	at com.mysql.jdbc.Util.getInstance(Util.java:386)
        	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
        ...
        Caused by: java.sql.SQLException: Access denied for user 'stash_usr'@'localhost' (using password: YES)
        

      Attachments

        Activity

          People

            jhinch jhinch (Atlassian)
            klfoong Foong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: