Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-90893

Confluence REST API invocation error "/Upload" - 400 error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 8.4.1
    • Site - Backup / Import
    • None

      Issue Summary

      This is reproducible in Data Center: Yes

      Steps to Reproduce

      1. Create a space/site export from any confluence version, to import it to Confluence 8.4.1
      2. Place the space export in <confluence-home>/shared/restore/space (or) site export in - <confluence-home>/shared/restore/site
      3. Use cURL - 
        cURL -D- -u <user_name>:<password> -X POST -H "X-Atlassian-Token: nocheck" -F "file=@<file_name>.zip" http://<base_url>/rest/api/backup-restore/restore/space/upload

      Ref : https://docs.atlassian.com/ConfluenceServer/rest/8.4.1/

      Expected Results

      • Site/Space should be imported into the destination Confluence 

      Actual Results

      {"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"The uploaded file should be a valid zip file.","reason":"Bad Request"}%                                              

       
      From conf_access_*.log

      [17/Aug/2023:07:07:34 +0530] admin http-nio-6841-exec-3 127.0.0.1 POST /c841/rest/api/backup-restore/restore/site/upload HTTP/1.1 400 143ms 211 - curl/8.1.2 

      Workaround

      Add ;type=application/zip after the filename:

      curl -k -D- -u <user_name>:<password> -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.zip;type=application/zip" "http://<base_url>/rest/api/backup-restore/restore/space/upload"
      

              Unassigned Unassigned
              4b0790dbfd74 Jetendra Ivaturi (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: