Bug 1402331 - Unable to upload disk via API
Summary: Unable to upload disk via API
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-imageio
Classification: oVirt
Component: Daemon
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Amit Aviram
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-07 09:26 UTC by Ondra Machacek
Modified: 2016-12-07 10:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-07 10:40:36 UTC
oVirt Team: ---
rule-engine: ovirt-4.0.z+


Attachments (Terms of Use)

Description Ondra Machacek 2016-12-07 09:26:09 UTC
Every time I upload disk via API it failed on following exception:

 2016-12-07 09:06:58,529 ERROR   (Thread-1) [web] Failed to dispatch request
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_common/web.py", line 48, in __call__
    resp = self.dispatch(request)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_common/web.py", line 74, in dispatch
    return method(*match.groups())
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_daemon/server.py", line 184, in put
    ticket = get_ticket(ticket_id, "write", offset + size)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_daemon/server.py", line 160, in get_ticket
    raise HTTPForbidden("Content-Length(%d) out of allowed range(%d)" %( size, ticket['size']))
HTTPForbidden: Content-Length(8388608) out of allowed range(1024)

The failed code is here:
https://github.com/oVirt/ovirt-imageio/blob/master/daemon/ovirt_imageio_daemon/server.py#L159

When I remove this condition everything works fine.

The code I use to upload disk is here:

 https://gerrit.ovirt.org/#/c/65962/

Comment 1 Ondra Machacek 2016-12-07 10:40:36 UTC
The problem was that the disk created by the script was created as 1**20, which is 1KiB. So wasn't possible to upload the real disk data there which was 21MiB, closing as not a bug.


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