Bug 1411119 - [REST-API] Image import from Glance repository fails on 'IO exception'
Summary: [REST-API] Image import from Glance repository fails on 'IO exception'
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Hardware: x86_64
OS: Unspecified
low vote
Target Milestone: ovirt-4.2.0
: ---
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-08 14:38 UTC by Elad
Modified: 2017-09-12 09:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-09-12 09:39:55 UTC
oVirt Team: Infra
rule-engine: ovirt-4.2+
mgoldboi: blocker-

Attachments (Terms of Use)
engine.log, server.log (82.93 KB, application/x-gzip)
2017-01-08 14:38 UTC, Elad
no flags Details
logs-9.1.17 (405.25 KB, application/x-gzip)
2017-01-09 15:37 UTC, Elad
no flags Details

Description Elad 2017-01-08 14:38:47 UTC
Created attachment 1238394 [details]
engine.log, server.log

Description of problem:
Image import from Glance repository fails on 'IO exception' via REST API

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. URL:

Request body:



Actual results:
Response body:

Internal Server Error


2017-01-08 16:28:51,285 ERROR [org.ovirt.engine.api.restapi.resource.validation.IOExceptionMapper] (default task-11) [] IO exception while processing "POST" request for path "/storagedomains
2017-01-08 16:28:51,285 ERROR [org.ovirt.engine.api.restapi.resource.validation.IOExceptionMapper] (default task-11) [] Exception: java.io.IOException: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"async"). Expected elements are <{}action>,<{}affinity_group>,<{}affinity_groups>,<{}affinity_label>,<{}affinity_labels>,<{}agent>,<{}agent_configuration>,<{}agent_configurations>,<{}agents>,<{}api>,<{}api_summaries>,<{}api_summary>,<{}api_summary_item>,<{}api_summary_items>,<{}apis>,<{}application>,<{}applications>,<{}authorized_key>,<{}authorized_keys>,<{}balance>,<{}balances>,<{}bios>,<{}bioss>,<{}block_statistic>,<{}block_statistics>,<{}body>,<{}bonding>,<{}bondings>,<{}bookmark>,<{}bookmarks>,<{}boot>,<{}boot_menu>,<{}boot_menus>,<{}boots>,<{}brick>,<{}brick_memoryinfo>,<{}brick_profile_detail>,<{}brick_profile_details>,<{}bricks>,<{}cdrom>,<{}cdroms>,<{}certificate>,<{}certificates>,<{}cloud_init>,<{}cloud_inits>,<{}cluster>,<{}cluster_level>,<{}cluster_levels>,<{}clusters>,<{}configuration>,<{}configurations>,<{}console>,<{}consoles>
        at org.ovirt.engine.api.restapi.xml.JAXBProvider.readFrom(JAXBProvider.java:199) [restapi-jaxrs.jar:]
        at org.ovirt.engine.api.restapi.xml.JAXBProvider.readFrom(JAXBProvider.java:161) [restapi-jaxrs.jar:]
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:61) [resteasy-jaxrs.jar:3.0.18.Final-redhat-1]
        at org.jboss.resteasy.core.interception.ServerReaderInterceptorContext.readFrom(ServerReaderInterceptorContext.java:60) [resteasy-jaxrs.jar:3.0.18.Final-redhat-1]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:743)
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:262)
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:257)

Expected results:
Import from Glance via REST API should work

Additional info:
engine.log, server.log

Comment 1 Yaniv Kaul 2017-01-09 07:19:08 UTC
Elad - your server.log has many exceptions. Can you provide a reproduction on a clean environment? Does that happen with v3, v4 or both APIs?

Comment 2 Juan Hernández 2017-01-09 15:34:25 UTC
I miss an "<action>" at the beginning of the request body, and that seems to be what the server is complaining about. Please add that, and check again.

Comment 3 Elad 2017-01-09 15:37:02 UTC
Created attachment 1238814 [details]

This doesn't reproduce all the time and seems to happen only with v4.

It seems to be reproduced while the hypervisors have connectivity issues with the storage.

Attaching new logs from second occurrence. 

v4 attempt:

017-01-09 17:29:44,007 ERROR [org.ovirt.engine.api.v3.V3IOExceptionMapper] (default task-10) [] IO exception while processing "POST" request for path "/storagedomains/ebc4064d-bdbe-4c43-b79

v3 attempt:

2017-01-09 17:31:28,690 INFO  [org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand] (default task-6) [6384bef] Running command: ImportRepoImageCommand Task handler: ImportRepoImageCreateTaskHandler internal: false. Entities affected :  ID: e89cda99-66b2-4f23-b0ee-8195c13c6ed9 Type: StorageAction group CREATE_DISK with role type USER,  ID: ebc4064d-bdbe-4c43-b790-1108656d6def Type: StorageAction group ACCESS_IMAGE_STORAGE with role type USER

Comment 4 Elad 2017-01-09 15:39:30 UTC
(In reply to Juan Hernández from comment #2)
> I miss an "<action>" at the beginning of the request body, and that seems to
> be what the server is complaining about. Please add that, and check again.

You're right. With V4, if <action> is not passed, engine throws the exception. 
With v3 I get "Request syntactically incorrect. See the description below for the correct usage"

Comment 5 Juan Hernández 2017-01-09 15:41:17 UTC
OK, so this is about improving the error response. Thanks Elad.

Comment 6 Red Hat Bugzilla Rules Engine 2017-01-09 15:41:21 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 7 Oved Ourfali 2017-09-12 09:39:55 UTC
Doesn't seem important enough to prioritize.
Closing as wontfix.

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