marklogic-contentpump
marklogic-contentpump copied to clipboard
"Is a directory" error
I'm trying to use mlcp to export the contents from my database and I get lot of errors like:
18/05/03 16:54:13 ERROR contentpump.SingleDocumentWriter: Error saving: data://.../340c82e5-4848-76a1-0000-00001dcf41b5.json java.io.FileNotFoundException: /var/opt/MarkLogic/.../340c82e5-4848-76a1-0000-00001dcf41b5.json (Is a directory)
if I try to import the exported content, I'll see errors like
ERROR mapreduce.ContentWriter: XDMP-MUSTHAVEUPDATE: Document must have at least one update permission.
and if I inspect some of the exported files, I see that info from the exported objects is missing.
The command I use is:
mlcp.sh export -host localhost -port 8000 -username user -password password -output_file_path /var/opt/MarkLogic/out
does mlcp supports exporting complex objects? where the metadata, like collections, are saved?
If you want mlcp to export the associated attributes of a document, you want to use "-output_type archive".
ok. Let me try it and see if if works.
Based on the conversation I'm going to close this. Feel free to reply if you have other questions.
I tried and got no ERROR when exporting, but when I try to import, I get this:
18/05/03 17:34:25 ERROR contentpump.DatabaseContentWriter: Error setting document properties for data://.../c6a13df8-6f85-e06c-0000-5ae9faffcbb0.json: No namespace binding for prefix
and then the final stats are:
18/05/03 17:34:25 INFO contentpump.LocalJobRunner: INPUT_RECORDS: 12328 18/05/03 17:34:25 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS: 12328 18/05/03 17:34:25 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_COMMITTED: 12328 18/05/03 17:34:25 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_FAILED: 11801 18/05/03 17:34:25 INFO contentpump.LocalJobRunner: Total execution time: 23 sec
The command I execute to import is:
mlcp.sh export -host localhost -port 8000 -username user -password password -output_file_path /var/opt/MarkLogic/path -output_type archive
and to import:
mlcp.sh import -host localhost -port 8000 -username user -password password -input_file_path /var/opt/MarkLogic/path/20180503172935+0000-000000-JSON.zip -input_file_type archive -input_compressed true
am I doing anything obviously wrong?
In your import command, try to set your input_file_path to: /var/opt/MarkLogic/path/
I get exactly the same errors and final stats.
the only place in code where I found 'No namespace binding for prefix' string is at
https://github.com/marklogic/java-client-api/blob/7ea967dc9ec08171b802dd3f17087baad7112389/marklogic-client-api/src/main/java/com/marklogic/client/impl/DocumentMetadataPatchBuilderImpl.java#L1279
it should have a prefix in the error message, but I can't see any prefix in my errors.
Do you need to import document properties? If not, set -copy_properties false
if I don't import document properties, the errors are gone, indeed. But then, the app doesn't work as expected. It might be caused by the lack of properties or not, I'm not sure yet. Anyway, is there any bug related with properties importing?
Which version of mlcp and which version of MarkLogic server are you using?
Marklogic 9.0.4 mlcp 9.0.4
this is an example of properties in a document that caused errors (slightly modified):
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<schemaVersion xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1.0</schemaVersion>
<documentDeleted xsi:type="xs:boolean" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">false</documentDeleted>
<tenantId xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">development-tenant</tenantId>
<active xsi:type="xs:boolean" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">true</active>
<className xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">com.the.Class</className>
<documentVersion xsi:type="xs:unsignedInt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">0</documentVersion>
</prop:properties>
I retrieved it by using xdmp:document-properties
In your property, you missed namespace declaration for xs.
ok. Thanks for pointing that. This XML was returned by a query done through query console. Is the name space of a property stored together with the property?
I'll close the ticket because it seems this is not a bug in mlcp.
a question: isn't xs namespace implicitly defined everywhere? or am I misunderstanding https://docs.marklogic.com/guide/xquery/namespaces#id_21104 ?
isn't xs namespace implicitly defined everywhere?
Sort of. It’s pre-defined in XQuery. Where you’re running into the problem is in the XML parser, which exists at a lower level and doesn’t spin up a full XQuery environment. It seems to me to be a bug that our parser can’t parse something that our XQuery engine can build and our persistence APIs can store. I’m following up on that with Engineering. Unfortunately I don’t have an ETA right now, though.