[elbe-devel] [PATCH] initvmaction: improve errormessages, when libvirt.open() fails

Torben Hohn torben.hohn at linutronix.de
Wed May 9 14:08:11 CEST 2018


On Wed, May 09, 2018 at 10:02:32AM +0200, Manuel Traut wrote:
> the following exception was seen, if entering the password to access
> libvirt is delayed to long:
> 
> --------------------
> The system is going down NOW!
> Sent SIGTERM to all processes
> Sent SIGKILL to all processes
> Requesting system reboot
> [  325.635523] reboot: Restarting system
> mkdir -p .stamps
> touch .stamps/stamp-install-initial-image
> libvirt: DBus Utils error : error from service: CheckAuthorization: Did not receive a reply. Possible causes include: the remote application did not send a
> +reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
> Traceback (most recent call last):
>   File "/usr/bin/elbe", line 55, in <module>
>     cmdmod.run_command(sys.argv[2:])
>   File "/usr/lib/python2.7/dist-packages/elbepack/commands/initvm.py", line 81, in run_command
>     action = InitVMAction(args[0])
>   File "/usr/lib/python2.7/dist-packages/elbepack/initvmaction.py", line 116, in __init__
>     InitVMAction.__init__(self, node)
>   File "/usr/lib/python2.7/dist-packages/elbepack/initvmaction.py", line 77, in __init__
>     self.conn = libvirt.open("qemu:///system")
>   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 255, in open
>     if ret is None:raise libvirtError('virConnectOpen() failed')
> libvirt.libvirtError: error from service: CheckAuthorization: Did not receive a reply. Possible causes include: the remote application did not send a reply,
> +the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
> Starting the initvm Failed
> Giving up
> --------------------
> 
> give a better message to the user.
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/initvmaction.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
> index df86ca36..e714fc40 100644
> --- a/elbepack/initvmaction.py
> +++ b/elbepack/initvmaction.py
> @@ -93,6 +93,15 @@ class InitVMAction(object):
>                  print("should fix the problem.", file=sys.stderr)
>                  sys.exit(20)
>  
> +            if verr.args[0].startswith('error from service: CheckAuthorization'):
> +                print("", file=sys.stderr)
> +                print("Accessing libvirt failed.", file=sys.stderr)
> +                print("Probably entering the password for accssing libvirt", file=sys.stderr)
> +                print("timed out. If this occured after 'elbe initvm create'", file=sys.stderr)
> +                print("it should be safe to use 'elbe initvm start' to", file=sys.stderr)
> +                print("continue.", file=sys.stderr)
> +                sys.exit(20)
> +
>              # In case we get here, the exception is unknown, and we want to see it
>              raise
>  
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180509/4d450d37/attachment.sig>


More information about the elbe-devel mailing list