Public bug reported:

While downloading image data via 'glance client' we require to
explicitly specify where the output should go. We need to specify output
file either via '--file' command option or via stdout redirection. If we
do not explicitly specify we get an error message which is fine but
current implementation(on master) causes a TRACEBACK on the service
side. Although the TRACEBACK is not fatal but it does look bad.

Steps to reproduce:

$ glance image-download <IMAGE ID>

Sample command output:

vagrant@ubuntu16:~$ glance image-download af9105b5-fc18-47b4-890d-c7f46e97b190
No redirection or local file specified for downloaded image data. Please 
specify a local file with --file to save downloaded image or redirect output to 
another source.

Sample glance api log output:

2016-10-18 15:26:25.481 DEBUG glance.api.middleware.version_negotiation [-] 
Using url versioning from (pid=4737) process_request /o
pt/stack/glance/glance/api/middleware/version_negotiation.py:58
2016-10-18 15:26:25.482 DEBUG glance.api.middleware.version_negotiation [-] 
Matched version: v2 from (pid=4737) process_request /op
t/stack/glance/glance/api/middleware/version_negotiation.py:70
2016-10-18 15:26:25.483 DEBUG glance.api.middleware.version_negotiation [-] new 
path /v2/images/af9105b5-fc18-47b4-890d-c7f46e97b190/file from (pid=4737) 
process_request 
/opt/stack/glance/glance/api/middleware/version_negotiation.py:71
2016-10-18 15:26:25.528 DEBUG glance.api.middleware.cache 
[req-42c4c736-baa2-41fe-b0ff-a9ba16dcbf0a 32b19608a63e45268f2afcac14f59539 
9cecc6ab160e405cb854d1671657a983] Cache hit for image 
'af9105b5-fc18-47b4-890d-c7f46e97b190' from (pid=4737) process_request 
/opt/stack/glance/glance/api/middleware/cache.py:165
2016-10-18 15:26:25.532 INFO eventlet.wsgi.server 
[req-42c4c736-baa2-41fe-b0ff-a9ba16dcbf0a 32b19608a63e45268f2afcac14f59539 
9cecc6ab160e405cb854d1671657a983] Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 506, in 
handle_one_response
    write(b''.join(towrite))
  File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 452, in 
write
    wfile.writelines(towrite)
  File "/usr/lib/python2.7/socket.py", line 338, in writelines
    self.flush()
  File "/usr/lib/python2.7/socket.py", line 307, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", line 
385, in sendall
    tail = self.send(data, flags)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", line 
379, in send
    return self._send_loop(self.fd.send, data, flags)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", line 
366, in _send_loop
    return send_method(data, *args)
error: [Errno 104] Connection reset by peer

We have same behavior for both v1 and v2 glance clients.

Also 'openstack client' does not have this issue. There default behavior
is to simply send data to stdout unless we explicitly provide '--file'
option.

** Affects: glance
     Importance: Undecided
     Assignee: Ravi Shekhar Jethani (ravishekar-jethani)
         Status: New

** Changed in: glance
     Assignee: (unassigned) => Ravi Shekhar Jethani (ravishekar-jethani)

** Summary changed:

- Command arguments checked after initiating download
+ TRACEBACK if no output file specified while image download

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1634452

Title:
  TRACEBACK if no output file specified while image download

Status in Glance:
  New

Bug description:
  While downloading image data via 'glance client' we require to
  explicitly specify where the output should go. We need to specify
  output file either via '--file' command option or via stdout
  redirection. If we do not explicitly specify we get an error message
  which is fine but current implementation(on master) causes a TRACEBACK
  on the service side. Although the TRACEBACK is not fatal but it does
  look bad.

  Steps to reproduce:

  $ glance image-download <IMAGE ID>

  Sample command output:

  vagrant@ubuntu16:~$ glance image-download af9105b5-fc18-47b4-890d-c7f46e97b190
  No redirection or local file specified for downloaded image data. Please 
specify a local file with --file to save downloaded image or redirect output to 
another source.

  Sample glance api log output:

  2016-10-18 15:26:25.481 DEBUG glance.api.middleware.version_negotiation [-] 
Using url versioning from (pid=4737) process_request /o
  pt/stack/glance/glance/api/middleware/version_negotiation.py:58
  2016-10-18 15:26:25.482 DEBUG glance.api.middleware.version_negotiation [-] 
Matched version: v2 from (pid=4737) process_request /op
  t/stack/glance/glance/api/middleware/version_negotiation.py:70
  2016-10-18 15:26:25.483 DEBUG glance.api.middleware.version_negotiation [-] 
new path /v2/images/af9105b5-fc18-47b4-890d-c7f46e97b190/file from (pid=4737) 
process_request 
/opt/stack/glance/glance/api/middleware/version_negotiation.py:71
  2016-10-18 15:26:25.528 DEBUG glance.api.middleware.cache 
[req-42c4c736-baa2-41fe-b0ff-a9ba16dcbf0a 32b19608a63e45268f2afcac14f59539 
9cecc6ab160e405cb854d1671657a983] Cache hit for image 
'af9105b5-fc18-47b4-890d-c7f46e97b190' from (pid=4737) process_request 
/opt/stack/glance/glance/api/middleware/cache.py:165
  2016-10-18 15:26:25.532 INFO eventlet.wsgi.server 
[req-42c4c736-baa2-41fe-b0ff-a9ba16dcbf0a 32b19608a63e45268f2afcac14f59539 
9cecc6ab160e405cb854d1671657a983] Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 506, 
in handle_one_response
      write(b''.join(towrite))
    File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 452, 
in write
      wfile.writelines(towrite)
    File "/usr/lib/python2.7/socket.py", line 338, in writelines
      self.flush()
    File "/usr/lib/python2.7/socket.py", line 307, in flush
      self._sock.sendall(view[write_offset:write_offset+buffer_size])
    File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", 
line 385, in sendall
      tail = self.send(data, flags)
    File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", 
line 379, in send
      return self._send_loop(self.fd.send, data, flags)
    File "/usr/local/lib/python2.7/dist-packages/eventlet/greenio/base.py", 
line 366, in _send_loop
      return send_method(data, *args)
  error: [Errno 104] Connection reset by peer

  We have same behavior for both v1 and v2 glance clients.

  Also 'openstack client' does not have this issue. There default
  behavior is to simply send data to stdout unless we explicitly provide
  '--file' option.

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to