I am trying to change scheduled MarkLogic database backup settings with ml-gradle. I am able to deploy a database with gradle mlDeploy. But when changing it's scheduled backup properties I get a "database configurations differ" error while running mlDeploy again.
The current json file for the database looks like this:
"database-name" : "caspar-test",
"range-element-index" : [ {
"scalar-type" : "string",
"namespace-uri" : "CHANGEME",
"localname" : "CHANGEME",
"collation" : "http://marklogic.com/collation/",
"range-value-positions" : false,
"invalid-values" : "reject"
} ],
"database-backup": [ {
"backup-id": "1373474833703299773",
"backup-enabled": true,
"backup-directory": "/backup/caspar-test",
"backup-type": "daily",
"backup-period": 1,
"backup-start-time": "13:01:00Z",
"backup-timestamp": "2019-09-06T13:55:25.243878Z",
"max-backups": 2,
"backup-security-database": true,
"backup-schemas-database": true,
"backup-triggers-database": true,
"include-replicas": true,
"incremental-backup": false,
"journal-archiving": false,
"journal-archive-path": "",
"journal-archive-lag-limit": 15
} ]
}
For the test I set "backup-enabled" to false. Running ml-gradle shows
Logging HTTP response body to assist with debugging: {"errorResponse":{"statusCode":"500", "status":"Internal Server Error", "messageCode":"CMA-ERRORCONFIG", "message":"CMA-ERRORCONFIG (err:FOER0000): MANAGE-CONFLICTINGCONFIGerr:FOER00001.0-mlA conflict has been detected: MANAGE-CONFLICTINGCONFIG: (err:FOER0000) A conflict has been detected: database configurations differ: database-backupsfalse database configurations differ: database-backups/MarkLogic/manage/models/database-idempotent.xqy7186xdmp:function(fn:QName(\"http://marklogic.com/manage/database/idempotent\",\"check-database-property-idempotent-database-backups\"))(<configuration/>, xs:unsignedLong(\"11315473330229343670\"), <database-backups xmlns=\"http://marklogic.com/manage/database/properties\">...</database-backups>)config<configuration/>dbidxs:unsignedLong(\"11315473330229343670\")prop<database-backups xmlns=\"http://marklogic.com/manage/database/properties\">...</database-backups>alist<database-backup xmlns=\"http://marklogic.com/xdmp/database\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">...</database-backup>plist<database-backup xmlns=\"http://marklogic.com/manage/database/properties\">...</database-backup>compare<database-backup xmlns=\"http://marklogic.com/xdmp/database\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">...</database-backup>1.0-ml/MarkLogic/manage/models/database-idempotent.xqy9011dmodi:check-database-property-update-idempotent(<configuration/>, xs:unsignedLong(\"11315473330229343670\"), <database-backups…
In my understanding scheduled database backup settings can be changed via API as they are being updated via PUT. Therefore I expected ml-gradle to handle this task without issues. Am I missing something here?
update
If you need to dig further with similar issues: Call "ml-gradle" with "-i" as it will dump the json it tried to apply. You can save this json to a file and apply it yourself by using a command like
curl -X POST --anyauth --user user:password -H 'Content-type: application/json' --header "Accept: application/json" -d@file.json http://host.name:8002/manage/v3
Be aware that MarkLogic offers a v2 API that has PUT and POST and v3 that only accepts POST for changes. The current issues result from using /manage/v3