Bug 1668244 - qemu-img: /var/tmp/v2vovl9951f8.qcow2: CURL: Error opening file: The requested URL returned error: 404 Not Found
Summary: qemu-img: /var/tmp/v2vovl9951f8.qcow2: CURL: Error opening file: The requeste...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Markus Armbruster
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
TreeView+ depends on / blocked
 
Reported: 2019-01-22 09:53 UTC by Xiaodai Wang
Modified: 2019-11-12 00:08 UTC (History)
16 users (show)

Fixed In Version: qemu-kvm-3.1.0-11.module+el8+2747+40c9b77e
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-29 16:05:29 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
virt-v2v debug log (4.52 KB, text/plain)
2019-01-22 09:53 UTC, Xiaodai Wang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:1293 0 None None None 2019-05-29 16:05:53 UTC

Description Xiaodai Wang 2019-01-22 09:53:51 UTC
Created attachment 1522354 [details]
virt-v2v debug log

Description of problem:
qemu-img: /var/tmp/v2vovl9951f8.qcow2: CURL: Error opening file: The requested URL returned error: 404 Not Found

Version-Release number of selected component (if applicable):
virt-v2v-1.40.1-1.module+el8+2708+fbd828c6.x86_64
libguestfs-1.40.1-1.module+el8+2708+fbd828c6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. convert a guest in esx server.
# virt-v2v  -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -os images -of raw  esx6.7-rhel7.6-x86_64 --password-file /tmp/v2v_vpx_passwd -v -x


Actual results:
qemu-img: /var/tmp/v2vovl9951f8.qcow2: CURL: Error opening file: The requested URL returned error: 404 Not Found

Expected results:
The guest should be converted successfully.

Additional info:

Comment 1 Richard W.M. Jones 2019-01-22 09:57:19 UTC
I can reproduce this from a Fedora 30 client too.

Comment 2 Xiaodai Wang 2019-01-22 10:04:17 UTC
This may be a qemu-kvm problem.
I can reproduce it with below package.
qemu-kvm-3.1.0-5.module+el8+2708+fbd828c6.x86_64

After downgrade it to below versions, i cannot reproduce it.
qemu-kvm-2.12.0-57.module+el8+2683+02b3b955.x86_64

Comment 3 Richard W.M. Jones 2019-01-22 10:39:31 UTC
This is a bug in qemu.  Here's a simple reproducer:

Case 1:

qemu-img info 'json:{ "file.sslverify": "off", "file.driver": "https", "file.url": "https://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/fedora/linux/development/rawhide/Server/x86_64/iso/Fedora-Server-dvd-x86_64-Rawhide-20190121.n.1.iso" }'
=> successful

Case 2:

qemu-img info 'json:{ "file.sslverify": "off", "file.driver": "https", "file.url": "https://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/fedora/linux/development/rawhide/Server/x86_64/iso/Fedora-Server-dvd-x86%5f64-Rawhide-20190121.n.1.iso" }'
=> 404 error

The only difference in the two cases is that I replaced an '_' character in the URL with '%5f'.
By the normal rules of URI percent escaping this should make no difference.

By enabling debugging in the curl driver in qemu you can see that it is replacing
%5f with 5f when passing the URL to curl, so it's not a bug in curl, but in qemu.

Comment 4 Richard W.M. Jones 2019-01-22 10:47:56 UTC
git bisect says:

8bca4613e6cddd948895b8db3def05950463495b is the first bad commit
commit 8bca4613e6cddd948895b8db3def05950463495b
Author: Markus Armbruster <armbru>
Date:   Thu Aug 23 18:40:24 2018 +0200

    json: Support %% in JSON strings when interpolating
    
    The previous commit makes JSON strings containing '%' awkward to
    express in templates: you'd have to mask the '%' with an Unicode
    escape \u0025.  No template currently contains such JSON strings.
    Support the printf conversion specification %% in JSON strings as a
    convenience anyway, because it's trivially easy to do.
    
    Signed-off-by: Markus Armbruster <armbru>
    Reviewed-by: Eric Blake <eblake>
    Message-Id: <20180823164025.12553-58-armbru>

:040000 040000 3ecaa2dbe471bdeda89dee5c1c49fe9887a6fdd8 b9bf4175a3f7268b2d92987d16a4a6576b1a56af M	qobject
:040000 040000 4aa22dfd501cf888a1024c1016382fc48ec8653e bcea08fdbfd30820207e118f1b2769dfa9300523 M	tests

Comment 6 Daniel Berrangé 2019-01-22 10:55:34 UTC
Patch proposed upstream at https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00108.html

Comment 7 Richard W.M. Jones 2019-01-22 11:13:36 UTC
See also:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg584162.html

Comment 8 Richard W.M. Jones 2019-01-22 11:17:11 UTC
(In reply to Daniel Berrange from comment #6)
> Patch proposed upstream at
> https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg00108.html

Thanks - can confirm this patch fixes the problem for me.

Comment 13 Markus Armbruster 2019-01-31 13:55:28 UTC
Fixed in upstream commit bbc0586ced6e9ffdfd29d89fcc917b3d90ac3938.

Comment 15 Danilo de Paula 2019-01-31 22:04:16 UTC
Fix included in qemu-kvm-3.1.0-11.module+el8+2747+40c9b77e

Comment 16 Tingting Mao 2019-02-20 09:20:59 UTC
Verified this bug as below:

Tested packages:
qemu-kvm-3.1.0-15.module+el8+2792+e33e01a0


Steps:

# qemu-img info 'json:{"file.driver":"https", "file.url":"https://10.73.194.81/RHEL7.6-Server-x86_64.iso", "file.sslverify":"off", "file.readahead":"64k"}'
image: json:{"driver": "raw", "file": {"url": "https://10.73.194.81/RHEL7.6-Server-x86_64.iso", "readahead": "64k", "driver": "https", "sslverify": "off"}}
file format: raw
virtual size: 512 (512 bytes)
disk size: unavailable

# qemu-img info 'json:{"file.driver":"https", "file.url":"https://10.73.194.81/RHEL7.6-Server-x86%5f64.iso", "file.sslverify":"off", "file.readahead":"64k"}'
image: json:{"driver": "raw", "file": {"url": "https://10.73.194.81/RHEL7.6-Server-x86%5f64.iso", "readahead": "64k", "driver": "https", "sslverify": "off"}}
file format: raw
virtual size: 512 (512 bytes)
disk size: unavailable

Comment 18 errata-xmlrpc 2019-05-29 16:05:29 UTC
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-2019:1293


Note You need to log in before you can comment on or make changes to this bug.