Empty temp folder scheduled job removes OfficeConnector-canary.jar causes word document import failure

XMLWordPrintable

    • 7
    • Severity 3 - Minor
    • 0

      Summary

      OfficeConnector-canary.jar is removed by the scheduled job empty temp folder that causes word document import failure

      Instance Details

      • Confluence 6.0.6

      How to Replicate

      1. Access http://localhost:8090/admin/darkfeatures.action
      2. Enable com.atlassian.confluence.officeconnector.canary darkfeature.
      3. Create a page in Confluence or go to an existing page (you want to view the page, not edit it).
      4. Choose (...) > Import Word Document
      5. Choose Browse and locate the Word document you want to import then choose Next.
        The import document options appear.
      6. Enter a title for the new page (useful if you do not want to use the file name as your page title).
      7. Choose where you want to import the file (as a brand new page, or overwriting an existing page with the same title).
      8. Choose how to handle title conflicts (rename the new pages or replace existing pages).
      9. Choose whether to create a single page or multiple pages based on the heading styles in the file (this option is only available if the file contains heading styles).
      10. Click Import.
      11. Wait for about 1 or 2 days then continue from step 3
        I have tested to clean temporary directory every 3 mins (0 */3 * ? * *), the issue was not reproducible.

      Actual Results

      1. Go to an existing page (you want to view the page, not edit it).
      2. Choose (...) > Import Word Document
      3. Choose Browse and locate the Word document you want to import then choose Next.
        The import document options does not appear, instead we observed the following:
      • In UI:
      • <Confluence_Home>/temp is empty
      • In catalina.out
        [WordImportCanaryExecutor:thread-1] INFO com.atlassian.confluence.extra.office.canary.CanaryCage - Checking inputs using OfficeConnector-canary.jar
        [WordImportCanaryExecutor:thread-1] INFO com.atlassian.confluence.extra.office.canary.CanaryCage - Executing canary using [/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/bin/java, -Xmx1024m, -Djava.awt.headless=true, -cp, /Users/lwang3/confluence-home/atlassian-confluence-6.0.6/temp/com.atlassian.confluence.extra.office.canary.aspose.words.WordImportCanaryExecutor/OfficeConnector-canary.jar, com.atlassian.confluence.extra.office.canary.aspose.words.WordImportTestRunner, /Users/lwang3/confluence-home/atlassian-confluence-6.0.6/temp/upload_fe06d83f_4278_4fad_bb04_6496a569dd8b_00000017.tmp]
        [WordImportCanaryExecutor:thread-1] WARN com.atlassian.confluence.extra.office.canary.CanaryCage - Canary OfficeConnector-canary.jar choked and died whilst processing [/Users/lwang3/confluence-home/atlassian-confluence-6.0.6/temp/upload_fe06d83f_4278_4fad_bb04_6496a569dd8b_00000017.tmp]
        [WordImportCanaryExecutor:thread-1] WARN com.atlassian.confluence.extra.office.canary.CanaryCage - Canary output: Error: Could not find or load main class com.atlassian.confluence.extra.office.canary.aspose.words.WordImportTestRunner
        
        [http-nio-6606-exec-4] ERROR com.atlassian.confluence.extra.office.canary.AbstractCanaryExecutor - Canary choked and died on doc file Confluence Test Word1.docx
        

      Expected Results

      • OfficeConnector-canary.jar should not be removed from <Confluence_Home>/temp

      Notes

      Checked the code of the plugin at https://stash.atlassian.com/projects/CONFSERVER/repos/officeconnector/browse.
      We observed:

      Workaround

      • Disable Clean Temp folder scheduled job (e.g run cron job every 99 years)
      • Create the script to check the OfficeConnector-canary.jar existence, for example:
        #!/bin/bash
        file = /data/confluence-home/temp/com.atlassian.confluence.extra.office.canary.aspose.words.WordImportCanaryExecutor/OfficeConnector-canary.jar
        if [ -f "$file" ]
        then
          exit 1
        else
          cp "OfficeConnector-canary.jar" "$file"
        fi
        

            Assignee:
            Unassigned
            Reporter:
            Lei Wang
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: