When configuration-custom.json is modified, there is a chance it will be invalid. If the JSON is within a script or generated at runtime, the json usually isn't validated before being passed to deploy-recommended-cluster.bash. Failure due to malformed json is a bit opaque from the error messages, and can be labor-intensive to recover from after other parts of ambari-bootstrap have already run.
Using something like the example below at the earliest point that makes sense could make the script more restartable in the event of a malformed json file:
`#Check validity of configuration-custom.json
if jq '.' configuration-custom.json; then
echo "JSON file is valid ..."
else
echo "Custom config JSON file is invalid! Please fix the source script ..." 1>&2
exit 1
fi`
When configuration-custom.json is modified, there is a chance it will be invalid. If the JSON is within a script or generated at runtime, the json usually isn't validated before being passed to deploy-recommended-cluster.bash. Failure due to malformed json is a bit opaque from the error messages, and can be labor-intensive to recover from after other parts of ambari-bootstrap have already run.
Using something like the example below at the earliest point that makes sense could make the script more restartable in the event of a malformed json file:
`#Check validity of configuration-custom.json
if jq '.' configuration-custom.json; then
echo "JSON file is valid ..."
else
echo "Custom config JSON file is invalid! Please fix the source script ..." 1>&2
exit 1
fi`