Unable to upload image via dashboard

Bug #1773935 reported by Michal Arbet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Michal Arbet

Bug Description

It is unable to upload image via Horizon Dashboard.
Admin -> compute -> images -> Create new Image

Here is error log from apache:

 Failed to remove temporary image file /tmp/tmpx0sza19m.upload ([Errno 2] No such file or directory: '/tmp/tmpx0sza19m.upload')
 Unhandled exception in thread started by <function image_create.<locals>.upload at 0x7f651ac7bb70>
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/openstack_dashboard/api/glance.py", line 465, in upload
     return glanceclient(request).images.upload(image.id, data)
   File "/usr/lib/python3/dist-packages/glanceclient/common/utils.py", line 545, in inner
     return RequestIdProxy(wrapped(*args, **kwargs))
   File "/usr/lib/python3/dist-packages/glanceclient/v2/images.py", line 238, in upload
     return (resp, body), resp
   File "/usr/lib/python3/dist-packages/glanceclient/common/http.py", line 318, in put
     class SessionClient(adapter.Adapter, _BaseHTTPClient):
   File "/usr/lib/python3/dist-packages/glanceclient/common/http.py", line 271, in _request
     {'url': conn_url, 'e': e})
   File "/usr/lib/python3/dist-packages/requests/sessions.py", line 508, in request
     resp = self.send(prep, **send_kwargs)
   File "/usr/lib/python3/dist-packages/requests/sessions.py", line 618, in send
     r = adapter.send(request, **kwargs)
   File "/usr/lib/python3/dist-packages/requests/adapters.py", line 460, in send
     for i in request.body:
   File "/usr/lib/python3/dist-packages/glanceclient/common/http.py", line 92, in _chunk_body
     # a file-like object
   File "/usr/lib/python3.5/tempfile.py", line 622, in func_wrapper
     return func(*args, **kwargs)
 ValueError: read of closed file

I tried replicate the issue on devstack/queens but it is working there ... ( i think the issue is python3 related , so on devstack it is working because devstack is running under py2.7 )
I'm running horizon and also glance on python3 , installed from debian packages which are now supporting python3.

dpkg -l | grep horizon

ii python3-django-horizon 3:13.0.1-1 all Django module providing web interaction with OpenStack

dpkg -l | grep glance

ii glance 2:16.0.1-2+deb9ut1 all OpenStack Image Registry and Delivery Service - Daemons

After upload image via dashboard , image is in queued state forewer ..

If you need some more findings from me ... Logs, tcpdumps , etc ... let me know ..

Thanks

Revision history for this message
Michal Arbet (michalarbet) wrote :

For example:

Dashboard -> Admin -> compute -> images -> Create Image ---> image=cirros , format=qcow2

information type: Public → Public Security
information type: Public Security → Public
Changed in horizon:
assignee: nobody → Michal Arbet (michalarbet)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/571174

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/571174
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=b84da5e84ef92e653084faed402bcac6271f1dfc
Submitter: Zuul
Branch: master

commit b84da5e84ef92e653084faed402bcac6271f1dfc
Author: Michal Arbet <email address hidden>
Date: Wed May 30 10:56:47 2018 +0000

    Fix issue with uploading image to glance on Python3

    It was unable to upload image when horizon was running on python3,
    there was a problem with closed file in new thread. This commit is
    fixing this issue with added if clause whether horizon running on
    python2 or python3 and correctly call close_called on file when
    running on python3.

    Change-Id: Ice178f6269ac527ba62b26d86976b5336987c922
    Closes-Bug: #1773935

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 14.0.0.0b2

This issue was fixed in the openstack/horizon 14.0.0.0b2 development milestone.

Revision history for this message
nissekalle (nissekalle) wrote :

I have CentOS 7.0, kolla-ansible 7.0.1, rocky, ceph in the background 8 disks with 2 on 4 hosts, 2 compute nodes installed and thereby python 2.7

I still have exactly the same problem as above

Revision history for this message
nissekalle (nissekalle) wrote :

Here is my horizon.log:

[Sun Mar 03 13:53:58.435994 2019] [:error] [pid 17] Login successful for user "admin" using domain "Default", remote address 192.168.100.11.
[Sun Mar 03 13:54:29.642059 2019] [:error] [pid 18] WARNING:root:Use of this 'djano.wsgi' file has been deprecated since the Rocky release in favor of 'wsgi.py' in the 'openstack_dashboard' module. This file is a legacy naming from before Django 1.4 and an importable 'wsgi.py' is now the default. This file will be removed in the T release cycle.
[Sun Mar 03 13:57:03.894746 2019] [:error] [pid 18] Call to list supported extensions failed. This is likely due to a problem communicating with the Nova endpoint. Host Aggregates panel will not be displayed.
[Sun Mar 03 13:57:15.332920 2019] [:error] [pid 19] Unhandled exception in thread started by <function upload at 0x7f8b38c00b90>
[Sun Mar 03 13:57:15.332994 2019] [:error] [pid 19] Traceback (most recent call last):
[Sun Mar 03 13:57:15.333017 2019] [:error] [pid 19] File "/usr/share/openstack-dashboard/openstack_dashboard/api/glance.py", line 545, in upload
[Sun Mar 03 13:57:15.334655 2019] [:error] [pid 19] return glanceclient(request).images.upload(image.id, data)
[Sun Mar 03 13:57:15.335153 2019] [:error] [pid 19] File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 598, in inner
[Sun Mar 03 13:57:15.335834 2019] [:error] [pid 19] return RequestIdProxy(wrapped(*args, **kwargs))
[Sun Mar 03 13:57:15.336348 2019] [:error] [pid 19] File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 288, in upload
[Sun Mar 03 13:57:15.337329 2019] [:error] [pid 19] resp, body = self.http_client.put(url, headers=hdrs, data=body)
[Sun Mar 03 13:57:15.345700 2019] [:error] [pid 19] File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 320, in put
[Sun Mar 03 13:57:15.346012 2019] [:error] [pid 19] return self._request('PUT', url, **kwargs)
[Sun Mar 03 13:57:15.346075 2019] [:error] [pid 19] File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 306, in _request
[Sun Mar 03 13:57:15.346196 2019] [:error] [pid 19] resp, body_iter = self._handle_response(resp)
[Sun Mar 03 13:57:15.346223 2019] [:error] [pid 19] File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 126, in _handle_response
[Sun Mar 03 13:57:15.346268 2019] [:error] [pid 19] raise exc.from_response(resp, resp.content)
[Sun Mar 03 13:57:15.346310 2019] [:error] [pid 19] glanceclient.exc.HTTPInternalServerError: 500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

Why this error? I don't understand it! Is there anyone who can help me!?!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.