Uploaded image for project: 'Migration Platform'
  1. Migration Platform
  2. MIG-1290

CCMA throws an error when running a migration with new CSV export on confluence configured with the MS SQL server


    • 17
    • Minor

      Issue Summary

      When trying to get the database CPU information, CCMA 3.4.0 throws an exception because the confluence db user doesn't have VIEW SERVER STATE permission to run the SQL query. Although the database CPU count query fails, CCMA 3.4.0 handles that case gracefully. It also just happens to be logging the error a bit misleading.

      This is reproducible on Data Center:

      Steps to Reproduce

      1. Install confluence with MS SQL Server
      2. Navigate to <confluence-url>/admin/darkfeatures.action
      3. Add the dark feature flag: migration-assistant.enable.new-space-export
      4. Create and run a new migration.

      Expected Results

      The migration should not produce any errors.

      Actual Results

      The below exception is thrown in the atlassian-confluence.log file:

      ERROR [Caesium-1-4] [agent.newexport.store.JdbcConfluenceStore] fetchInteger Query failed at: Query(sql=SELECT CPU_COUNT FROM sys.dm_os_sys_info, tableName=null, exportName=null, userkeyColums=[], preserveIdentifierCase=false)
      org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT CPU_COUNT FROM sys.dm_os_sys_info]; SQL state [S0001]; error code [300]; VIEW SERVER STATE permission was denied on object 'server', database 'master'.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: VIEW SERVER STATE permission was denied on object 'server', database 'master'.
       at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1542)
       at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667)
       at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:713)
       at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:738)
       at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:794)
       at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:243)
       at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:252)
       at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForObject(NamedParameterJdbcTemplate.java:268)
       at com.atlassian.migration.agent.newexport.store.JdbcConfluenceStore.fetchInteger(JdbcConfluenceStore.java:128)
       at com.atlassian.migration.agent.service.ClusterLimits.queryCpuCoreStatistic(ClusterLimits.java:152)
       at com.atlassian.migration.agent.service.ClusterLimits.runJob(ClusterLimits.java:102)


      The error is misleading and doesn't impact the migration. To avoid the error, grant the VIEW SERVER STATE permission to confluence db user.
      If CCMA is not in use, disabling the plugin on Confluence it makes the message go away.

            a3f474913183 Adam Miritis
            54bf2707b706 Deepak Pandey
            1 Vote for this issue
            12 Start watching this issue