-
Bug
-
Resolution: Fixed
-
High
-
5.10.7, 6.1.2, 6.14.0, 7.4.3, 7.4.4, 7.14.0, 7.20.0
-
74
-
Severity 3 - Minor
-
47
-
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
- Create a page and Insert JIRA issue macro
- 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)
- Select Total Issue count from the Display options drop down in JIRA issues macro
- Insert the Macro
- 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.
- 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)
- CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=<value> ${CATALINA_OPTS}"
- Restart Confluence
- Repeat steps 1 to 4
- 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.
- Click on the Source editor Icon <> to display the page's XHTML content.
- 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>
- Add the following line into the list of parameters nested within the structured-macro tags:
#*<ac:parameter ac:name="count">true</ac:parameter>
- 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>
- 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.
- Navigate /Users/mmadrid/confluence/atlassian-confluence-8.2.3/confluence/WEB-INF/atlassian-bundled-plugins
- Find com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar
- Create a directory and copy JAR file to it.
- mkdir testJar ; cp com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar ./testJar ; cd testJar
- Extract JAR
- jar xf com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar
- Open core.js in editor.
- vi core.js
- 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.
- Returned r.a.Editor.UI.setButtonsState
- Find DEFAULT_INSERT_MACRO_TIMEOUT
- Returned: {{var Xt=
Unknown macro: {DEFAULT_INSERT_MACRO_TIMEOUT}}
- Returned: {{var Xt=
- Modify above with colon and code letters and Meta.get("macro-placeholder-timeout")
- To :r.a.Meta.get("macro-placeholder-timeout")
- Add new code to core.js
- From var Xt={DEFAULT_INSERT_MACRO_TIMEOUT:5e3
- To var Xt={DEFAULT_INSERT_MACRO_TIMEOUT:r.a.Meta.get("macro-placeholder-timeout")
- Insert back in correct path, Example
setButtonsState(!0)}),a.promise()}var Xt={DEFAULT_INSERT_MACRO_TIMEOUT:r.a.Meta.get("macro-placeholder-timeout"),insertMacro
- 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%)
- 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
- Move default to new directory.
mv com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar.orig testJar/
- Move modifed JAR to atlassian-bundled-plugins directory.
mv ./testJar/com.atlassian.confluence.plugins.confluence-editor-plugin-9.1.1.jar .
- Restart Confluence.
- relates to
-
CONFSERVER-74871 Edit pages with a lot of JIRA issues macros using "total issue count" takes a long time
- Closed
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...