Comment 21 for bug 1272083

Revision history for this message
Matt Bruzek (mbruzek) wrote :

Xiaoming,

Thank you for addressing the previous comments. The new file structure looks correct. The checksum validation code looks correct but the config.yaml still indicates that users can set an empty string to skip validation.

The charm continues to pass charm proof there are no errors on structure! The README.md converts correctly to HTML format and is easy to read.

A single hpcc charm deployed correctly in the LXC environment, but when trying to add units, the hpcc-cluster-relation-changed hook failed. There is more information about hook errors here:
https://juju.ubuntu.com/docs/authors-hook-errors.html

This error actually made the Ecl Watch page stop responding on port 8010.

Use set -e for all bash scripts:
It is highly recommended that BASH hooks use the “set -e” option, that means if any command returns false (non-zero) the script will stop and raise an error. This is important so Juju can work out if the script is running properly.

Fault tolerance:
The hpcc-cluster-relation-departed and hpcc-cluster-relation-changed hooks use LOCAL_IP_FILE and TMP_FILE without checking for existence first. Since the hook does not use “set -e” the hook will not stop on the error of the head command if the file does not exist. For instance if the save_local_ip function somehow failed that would lead to an error on the head command. Hooks can be run multiple times, so being fault tolerant and idempotent is crucial.

Remove unused hooks:
If the hpcc charm does not support the upgrade-charm or hpcc-relation-changed hook you can safely remove the empty files. Juju attempts to call hooks and if a hook does not exist, all is well and nothing is called. If the features improve, those hooks can be added in the future.

Hook failure:
Since the hook failed in error, the hook could be debugged according to this page: https://juju.ubuntu.com/docs/authors-hook-debug.html

juju debug-hooks hpcc/0
Then I added “set +x” at the top of the hooks/hpcc-cluster-relation-changed file to print out every command.
In a different terminal:
juju resolved –retry hpcc/0

This re-ran the hook and the output is attached to this bug report. Take a look at the commands and see if you can fix the error.

Thanks again for the continued work on this charm. Please contact us if you have additional questions. We are on freenode.net in the #juju channel, or email us at <email address hidden>.

The bug has been moved to Incomplete at this time. When the code is ready for another review move the bug status to New or “Fix Committed” to have it added back in the queue for review.