Skip to content
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

Recreating initrd failure shows misleading message when not in debug mode #3207

Open
jsmeix opened this issue Apr 10, 2024 · 1 comment
Open
Assignees
Labels
enhancement Adaptions and new features minor bug An alternative or workaround exists
Milestone

Comments

@jsmeix
Copy link
Member

jsmeix commented Apr 10, 2024

See
#3206
therein in particular (excerpts):
#3206 (comment)

dracut not showing errors in the ReaR log

and
#3206 (comment)

about the dracut not showing errors problem I figured out what is going on:

In normal (non-debug) ReaR mode stderr goes to $STDOUT_STDERR_FILE
and the Error function can then quote from that.
However, our code surrounding dracut doesn't use the Error function
but instead only does a LogPrint suggesting to look into
the $RUNTIME_LOGFILE, and that is the reason that the
logfile doesn't contain useful infos.

How should we solve this?
Maybe extract the "pull last lines from stderr" into a function
that can then be used? Or add a LogPrintError function
that will also show last errors if exist?

... I think it is important to keep in mind and fix
so that users can get an info about the problem
for errors without running ReaR again in debug mode.
@jsmeix jsmeix added enhancement Adaptions and new features minor bug An alternative or workaround exists labels Apr 10, 2024
@jsmeix jsmeix added this to the ReaR v2.8 milestone Apr 10, 2024
@jsmeix jsmeix self-assigned this Apr 10, 2024
@jsmeix jsmeix changed the title Recreating inird failure shows misleading message when not in debug mode Recreating initrd failure shows misleading message when not in debug mode Apr 10, 2024
@jsmeix
Copy link
Member Author

jsmeix commented Apr 10, 2024

I will have to think about it...

We already have a LogPrintError function which is
currently used differently, see its description in
lib/_input-output-functions.sh

For specific usage examples see for example
finalize/default/060_compare_files.sh

LogPrintError "Restored files in $TARGET_FS_ROOT do not fully match the recreated system"
LogPrintError "(files in the backup are not same as when the ReaR rescue/recovery system was made)"
...
LogPrintError "$( sed -e "s|^/|$TARGET_FS_ROOT/|" -e 's/^/  /' <<< "$md5sum_stdout" )"
LogPrintError "Manually check if those changed files cause issues in your recreated system"

and also
usr/share/rear/prep/PXE/default/010_PXE_check.sh
usr/share/rear/lib/opaladmin-workflow.sh
usr/share/rear/lib/_input-output-functions.sh
usr/share/rear/lib/opal-functions.sh
usr/share/rear/build/default/990_verify_rootfs.sh
usr/share/rear/restore/FDRUPSTREAM/default/260_copy_log_and_report.sh
that use several subsequent LogPrintError calls
where ReaR log file output is unwanted.
In general the current LogPrintError function
is not meant to provide ReaR log file output.
In contrast the Error function can provide ReaR log file output
because the Error function is the last function that is called
so ReaR log file output will be shown only once.

My current offhanded guess is that a separated function
(extract the 'pull last lines from stderr' into a function)
to show ReaR log file output could be a possible solution
so that we have control when ReaR log file output is shown.

The current # Extract lines ... code
in the Error function depends on that this happens
within the [Bug]*Error function so some adaptions
and enhancements are needed to make that code a
generic LastSourcedScriptStdoutStderr function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adaptions and new features minor bug An alternative or workaround exists
Projects
None yet
Development

No branches or pull requests

1 participant