-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Site - Storage
-
Severity 3 - Minor
Issue Summary
When importing a Confluence page/space that contains an iframe macro inside an
<ac:layout-section>
where the src parameter is a plain text URL, the import fails. The same content imports successfully if the iframe macro is used without the layout and the src parameter is wrapped in an <ri:url> element.
Key differences between failing and working storage formats:
- Failing version
<ac:parameter ac:name="src"> https://<site-url>:443/BPM/CON/?object=xxxxxx-c37c-48a4-9903-8e3c3ca4513d&tab=xxxxxxx-31fc-4b96-9222-2272e248d4ea </ac:parameter>
- Working version
<ac:parameter ac:name="src"> <ri:url ri:value="https://<site-url>/BPM/CON/?auth_key=a1&client=c2&tab=xxxxxxx-31fc-4b96-9222e248d4ea" /> </ac:parameter>
The failure appears to be triggered by the combination of:
- iframe macro inside layout markup, and/or
- src using a raw text URL instead of an ri:url resource.
Steps to Reproduce
- Prepare a Confluence page (or export XML) whose storage format contains the failing structure.
- Attempt to import this content into Confluence Cloud (e.g., via space/site import or API that accepts storage format).
- Observe that the import fails.
- Modify the same content so the iframe macro is standalone and the src parameter uses ri:url:
- Re-import this modified storage format.
- Observe that the import now succeeds.
Expected Results
The storage format should import successfully regardless of:
Whether the iframe macro is nested inside <ac:layout-section> / <ac:layout-cell> and formatting tags (like <p>, <strong>).
Whether the src parameter is a plain text URL or wrapped in an <ri:url> element, as long as the storage format is syntactically valid.
Actual Results
The import fails with an error
rg.springframework.web.server.ResponseStatusException: 500 INTERNAL_SERVER_ERROR
"java.lang.RuntimeException: Unexpected exception writing to stringwriter.
java.io.IOException: com.atlassian.confluence.content.render.xhtml.storage.macro.MacroTypedParameterValueException:
Error writing typed parameter: value is not an instance of
com.atlassian.confluence.modules.domains.contentconversion.api.xhtml.model.resource.identifiers.ResourceIdentifier"
at com.atlassian.confluence.mvc.rest.common.errors.ErrorHandler.lambda$static$0(...)
Caused by: com.atlassian.confluence.api.service.exceptions.ecosystem.InternalServerException
Caused by: java.lang.RuntimeException: Unexpected exception writing to stringwriter
at com.atlassian.confluence.modules.domains.contentconversion.api.xhtml.Streamables.writeToString(...)
at com.atlassian.confluence.content.render.xhtml.migration.XhtmlRoundTripMigrator.migrate(...)
Caused by: java.io.IOException: com.atlassian.confluence.content.render.xhtml.storage.macro.MacroTypedParameterValueException
Caused by: com.atlassian.confluence.content.render.xhtml.storage.macro.MacroTypedParameterValueException:
Error writing typed parameter: value is not an instance of
com.atlassian.confluence.modules.domains.contentconversion.api.xhtml.model.resource.identifiers.ResourceIdentifier
at ...AbstractXHTMLMacroV2Marshaller.writeResourceIdentifierParameter(...)
at ...AbstractXHTMLMacroV2Marshaller.writeParameterValue(...)
at ...AbstractXHTMLMacroV2Marshaller.writeParameters(...)
at ...StorageMacroV2Marshaller.marshalInto(...)
Workaround
- Replace the failing pattern with a working pattern before import:
- Option 1 (recommended): Wrap the src parameter value in an <ri:url> element:
<ac:parameter ac:name="src"> <ri:url ri:value="https://<site-url>/BPM/CON/?..."/></ac:parameter>
- Option 2: Avoid embedding the iframe macro inside ac:layout-section / ac:layout-cell and heavy inline formatting around the macro; use the iframe as a direct block element instead.
If neither of these can be reliably applied to all affected content (e.g., in large migrations), manual editing of the storage format prior to import is currently the only known workaround.