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
vhd_tool_wrapper.ml errors should include stderr message in the detail #3794
Comments
Thanks for the report. At first glance, it seems we are not capturing stderr. How common are these errors? I would like to think that VDI IO errors should almost never happen and there is no good reaction to them from the user and hence it is difficult to provide a good error message that a user could act on. |
I have seen various things, from no disk space left on device to impossible to find the VDI, corrupted hard drive, lost the connection to NFS, import didn't go well, etc. My gut feeling is a bit opposite of yours: it's often an error where the users could have solved the problem themselves if they had access to precise underlying unix error message. |
Those errors are VERY common, as soon you use the VHD export wrapper, anything wrong with it will lead to this error 😢 |
I haven't looked at it but I believe vhd-tool should signal the kind of error using its return code such that xapi can create a more specific error without having to analyse stderr. Looking at vhd-tool I see that it is not really careful about capturing the reason for a failure and doesn't use the return code effectively. |
I don't think vhd-tool packages its error un a usable way: https://github.com/xapi-project/vhd-tool/blob/master/cli/main.ml#L354 But I really suggest returning the unix error and the file it happened to (it's not always the one we think because of the VHD chain) in vhd_tool in the xapi error. More precisely the result of uerror() in the FFI (eg. https://github.com/xapi-project/vhd-tool/blob/master/src/sendfile64_stubs.c#L90 ) has really been a great help for us. Thanks for looking into it. |
I have created internal issue CA-307178. Fixing this should not be too difficult if the stderr output is not too large. |
Thanks a lot @lindig ! Feel free to link the commit to this issue when you have something, we are interested to see the "how", so we could maybe give you PRs next time we need something like this 👍 |
I was thinking about something like this - maybe you can test it (this is just a sketch):
|
We'll test that, thanks a lot for the draft! |
When a VDI_IO_ERROR happens because of vhd-tool, the xapi only reports the stacktrace of the xapi process down to vhd_tool_wrapper.ml, which is never helpful. The actual error is written by vhd-tool on its stderr.
I think adding the stderr of the vhd-tool subprocess to the field
Task.error_info
of the Task object related to VDI operations in the case of error would be more helpful.I suspect that the edit could be done here: https://github.com/xapi-project/xen-api/blob/master/ocaml/xapi/vhd_tool_wrapper.ml#L55
Currently user support is complicated because in the case of VDI_IO_ERROR we have to go explore the xensource.log file, there are 2 stacktraces per error in the file (one for xapi and one for vhd-tool) and customers routinely report only the unhelpful one (it's the lowest one in the file).
The text was updated successfully, but these errors were encountered: