Description of problem: If the secret for remote image contains a character '/',The virt-inspector command could not parse the URL. After asked rjone's help, he suggested replacing the ‘/‘ with ’%2f‘ as a temporary solution. Version-Release number of selected component (if applicable): libguestfs-1.36.3-3.el7.x86_64 How reproducible: 100% Steps: 1. #virt-inspector --format=raw -v -x -a rbd://libvirt:AQAnRRBZpEOYJhAA/rJEZap2KJAqOOAshIMJPg==.144.70:6789/libvirt-pool/rbd-sr.img virt-inspector: --add: could not parse URI 'rbd://libvirt:AQAnRRBZpEOYJhAA/rJEZap2KJAqOOAshIMJPg==.144.70:6789/libvirt-pool/rbd-sr.img' libguestfs: trace: close libguestfs: closing guestfs handle 0x7f194ca4c750 (state 0) 2. #virt-inspector --format=raw -a rbd://libvirt:AQAnRRBZpEOYJhAA%2frJEZap2KJAqOOAshIMJPg==.144.70:6789/libvirt-pool/rbd-sr.img This command is executed successfully. Expected results: virt-inspector should parse the secret which contains '/' of remote image. Additional info:
Probably sufficient to have a docs fix. "/" has magical properties in URLs and must be quoted, but when/how to quote it isn't obvious.
The URI follows the format of RFC 3986 [1] for URLs. In particular, the userinfo part (i.e. user + password) is defined as following (see §3.2.1 in the RFC): userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) and the components are: unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" pct-encoded = "%" HEXDIG HEXDIG sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" So "/" is not allowed directly as character neither for the user name nor for the password, and thus it must be percent-encoded (see §2.1). [1] https://tools.ietf.org/html/rfc3986 Hence this is not a bug, since "/" must be represented as "%2f" in both user name and password.
Just sent a small documentation patch, since it's basically all that we can do: https://www.redhat.com/archives/libguestfs/2017-August/msg00143.html
Fixed upstream with https://github.com/libguestfs/libguestfs/commit/5f43b30a6f469b5feab2ffeb3147f7310f1ba47f which is in libguestfs >= 1.37.22.
Verified with package: libguestfs-1.36.6-2.el7.x86_64 Steps: 1. #man guestfish ------------------------------------------------------------------- ... Note that the URIs follow the syntax of RFC 3986: in particular, there are restrictions on the allowed characters for the various components of the URI. Characters such as ":", "@", and "/" must be percent-encoded: $ guestfish -a rbd://user:pass%40word[:port]/pool/disk In this case, the password is "pass@word". ... ------------------------------------------------------------------- Some datailed info has been added to man page. So verified this bug.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0677