MarkLogic XDMP-INVZIP: Invalid zip file while trying to import the configuration zip file

38 views Asked by At

I export the cluster configuration file through management console "http://localhost:8002/manage/v3?format=zip" and try to import through curl command but it return below error can you suggest correct way to import the configuration file with zip format.

MarkLogic version -10

curl -v -X POST --anyauth --user admin:admin --header "Content-Type:application/zip" [email protected] 'http://localhost:8002/manage/v3'

Error:

{ [325 bytes data]
100 41563  100   325  100 41238   3457   428k --:--:-- --:--:-- --:--:--  431k<error 
xmlns="http://marklogic.com/xdmp/error">
  <status-code>500</status-code>
  <status>Internal Server Error</status>
  <message-code>XDMP-INVZIP</message-code>
  <message>XDMP-INVZIP: xdmp:zip- 
manifest(binary{"504b030414de958bb6ea8bb74116f0faffc3d2b0d0ed4b1ada3f3ee89addae7e..."})
-- 
Invalid zip file</message>
</error>

* Connection #1 to host localhost left intact
1

There are 1 answers

3
Mads Hansen On

The example command provided on the /REST/POST/manage/v3 documentation is incorrect. I have filed a bug to get it corrected.

The zip file is a binary artifact, and is getting mangled.

Rather than -d, you should apply the --binary-data option.

curl -v -X POST --anyauth --user admin:admin --header "Content-Type:application/zip" --binary-data @package2.zip 'http://localhost:8002/manage/v3'