Page MenuHomeVyOS Platform

configd should report exceptions uncaught by conf_mode scripts as commit error
Open, HighPublicBUG

Description

Since introduction, configd will report exceptions other than ConfigError as type R_ERROR_DAEMON when running config scripts: this has the effect of indicating 'pass-through' execution to the shim, which will re-execute the config mode script within the config session context.

The repurposing of the error name is misleading in this case, but the design is reasonable when the config daemon was still operating with a mixture of scripts running natively and under the daemon: if not a clearly actionable ConfigError, return to the native context. With all scripts now running under the config daemon (T6510), one finds that this behavior can obscure some errors.

This is observed, for example, in the first fix of T6592: running without the config daemon, the error is triggered on the first call of 'commit', but not a subsequent one, hence the pattern above will not raise an error. Since EAFP style within a config script is never exhaustive, unexpected errors should be caught and reported by the config daemon and a commit error code returned to the shim.

This provides a cleaner version of what happens when running without configd: namely, an exception that is not caught by a config script will trigger a traceback and the airbag report, effectively resulting in a commit error.

Note that this is unrelated to the formatting issues of T6605. Moreover, this is a case where formatting should differ between running with/without configd support: errors uncaught by a config script should be clear for debugging and resolution, and (ideally) not make it the point of the user-facing airbag report.

In testing, this refinement has revealed several other obscured bugs; those will be itemized in subtasks for reference.

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.5-rolling-202407181546
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Related Objects

Event Timeline

jestabro triaged this task as High priority.
jestabro created this object in space S1 VyOS Public.
jestabro changed Difficulty level from Easy (less than an hour) to Normal (likely a few hours).Jul 25 2024, 1:49 PM

Time of task extended for testing.

As this will be a change in behavior, we may want to wait before backport to 1.4.x; remove tag for now, until inclusion in current and Circinus.

The PR above:
https://github.com/vyos/vyos-1x/pull/3876

will be moved out of draft following

https://github.com/vyos/vyos-1x/pull/3955
https://github.com/vyos/vyos-1x/pull/3937
and resolution of T6638, which manifests in configtest vrf-bgp-pppoe-underlay