flyingcircusio / batou

batou is a universal, fractal deployment utility using Python.
https://batou.readthedocs.org
Other
47 stars 12 forks source link

batou 2.3 does not display cyclic dependency errors correctly #365

Open nichmoe opened 1 year ago

nichmoe commented 1 year ago

There is a dependency cycle between backend and consumershutdown, which is not shown understandable it the messages.

% ./batou deploy -P env
batou/2.3 (cpython 3.9.13-final0, Darwin 22.3.0 arm64)
======================================================= Preparing =======================================================
main: Loading environment `env`...
main: Verifying repository ...
You are using rsync. This is a non-verifying repository -- continuing on your own risk!
main: Loading secrets ...
====================================== Connecting hosts and configuring model ... =======================================
vm: Connecting via ssh (1/1)

ERROR: 6 remaining unconfigured component(s): backend, consumershutdown, haproxy, logrotate, nginx, sensuchecks
============================================ 1 ERRORS - CONFIGURATION FAILED ============================================
===================================== DEPLOYMENT PREDICTION FAILED (during connect) =====================================

Assignee was given access to example deployment code.

ctheune commented 1 year ago

This is caused by the "SilentConfigurationError" mechanic. That was originally intended (more based on a heuristic) to avoid unnecessary noise in errors that are caused by subsequent faults caused by other errors: if a component that is expected to provide something fails then everything depending on it will fail as well and that may quickly cascade into a huge list of errors where it is hard to find the root.

However, in this case, we end up with no useful error message if we have interlocking "require_one" dependencies (we don't get far enough to actually detect the cycle based on the topology).

I think we should try again: remove the SilentConfigurationError infrastructure but check output in the error examples whether this becomes too noisy again and consider a new approach.

Note: generally, it's fine to present multiple errors if there really are multiple independent issues so that users do not have to run batou multiple times to discover issues iteratively.

zagy commented 2 months ago

@elikoga haven't we updated the error reporting since then?