-
Notifications
You must be signed in to change notification settings - Fork 666
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
too many common errors are offuscated in ansible, requiring run with --debug #1666
Comments
Agree with all points here. We can make improvements.
One idea is to introduce a validation layer right at the start of the run which asks which driver is being requested, in your example, Docker, and then trys to check if it is up and ready to run. We could bail out with some nice error messages immediately if not. That might take some work. In the meantime, as suggested on https://etherpad.openstack.org/p/ansible-molecule, we could try and put together a simple 'troubleshooting' guide and output this with any error message.
AFAIK, a way in between |
Something along the lines of To clarify, what would be most useful in this situation would be to increase the verbosity only for a failed test. Currently, if a build is broken in travis, we almost always have to run the tests locally (in highly verbose debug mode) to even get an idea of what went wrong. |
I am glad to see others feel the same pain. As someone that tries to advocate molecule use to others I find the need to run afain with debug very inconvenient. We should aim to get meaninful error on normal runs, without asking user to add extra params in order to findout about stuff like:
I am not saying that default execution should be more verbose but I am saying that failed tasks should be verbose. |
To be clear, I'm really +1 on something for this (and I hope I have time soon) to improve the experience with Molecule and debugging failures. It's pretty damn important and without, it can certainly be frustrating. |
Improves user experience by displaying the errors that caused key tasks to fail. Avoids adding extra verbosity by using no_log on successes. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
Following discussion #1828, can we make |
Hmmmm ... #1289 and basically a lot of https://github.com/ansible/molecule/issues?utf8=%E2%9C%93&q=is%3Aissue+no_log. Here's the line:
Some docs too: https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-keep-secret-data-in-my-playbook. |
Further debate:
|
Improves user experience by displaying the errors that caused key tasks to fail. Avoids adding extra verbosity by using no_log on successes. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
RE #1666 (comment), we could also add a check on |
@decentral1se what if Molecule, as a first step, verified accessibility and usability of providers and reported the problem early and loudly following the "fail fast" approach? |
|
This change makes the default behavior of molecule to enable logging of its tasks. This may expose credentials if they are defined in molecule.yml files. User can override this behaviour by defining MOLECULE_NO_LOG variable to true of false. When defined that value would override any value of `provider.log` mentioned inside molecule.yaml. When variable is not defined, the value from molecule.yml file will be used. When none of these are defined, logging will be enabled. This matches Ansible behavior where environment variables do take precedence over values defined in playbooks. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
@webknjaz While I do support your idea but is unrelated to this issue. We need to expose errors in molecule tasks because they very often contain problems that we could never catch with pre-run sanity check. My plan is to first adapt the way we run tests to always skip unconfigured providers unless we mention a list of ones we want to test, speeding up testing locally and on CI. |
This change makes the default behavior of molecule to enable logging of its tasks. This may expose credentials if they are defined in molecule.yml files. User can override this behaviour by defining MOLECULE_NO_LOG variable to true of false. When defined that value would override any value of `provider.log` mentioned inside molecule.yaml. When variable is not defined, the value from molecule.yml file will be used. When none of these are defined, logging will be enabled. This matches Ansible behavior where environment variables do take precedence over values defined in playbooks. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
This change makes the default behavior of molecule to enable logging of its tasks. This may expose credentials if they are defined in molecule.yml files. User can override this behaviour by defining MOLECULE_NO_LOG variable to true of false. When defined that value would override any value of `provider.log` mentioned inside molecule.yaml. When variable is not defined, the value from molecule.yml file will be used. When none of these are defined, logging will be enabled. This matches Ansible behavior where environment variables do take precedence over values defined in playbooks. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
User can override this behaviour by defining MOLECULE_NO_LOG variable to true of false. When defined that value would override any value of `provider.log` mentioned inside molecule.yaml. When variable is not defined, the value from molecule.yml file will be used. When none of these are defined, logging will be disabled in order to keep the behaviour consistent with previous versions. In the future we may want to change the default value in order to improve the user experience. This matches Ansible behavior where environment variables do take precedence over values defined in playbooks. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
User can override this behaviour by defining MOLECULE_NO_LOG variable to true of false. When defined that value would override any value of `provider.log` mentioned inside molecule.yaml. When variable is not defined, the value from molecule.yml file will be used. When none of these are defined, logging will be disabled in order to keep the behaviour consistent with previous versions. In the future we may want to change the default value in order to improve the user experience. This matches Ansible behavior where environment variables do take precedence over values defined in playbooks. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
User can override this behaviour by defining MOLECULE_NO_LOG variable to true of false. When defined that value would override any value of `provider.log` mentioned inside molecule.yaml. When variable is not defined, the value from molecule.yml file will be used. When none of these are defined, logging will be disabled in order to keep the behaviour consistent with previous versions. In the future we may want to change the default value in order to improve the user experience. This matches Ansible behavior where environment variables do take precedence over values defined in playbooks. Fixes: #1666 Signed-off-by: Sorin Sbarnea <[email protected]>
Something for ansible#1666 (comment). Signed-off-by: Luke Murphy <[email protected]>
Something for ansible#1666 (comment). Signed-off-by: Luke Murphy <[email protected]>
Something for #1666 (comment). Signed-off-by: Luke Murphy <[email protected]>
This is a generic issue with molecule which can really put many users off: a big number of very common execution errors are offuscated by crytic errors and you never find the cause till you run molecule again in debug mode.
One such example: what happens if local docker is stopped. Just try it.
Expected behaviour: get a clear error and not have to run molecule in debug mode in order to find out the cause.
Another issue that make this issue even more problematic is that
--debug
is extreamly verbose and as far as I know there is nothing in-between normal execution and debug mode. For example I almost never found useful to see the "blue" connection messages, but the other changes in verbosity did prove essential for debugging errors. It may be my lack of knowledge but I wasn't able to find something less verbose.The text was updated successfully, but these errors were encountered: