Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Is a directory" error #76

Open
brunovianarezende opened this issue May 3, 2018 · 17 comments
Open

"Is a directory" error #76

brunovianarezende opened this issue May 3, 2018 · 17 comments
Assignees
Milestone

Comments

@brunovianarezende
Copy link

brunovianarezende commented May 3, 2018

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?

@jxchen-us
Copy link
Contributor

If you want mlcp to export the associated attributes of a document, you want to use "-output_type archive".

@brunovianarezende
Copy link
Author

ok. Let me try it and see if if works.

@mattsunsjf
Copy link
Contributor

Based on the conversation I'm going to close this. Feel free to reply if you have other questions.

@brunovianarezende
Copy link
Author

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?

@jxchen-us
Copy link
Contributor

In your import command, try to set your input_file_path to:
/var/opt/MarkLogic/path/

@brunovianarezende
Copy link
Author

I get exactly the same errors and final stats.

@mattsunsjf mattsunsjf reopened this May 3, 2018
@brunovianarezende
Copy link
Author

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.

@jxchen-us
Copy link
Contributor

Do you need to import document properties? If not, set -copy_properties false

@brunovianarezende
Copy link
Author

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?

@jxchen-us
Copy link
Contributor

Which version of mlcp and which version of MarkLogic server are you using?

@brunovianarezende
Copy link
Author

Marklogic 9.0.4
mlcp 9.0.4

@brunovianarezende
Copy link
Author

brunovianarezende commented May 3, 2018

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

@jxchen-us
Copy link
Contributor

In your property, you missed namespace declaration for xs.

@brunovianarezende
Copy link
Author

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?

@brunovianarezende
Copy link
Author

brunovianarezende commented May 4, 2018

I'll close the ticket because it seems this is not a bug in mlcp.

@brunovianarezende
Copy link
Author

brunovianarezende commented May 8, 2018

a question: isn't xs namespace implicitly defined everywhere? or am I misunderstanding https://docs.marklogic.com/guide/xquery/namespaces#id_21104 ?

@jmakeig
Copy link
Contributor

jmakeig commented May 10, 2018

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.

@mattsunsjf mattsunsjf added the new label Mar 22, 2019
@mattsunsjf mattsunsjf added this to the 10.0.2 milestone Mar 22, 2019
@yunzvanessa yunzvanessa modified the milestones: 10.0.2, 10.0.3 Aug 24, 2019
@yunzvanessa yunzvanessa modified the milestones: 10.0.3, 11.0.1 Sep 18, 2019
@abika5 abika5 modified the milestones: 11.1.0, 11.2.0 Jan 3, 2024
@abika5 abika5 modified the milestones: 11.3.0, 11.4.0 Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants