Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-53469

Insert JIRA Macro - Timeout while getting placeholder, Rendering this content exceeded the timeout of 5 seconds

    XMLWordPrintable

Details

    Description

      Information

      This issue has been resolved by reinstating the system property of confluence.macro.placeholder.timeoutMillis

      For versions of confluence:

      • 6.5.3 to (not including) 6.6.0
      • 6.6.1 to (not including) 6.14.0
      • 7.13.19 to (not including) 7.14.0
      • 7.19.11 to (not including) 7.20.0
      • 8.4.0 and newer

      Please use the confluence.macro.placeholder.timeoutMillis system property to increase the timeout of the placeholder.

      For other versions not mentioned above, please use the workarounds provided in the the issue below

      Summary

      When using JIRA macro (with Total issue count selected in the Display options), displays Error 'Timeout while getting placeholder. Please try again shortly.'  when inserting the macro and the Confluence logs logged the message "Rendering this content exceeded the timeout of 5 seconds." even if confluence.macro.placeholder.timeoutMillis is set.

      Steps to reproduce

      1. Create a page and Insert JIRA issue macro
      2. Use JQL similar to project=confserver and issuetype="bug" and status was Open after -5d (note: This JQL took 7.5 seconds to return data from JAC)
      3. Select Total Issue count from the Display options drop down in JIRA issues macro
      4. Insert the Macro 
      5. After 5 seconds, Editor throws an error "Timeout while getting placeholder, Please try again shortly", Confluence logs logged the message "Rendering this content exceeded the timeout of 5 seconds.
      6. Set the system property value to change the default timeout from 5 seconds to much higher value (It was set to 10 seconds for this test)
      7. CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=<value> ${CATALINA_OPTS}"
      8. Restart Confluence
      9. Repeat steps 1 to 4
      10. The page Editor still throws the same error "Timeout while getting placeholder, Please try again shortly"

      Expected Results

      JIRA Macro should get inserted in the page without any errors

      Actual Results

      The editor Errors out as  'Timeout while getting placeholder. Please try again shortly.'  

      It is observed the placeholder timeout value in the Javascript doesn't respect the confluence.macro.placeholder.timeoutMillis parameter and it defaults to 5 seconds.

      Workaround

      No workaround for Confluence older than 6.5.3 or 6.6.1

      For newer versions as stated above, setting the confluence.macro.placeholder.timeoutMillis to a higher value e.g. 10000 will override the timeout.

       Workaround for Affected versions 7.x and greater

      Option 1

      Recommended approach
       # Edit page with placeholder issue.

      1. Click on the Source editor Icon <> to display the page's XHTML content.
      2. Locate the block of XHTML that represents the macro:
        • <ac:structured-macro ac:macro-id="78f1bf71-283c-431a-a7ea-f6faf8db2cc1" ac:name="jira" ac:schema-version="1">
              <ac:parameter ac:name="server">Jira</ac:parameter>
              <ac:parameter ac:name="jqlQuery">project = "MARS"  </ac:parameter>
              <ac:parameter ac:name="serverId">f192aac9-bcb6-33f2-b5ba-70909652951a</ac:parameter>
            </ac:structured-macro>
          
      3. Add the following line into the list of parameters nested within the structured-macro tags:
        #*
        <ac:parameter ac:name="count">true</ac:parameter>
        
      4. Example:
        • <ac:structured-macro ac:macro-id="78f1bf71-283c-431a-a7ea-f6faf8db2cc1" ac:name="jira" ac:schema-version="1">
              <ac:parameter ac:name="server">Jira</ac:parameter>
              <ac:parameter ac:name="jqlQuery">project = "MARS"  </ac:parameter>
              <ac:parameter ac:name="count">true</ac:parameter>
              <ac:parameter ac:name="serverId">f192aac9-bcb6-33f2-b5ba-70909652951a</ac:parameter>
            </ac:structured-macro>
          
      5. Save this and the page, then check if the Issue Count displays.

      Option 2

      This option is more involved via the JAR file but doesn't require users to update the macro every time.
      There are different JAR files depending on the Confluence major version.

      • Confluence version 7: confluence-editor-v4-<version>.jar AND editor.js file.
      • Confluence version 8: com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar AND core.js file.

      Resources

      The resource to manipulate JAR files: How to edit files in Confluence JAR files.

      Steps

      Example for Confluence version 8.2.3.

      1. Navigate /Users/mmadrid/confluence/atlassian-confluence-8.2.3/confluence/WEB-INF/atlassian-bundled-plugins
      2. Find com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar
      3. Create a directory and copy JAR file to it.
        1. mkdir testJar ; cp com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar ./testJar ; cd testJar
      4. Extract JAR
        1. jar xf com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar
      5. Open core.js in editor.
        1. vi core.js
      6. Find Editor.UI.setButtonsState
        • Note that the first part of this code "g.a." will be different per version of Confluence. use "Editor.UI.setButtonsState" earlier in the code to determine the right letters to use.
        1. Returned r.a.Editor.UI.setButtonsState
      7. Find DEFAULT_INSERT_MACRO_TIMEOUT
        1. Returned: {{var Xt=
          Unknown macro: {DEFAULT_INSERT_MACRO_TIMEOUT}}
      8. Modify above with colon and code letters and Meta.get("macro-placeholder-timeout")
        • To :r.a.Meta.get("macro-placeholder-timeout")
      9. Add new code to core.js
        1. From var Xt={DEFAULT_INSERT_MACRO_TIMEOUT:5e3
        2. To var Xt={DEFAULT_INSERT_MACRO_TIMEOUT:r.a.Meta.get("macro-placeholder-timeout")
      10. Insert back in correct path, Example
        • setButtonsState(!0)}),a.promise()}var Xt={DEFAULT_INSERT_MACRO_TIMEOUT:r.a.Meta.get("macro-placeholder-timeout"),insertMacro
          
      11. Compress JAR after corrections. jar uvf <JAR file> <path to edited file>
        • (base) GLQC6P379N:testJar mmadrid$ jar uvf com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar core.js
          adding: core.js(in = 416369) (out= 128888)(deflated 69%)
          
      12. Mark original JAR as default.
        • mv com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar.orig
          
      13. Move default to new directory.
        •  mv com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar.orig testJar/
          
      14. Move modifed JAR to atlassian-bundled-plugins directory.
        • mv ./testJar/com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar . 
          
      15. Restart Confluence.

      Attachments

        Issue Links

          Activity

            People

              ephillips@atlassian.com Edward
              pyarakala Praveen Yarakala (Inactive)
              Votes:
              34 Vote for this issue
              Watchers:
              61 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: