libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-598) IOError, 'Not a gzipped file' on LINODE driver
Date Wed, 30 Jul 2014 21:36:39 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14080016#comment-14080016
] 

ASF GitHub Bot commented on LIBCLOUD-598:
-----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/libcloud/pull/342


> IOError, 'Not a gzipped file' on LINODE driver
> ----------------------------------------------
>
>                 Key: LIBCLOUD-598
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-598
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>            Reporter: Juan Carlos Moreno
>
> Linode response has "Content-Encoding: gzip" but plain text body is returned:
> Request:
> curl -i -X GET -H 'Host: api.linode.com' -H 'Accept-Encoding: gzip,deflate' --compress
'https://api.linode.com:443/?api_key=*********&api_responseFormat=json&api_action=avail.datacenters'
> Response:
> HTTP/1.1 200 OK
> Server: nginx/1.1.19
> Date: Fri, 18 Jul 2014 09:47:34 GMT
> Content-Type: application/json;charset=UTF-8
> Transfer-Encoding: chunked
> Connection: keep-alive
> X-Powered-By: Tiger Blood
> Vary: Accept-Encoding
> Content-Encoding: gzip
> Strict-Transport-Security: max-age=31536000
> {"ERRORARRAY":[],"DATA":[{"LOCATION":"Dallas, TX, USA","DATACENTERID":2,"ABBR":"dallas"},{"LOCATION":"Fremont,
CA, USA","DATACENTERID":3,"ABBR":"fremont"},{"LOCATION":"Atlanta, GA, USA","DATACENTERID":4,"ABBR":"atlanta"},{"LOCATION":"Newark,
NJ, USA","DATACENTERID":6,"ABBR":"newark"},{"LOCATION":"London, England, UK","DATACENTERID":7,"ABBR":"london"},{"LOCATION":"Tokyo,
JP","DATACENTERID":8,"ABBR":"tokyo"}],"ACTION":"avail.datacenters"}
> Exception:
>   File ".libcloud/compute/drivers/ecm_linode.py", line 119, in list_nodes
>     data = self.connection.request(API_ROOT, params=params).objects[0]
>   File ".libcloud/common/base.py", line 687, in request
>     response = responseCls(**kwargs)
>   File ".libcloud/common/linode.py", line 91, in __init__
>     headers=self.headers)
>   File ".libcloud/common/base.py", line 172, in _decompress_response
>     body = decompress_data('gzip', body)
>   File ".libcloud/utils/compression.py", line 39, in decompress_data
>     return gzip.GzipFile(fileobj=cls(data)).read()
>   File "/usr/lib/python2.6/gzip.py", line 212, in read
>     self._read(readsize)
>   File "/usr/lib/python2.6/gzip.py", line 255, in _read
>     self._read_gzip_header()
>   File "/usr/lib/python2.6/gzip.py", line 156, in _read_gzip_header
>     raise IOError, 'Not a gzipped file'
> Proposed solution (caught IOError exception and continue)
> libcloud/common/linode.py
> <         self.body = self._decompress_response(body=response.read(),
> ---
> >         # ECmanaged: Linode hack
> >         # sends "Content-Encoding: gzip" header but a plain/text response      
   
> >         response_read = response.read()
> > 
> >         try:
> >             self.body = self._decompress_response(body=response_read,
> 91a97,98
> >         except IOError:
> >             self.body = response_read.strip()



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message