← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1773935] Re: Unable to upload image via dashboard

 

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 <michal.arbet@xxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1773935

Title:
  Unable to upload image via dashboard

Status in OpenStack Dashboard (Horizon):
  Fix Released

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1773935/+subscriptions


References