Attaching files fails when the page is created and the file is attached in the same transaction

XMLWordPrintable

    • Severity 3 - Minor
    • CtB - Improve Existing

      Issue Summary

      Steps to Reproduce

      1. Use Confluence 10.2.13
      1. Install latest version of ConfiForms for 10.x platform
      1. Create a page with a following storage format
         {{}}
        <ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="1f1441c8-c415-4450-b069-e3174f50a5a8"><ac:parameter ac:name="formName">form</ac:parameter><ac:parameter ac:name="secureStorage">true</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="e0e2af82-84e0-4fce-964f-7f083a398f85"><ac:rich-text-body>
        <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro>
        <p class="auto-cursor-target"><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="5e8b7f29-c912-4fde-917f-e6c69d157071"><ac:parameter ac:name="fieldName">file</ac:parameter><ac:parameter ac:name="fieldLabel">file</ac:parameter><ac:parameter ac:name="type">file</ac:parameter></ac:structured-macro></p>
        <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro>
        <p>Records</p><ac:structured-macro ac:name="confiform-table" ac:schema-version="1" ac:macro-id="0c8415a4-c59f-4f4d-81f3-1a8b28dcce65"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body>
        <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro>
        <p><br /></p>
        <p><ac:structured-macro ac:name="children" ac:schema-version="2" ac:macro-id="9b0f057d-5cc9-48f5-810c-3e96871812a2" /></p> 

        {{}}

      Expected Results

      macro behaves correctly

      Actual Results

      The below exception is thrown in the log file:

      2026-06-16 12:48:40,883 WARN [http-nio-8090-exec-31 url: /ajax/confiforms/trysave.action; user: lrz-admin-tm] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:\n    [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1236598698)\n      ->[tx-attachment-upload-guard]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT (Session #1009398493)
       -- page: 2809498804 | referer: https://.../Testseite+Upload | traceId: aeca649f36a64b8d | userName: lrz-admin-tm | action: trysave | url: /ajax/confiforms/trysave.action
      2026-06-16 12:48:40,883 WARN [http-nio-8090-exec-31 url: /ajax/confiforms/trysave.action; user: lrz-admin-tm] [confluence.impl.spring.LoggingRetryListener] onError Retryable method [null] failed with [java.lang.IllegalArgumentException] (attempt 1)!
       -- page: 2809498804 | referer: https://.../Testseite+Upload | traceId: aeca649f36a64b8d | userName: lrz-admin-tm | action: trysave | url: /ajax/confiforms/trysave.action
      2026-06-16 12:48:41,836 WARN [http-nio-8090-exec-31 url: /ajax/confiforms/trysave.action; user: lrz-admin-tm] [plugins.synchrony.service.AbstractSynchronyManager] lambda$updateContent$0 Duplicated Rev has detected by Synchrony
       -- page: 2809498804 | referer: https://.../Testseite+Upload | traceId: aeca649f36a64b8d | userName: lrz-admin-tm | action: trysave | url: /ajax/confiforms/trysave.action
       

      Workaround

      replace usage of `fileUploadManager.storeResource` with `AttachmentManager`

              Assignee:
              Jeffery Xie
              Reporter:
              Jeffery Xie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: