1
votes

Currently I am setting up Marklogic instance using mlgradle to automate deployment process.

I am creating a new custom forest based on json config file path (ml-config\forests\db-name\file.json)

Here is the config:

{
"forest-name": "new-forestName",
"enabled": true,
"database": "db-name-content",
"data-directory": "D:\\folderName"
 }

Problem is when I try to deploy using "data-directory": "D:\\folderName" it fails, am I going anything wrong?

I can achieve the same using mlForestDataDirectory=D:\\folderName in gradle properties, but I want to take this bit out of global property file as other forest will be pointing to different locations on separate drives.

Thanks for your help

Here is the console error:

enter image description here

1
What error do you get? - rjrudin
I have uploaded screenshot of the error - subsoft
Try double escaping the \\ to \\\\. ML-gradle is likely interpreting twice, once to merge JSON payloads, and once to send it across the wire.. - grtjn
It is better to post the error as text, rather than just a screenshot. If you think the color coding is helpful, the screenshot may help as an additional diagnostic. However, in order for the text to be found by people searching with your error message and for those of us answering, it is helpful to have the information readily available as text in the question. - Mads Hansen

1 Answers

1
votes

The error message:

Unable to parse JSON: Unrecognized character escape M (code 77)

is telling you that your JSON is invalid and that the evaluated value for the data-directory is D:\ML-DB.

It seems that it is being processed twice, turning D:\\ML-DB into D:\ML-DB and then interpreting that as an escaped M.

You could either:

  • double the backslashes D:\\\\ML-DB
  • or consider using forward slashes for the path separator D:/ML-DB