Confluence Widget Issue
Asked by CenturyX476:

Hello,

I am trying to add a Widget to a page in confluence and attached a youtube link to it.

I Can preview it normally as you can see below

![Preview.jpg](/t5/image/serverpage/image-id/33442i2B36491C4B388EC2/image-size/large?v=v2&px=999 "Preview.jpg")

But when I try to add the Widget I get this error

![Error.jpg](/t5/image/serverpage/image-id/33443i67A0D13CACF34CC7/image-size/large?v=v2&px=999 "Error.jpg")

Here is the log file when it errors out.

It says the timeout is 5 seconds but no where in my settings for confluence is anything set to 5 seconds.

I am self hosted on my own boxes

Windows Server 2016 with a MSSQL back-end

How can I resolve this ?

```
Caused by: com.atlassian.confluence.content.render.xhtml.XhtmlTimeoutException: Rendering this content exceeded the timeout of 5 seconds.
?? ?at com.atlassian.confluence.content.render.xhtml.XhtmlTimeoutException.forTimeout(XhtmlTimeoutException.java:21)
?? ?at com.atlassian.confluence.content.render.xhtml.DefaultConversionContext.checkTimeout(DefaultConversionContext.java:207)
?? ?at com.atlassian.confluence.content.render.xhtml.editor.macro.EditorMacroMarshaller.marshal(EditorMacroMarshaller.java:35)
?? ?at com.atlassian.confluence.impl.content.render.xhtml.editor.macro.DelegatingEditorMacroMarshaller.marshal(DelegatingEditorMacroMarshaller.java:28)
?? ?at com.atlassian.confluence.impl.content.render.xhtml.editor.macro.DelegatingEditorMacroMarshaller.marshal(DelegatingEditorMacroMarshaller.java:16)
?? ?at com.atlassian.confluence.content.render.xhtml.DefaultEditorFormatService.convertMacroDefinitionToEdit(DefaultEditorFormatService.java:93)
?? ?at sun.reflect.GeneratedMethodAccessor2219.invoke(Unknown Source)
?? ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
?? ?at java.lang.reflect.Method.invoke(Method.java:498)
?? ?at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
?? ?at com.sun.proxy.$Proxy232.convertMacroDefinitionToEdit(Unknown Source)
?? ?at sun.reflect.GeneratedMethodAccessor2219.invoke(Unknown Source)
?? ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
?? ?at java.lang.reflect.Method.invoke(Method.java:498)
?? ?at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:136)
?? ?at com.sun.proxy.$Proxy232.convertMacroDefinitionToEdit(Unknown Source)
?? ?at com.atlassian.confluence.tinymceplugin.rest.MacroResource.generatePlaceHolder(MacroResource.java:161)
```


Answers:
author: AhmadDanial
body: Hi, Sivash.

Timeout issues can occur due to various reasons caused by various components like network, proxy, or other issues. By default, 5 seconds is sufficient for **Widget Macro** to just send an HTTP request to YouTube.

Wit that being said, there is a workaround to this issue which involves the steps to increase the the timeout. To do this, we have to add a system property to Confluence, which controls the timeout settings of Macros.  

```
CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=<value> ${CATALINA_OPTS}?
```

Do have a look at the guide below that explains the steps to configure system properties in Confluence. For a start, try to increase to **10 seconds** and let us know if you are still hitting into the issue.

* [Configuring System Properties](https://confluence.atlassian.com/doc/configuring-system-properties-168002854.html)

comments: author: CenturyX476
body: So I open "setenv.bat"

DO I leave the " at the beginning and is the 10000 value correct ?

```
set CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=10000 ${CATALINA_OPTS} 
```

Thanks


author: CenturyX476
body: Or do I set it like this

set CATALINA_OPTS=-Dconfluence.macro.placeholder.timeoutMillis=10000 %CATALINA_OPTS%


author: AhmadDanial
body: Hi there, Sivash.

Pardon me for the radio silence as I was away for a couple of days. It should be the first option. Can you please let me know how it goes on your end?


author: CenturyX476
body: Hello,

I tried this

```
CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=10000 ${CATALINA_OPTS}
```

AND this

```
set CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=10000 ${CATALINA_OPTS}
```

Neither worked.

Its OK - it must be something else that is causing the timeout. I am using IIS as an SSL termination proxy. Perhaps that is some weird setting doing it that I am unaware of cannot fix.

Thanks for trying


author: AhmadDanial
body: Hello again, Siavash.

I just realized that the line I provided was incomplete as there was a missing double quotation at the end. Sorry about that. Can you please try this one and let me know if it helps?

```
set CATALINA_OPTS="-Dconfluence.macro.placeholder.timeoutMillis=10000" ${CATALINA_OPTS}
```

If it still does not help, I'll raise a support ticket to the Confluence team for further assistance. Thanks.


author: CenturyX476
body: Well I tried it

And it did not work.

The environment I setup appears to be a unicorn. SSL termination IIS proxy in the DMZ, multiple subnets, windows server running confluence.

I have figured out a work around for this. It is not pretty but it is what it is.

Thanks for the assistance


author: AhmadDanial
body: Hello, Siavash.

No worries. Do you mind sharing the solution here so that it can help other users who may run into the same problem too? That will be super great.


author: CenturyX476
body: Additional Info:

I'm using a Windows Proxy where SSL is terminated at the proxy.

I've updated confluence to the latest version and i'm still getting the same error.


author: CenturyX476
body: Hello,

Anybody ?


Tags: confluence-server

server