-
Notifications
You must be signed in to change notification settings - Fork 204
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
GUI doesn't inform about errors in callback-script #827
Comments
The current way of handling status messages in GUI is more like an educated guess. Can't fix this without the new IPC |
@buhtzz I am surprised that you are using python in the user-callback script. Do you still have a minimal user-callback script for me for reproducing this error? Generally I think the existing error handling of user-callback calls in BiT looks very good and it would perhaps be a better solution to add Edit: On the error discovery side only little improvements are possible (and are completely out of control of BiT), eg. by extending the user-callback scripts with this command:
|
Indicative analysisI have analyzed the the issue a little bit to understand how user-callback script errors are recognized and (re)thrown as exceptions at the moment but it will be not easy to find a simple way to inform the user about the exceptions. The basic problem is not that user-callback script (runtime) errors are not recognized but that they are not directly and visible fed back to the user via GUI. Example with a synchronous call from GUIIf the last command of the script fails by returning a non-zero return code this is recognized by the plugin backintime/common/plugins/usercallbackplugin.py Lines 95 to 97 in 4940192
The exception is then handled by the pluginmanager and only logged but not fed back to the GUI: backintime/common/pluginmanager.py Lines 330 to 340 in 4940192
The logger just writes to the console and the syslog: Lines 44 to 46 in 4940192
The call stack up to the GUI comprises eg. for an "unmount": Line 157 in 4940192
Line 261 in 4940192
Line 642 in 4940192
Line 617 in 4940192
Line 1617 in 4940192
Here the exception handling could be changed to bubble-up to the GUI. Example of an async call ("take snapshot" button)Clicking the "take snapshot" button calls Lines 873 to 875 in 4940192
which then spaws a new process in takeSnapshotAsync with backintime --profile-id 1 backup as command inbackintime/common/backintime.py Line 81 in 4940192
Here exception handling is not possible due to the async out-of-process call. SummarySome user-callback script calls are sync, some async (out-of-process). For a decent feed-back of (runtime) errors in the user-callback script
Regarding IPC I see these options:
Text-based IPC would also require defined unique keywords and arguments to re-translate the output into feed-back that the user can interpret in the context of GUI... Next stepsImplementing this task is too much work for me ATM so I put it back into the box. |
I was wondering why the bit-gui told me there is no need for a new snapshot when I tried to start one manually. So restarted bit on the bash and found out that my callback-script had a simple
import
error (because my Debian GNU/Linux updated the python environment).There should be a way that a GUI-only user is informed about things like that. Maybe this is related to the IPC planed redesign?
Back In Time
Version: 1.2.0~alpha0
Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.
The text was updated successfully, but these errors were encountered: