Closed abbra closed 3 years ago
It would be great to fix the code to report these kind of internal errors in a proper way so that a user is aware what is failing rather than getting a stack trace.
Hi, thanks for the report.
Yes this exception handling needs to be improved.
The issue is also about connection check not working with containers without sshd. From your PoV, should we also prioritize this use case? The original thinking was that the initial use-cases were for testing IPA and related, where a lot depends on having a possibility to SSH into the host thus it was prioritized more. But we could do some enhancements here as well. E.g. skipping the ssh check or using the more native container ways.
For containers, going inside with native podman tools would be preferred. I am trying to use podman as a backend because I have quite bad experience with vagrant in my setup and I simply don't want to use it. I can avoid the problem in this report by creating a specialized image with sshd in it but this would make the configuration less portable. What I am using this for? I am trying to develop tests that run both Samba AD and FreeIPA in the same setup as we have an issue upstream (https://bugzilla.samba.org/show_bug.cgi?id=14851) that is potentially preventing a merge of couple pull requests (one for Samba to split DCE RPC handlers, one for FreeIPA to add IPA domain controller code in Samba).
FYI, this is also needed for testing external IdP stuff.
I am trying to set up an environment with a fedora 35 container. Note that this is not a specialized container image but rather a normal
registry.fedoraproject.org/fedora:35
image. This image does not have sshd in it.What happens is that sshd restart in container fails and throws an exception. This exception is expected but the actual structure of the argumens of the exception is unexpected:
Below is full debug output, I added a line to print the
results.args
, thus the original failure was on line 96:So the
ProvisioningError
thrown by the podman's provider has args of('Failed restarting sshd service in container 1ce9690bf8449cf3d4e78ec2b700f46297140b8b620c299c35134de02f9d374d',)
, e.g. only one element whilePROVIDER_NAME_INDEX
is 1, e.g. second element.Almost all places that throw
ProvisioningError
accept a single argument, there is no provider name in them and thus the code in theactions/up.py
is basically never going to work well. I guess this is because podman provider wasn't really tested for negative behavior before.