Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-844

Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Highest Highest
    • 9.0.2
    • 9.0.1
    • Configuration
    • None
    • Severity 1 - Critical

      Issue Summary

      After upgrading Automation for Jira (A4J) from any version below 9.0.1 to the version 9.0.1 (or any higher version), the following issues might be observed:

      • When trying to enable or disable a rule, the following error is thrown in the UI:
        Error
        Error while updating rule. Error
        Please reload and try again.
        

      • When trying to publish a rule, the following error is thrown in the UI:
        An unknown error occurred. Please reload and try again
        

      • When trying to manage the Secret Keys via the page ⚙ > System > Automation for Jira > ... > Manage Secret Keys, the following error is thrown in the UI:
        Something went wrong during the last request, please try again later.
        

      Environment

      • Jira Server/Data Center on any version from 8.20.0
      • Automation For Jira (A4J) on any version from Jira 9.0.1
      • This bug might only occur if Jira is using a MSSQL or MySQL Database (other data base types are not impacted), and if Automation for Jira was installed at some point with a version lower than 7.3.0

      Steps to replicate

      • Install Jira Software DC on 8.20.25, with a MSSQL DB Server
      • Install A4J 7.2.0
      • Upgrade A4J to 8.1.2
      • Upgrade again A4J to 9.0.1
      • Try to manage Secret Keys (feature introduced in Jira 9.0.1) via the page ⚙  > System > Automation for Jira, by clicking on ... > Manage Secret Keys.

      Expected behavior

      It should be possible to access the Manage Secret Keys page.

      Actual behavior

      The following error is thrown in the UI:

      Something went wrong during the last request, please try again later.
      

      Additionally, the following issues might also occur:

      • When trying to enable or disable a rule, an error is thrown in the UI
      • When trying to publish a rule, an error is thrown in the UI

      The following error is thrown in the Jira logs:

      • In case of MSSQL
        2023-08-31 14:53:40,570+0200 http-nio-80-exec-3 ERROR someuser 893x784x6 k0zbpv 0:0:0:0:0:0:0:1 /rest/cb-automation/latest/secrets/GLOBAL [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Caught SQLServerException for select "AO_589059_RULE_SECRET"."ID", "AO_589059_RULE_SECRET"."KEY", "AO_589059_RULE_SECRET"."VALUE", "AO_589059_RULE_SECRET"."ID", "AO_589059_RULE_SECRET"."KEY", "AO_589059_RULE_SECRET"."VALUE", "AO_589059_SECRET_PROJ_ASSOC"."PROJECT_ID"
            from "jira"."AO_589059_RULE_SECRET" "AO_589059_RULE_SECRET"
            left join "jira"."AO_589059_SECRET_PROJ_ASSOC" "AO_589059_SECRET_PROJ_ASSOC"
            on "AO_589059_RULE_SECRET"."ID" = "AO_589059_SECRET_PROJ_ASSOC"."RULE_SECRET_ID"
        com.querydsl.core.QueryException: Caught SQLServerException for select "AO_589059_RULE_SECRET"."ID", "AO_589059_RULE_SECRET"."KEY", "AO_589059_RULE_SECRET"."VALUE", "AO_589059_RULE_SECRET"."ID", "AO_589059_RULE_SECRET"."KEY", "AO_589059_RULE_SECRET"."VALUE", "AO_589059_SECRET_PROJ_ASSOC"."PROJECT_ID"
        from "jira"."AO_589059_RULE_SECRET" "AO_589059_RULE_SECRET"
        left join "jira"."AO_589059_SECRET_PROJ_ASSOC" "AO_589059_SECRET_PROJ_ASSOC"
        on "AO_589059_RULE_SECRET"."ID" = "AO_589059_SECRET_PROJ_ASSOC"."RULE_SECRET_ID"
            at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
         
        ...
        
        Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'jira.AO_589059_RULE_SECRET'.
        
      • In case of MySQL
        2023-09-05 12:15:27,855+0000 http-nio-8080-exec-128 ERROR someuser 735x28584544x4 dguzsz 0:0:0:0:0:0:0:1 /rest/cb-automation/latest/secrets/11901 [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Caught SQLSyntaxErrorException for select `AO_589059_RULE_SECRET`.`ID`, `AO_589059_RULE_SECRET`.`KEY`, `AO_589059_RULE_SECRET`.`VALUE`, `AO_589059_RULE_SECRET`.`ID`, `AO_589059_RULE_SECRET`.`KEY`, `AO_589059_RULE_SECRET`.`VALUE`, `AO_589059_SECRET_PROJ_ASSOC`.`PROJECT_ID`
            from `AO_589059_RULE_SECRET` `AO_589059_RULE_SECRET`
            left join `AO_589059_SECRET_PROJ_ASSOC` `AO_589059_SECRET_PROJ_ASSOC`
            on `AO_589059_RULE_SECRET`.`ID` = `AO_589059_SECRET_PROJ_ASSOC`.`RULE_SECRET_ID`
        com.querydsl.core.QueryException: Caught SQLSyntaxErrorException for select `AO_589059_RULE_SECRET`.`ID`, `AO_589059_RULE_SECRET`.`KEY`, `AO_589059_RULE_SECRET`.`VALUE`, `AO_589059_RULE_SECRET`.`ID`, `AO_589059_RULE_SECRET`.`KEY`, `AO_589059_RULE_SECRET`.`VALUE`, `AO_589059_SECRET_PROJ_ASSOC`.`PROJECT_ID`
        from `AO_589059_RULE_SECRET` `AO_589059_RULE_SECRET`
        left join `AO_589059_SECRET_PROJ_ASSOC` `AO_589059_SECRET_PROJ_ASSOC`
        on `AO_589059_RULE_SECRET`.`ID` = `AO_589059_SECRET_PROJ_ASSOC`.`RULE_SECRET_ID`
            at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
        
        ...
        
        Caused by: java.sql.SQLSyntaxErrorException: Table 'jiradb.ao_589059_rule_secret' doesn't exist
        

      Workaround

      Follow the workaround steps described in the KB article Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version

      Note about the fix introduced in the version 9.0.2

      The fix consists in executing the SQL scripts for Jira applications using the MySQL or the MSSQL Database which should have been executed at the time A4J was upgraded to 7.3+ as per the documentation Upgrading to Automation for Jira 7.3 or later.

       Note that this fix will only work if A4J is upgraded directly from 8.x to 9.0.2 or any higher version. If A4J has already been upgraded to 9.0.1, upgrading to 9.0.2 or any higher version will not help. In this case, the SQL scripts need to be executed manually and directly in the Jira DB. Please refer to the KB article Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version for more details on how to do this.

        1. Error1.png
          Error1.png
          236 kB
        2. Error2.png
          Error2.png
          194 kB
        3. Error3.png
          Error3.png
          366 kB

            [JIRAAUTOSERVER-844] Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version

            I also want to note that: 

            We recently upgraded JSM from 5.4.5 to 5.4.15. Post upgrade, we upgraded A4J from 8.2.4 to 9.0.3 and we are encountering the same issue with enabling and disabling rule. The fix requires Jira to be taken offline. This is obviously very much NOT ideal.

            Can we update the KB to note that this issue can still happen when updating from 8.2.4 to 9.0.4?
            If these version can break the add-on, can we take the versions down from Marketplace?

            Amit Jambusaria added a comment - I also want to note that:  We recently upgraded JSM from 5.4.5 to 5.4.15. Post upgrade, we upgraded A4J from 8.2.4 to 9.0.3 and we are encountering the same issue with enabling and disabling rule. The fix requires Jira to be taken offline. This is obviously very much NOT ideal. Can we update the KB to note that this issue can still happen when updating from 8.2.4 to 9.0.4? If these version can break the add-on, can we take the versions down from Marketplace?

            I want to note that:

            "  Note that this fix will only work if A4J is upgraded directly from 8.x to 9.0.2 or any higher version. If A4J has already been upgraded to 9.0.1, upgrading to 9.0.2 or any higher version will not help. In this case, the SQL scripts need to be executed manually and directly in the Jira DB. Please refer to the KB article Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version for more details on how to do this"

            is not the case. I upgraded Jira from from 9.4.8 - 9.12.1 which upgrade A4J from 8.2.0 - 9.0.3 and the exact problem still persisted. After running through the Fix action things seem to be happy again.  We run MS SQL. 

            Christopher Hodges added a comment - I want to note that: "   Note that  this fix will only work if A4J is upgraded directly from 8.x to 9.0.2 or any higher version . If A4J has already been upgraded to 9.0.1, upgrading to 9.0.2 or any higher version will not help. In this case, the SQL scripts need to be executed manually and directly in the Jira DB. Please refer to the KB article  Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version for more details on how to do this" is not the case. I upgraded Jira from from 9.4.8 - 9.12.1 which upgrade A4J from 8.2.0 - 9.0.3 and the exact problem still persisted. After running through the Fix action things seem to be happy again.  We run MS SQL. 

            There seems to be an another issue: some of the rules after upgrade fails randomly.

            SEBtheSaviour added a comment - There seems to be an another issue: some of the rules after upgrade fails randomly.

            Bug introduced in our instances after upgrade to JSW 9.9.1 and JSM 5.9.1 and upgrade of automations from 8.2.2 to 9.0.1
            Upgrades was done with a couple of weeks between, upgrade of JSW 9.9.1 and JSM 5.9.1 was done first. 
            So I do not know if bug was introduced direct with upgrade of JSW/JSM or if it came with automations upgrade.
            We run MSSQL and have consumed automations since version 4 or 5.

            Ulf Johansson added a comment - Bug introduced in our instances after upgrade to JSW 9.9.1 and JSM 5.9.1 and upgrade of automations from 8.2.2 to 9.0.1 Upgrades was done with a couple of weeks between, upgrade of JSW 9.9.1 and JSM 5.9.1 was done first.  So I do not know if bug was introduced direct with upgrade of JSW/JSM or if it came with automations upgrade. We run MSSQL and have consumed automations since version 4 or 5.

            Atlassian Update – 18 Sep 2023

             

            Dear Customers,

            Thank you for taking the time to file and comment on this issue. Feedback like yours helps us release valuable Jira features that solve problems for a greater customer base. To that end, we aim to keep our issues up-to-date so they accurately reflect current customer needs. Based on the impact, we’ve decided to move this issue to our short-term backlog.

            The workaround for this bug is described in this KB article: Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version

            Please continue watching this ticket for future updates and changes in the timeline that impacts your work.

            Best regards

            Anna Przybycień

            Jira DC Developer

             

            Anna Przybycień added a comment - Atlassian Update – 18 Sep 2023   Dear Customers, Thank you for taking the time to file and comment on this issue. Feedback like yours helps us release valuable Jira features that solve problems for a greater customer base. To that end, we aim to keep our issues up-to-date so they accurately reflect current customer needs. Based on the impact, we’ve decided to move this issue to our short-term backlog. The workaround for this bug is described in this KB article: Automation rules cannot be enabled, disabled or published after an upgrade of Automation for Jira to 9.0.1 or a higher version Please continue watching this ticket for future updates and changes in the timeline that impacts your work. Best regards Anna Przybycień Jira DC Developer  

              7d61d3d60e1c Mateusz Beczek
              jrey Julien Rey
              Affected customers:
              4 This affects my team
              Watchers:
              26 Start watching this issue

                Created:
                Updated:
                Resolved: