Re: [galaxy-dev] [API] Apache error?

2011-08-02 Thread Louise-Amélie Schmitt
Ok, I found some tape I can put on it. Here: 
http://misc.feedfury.com/content/45712644-anton-bobrov-bad-servers-chunked-encoding-and-incompleteread.html


In scripts/api/common.py I put this piece of code at the beginning of 
the file, after the imports:


import httplib
def patch_http_response_read(func):
def inner(*args):
try:
return func(*args)
except httplib.IncompleteRead, e:
return e.partial
return inner
httplib.HTTPResponse.read = 
patch_http_response_read(httplib.HTTPResponse.read)


And it works fine now.



Le 29/07/2011 17:06, Louise-Amélie Schmitt a écrit :

Hello everyone,

I'm working on a script that uploads files and launchs workflows on 
them, but I keep getting errors that appear more or less randomly when 
the display() and submit() functions are called. In a nutshell, there 
is a 1/3 chance the calls fail this way.


Nevertheless, the actions are properly triggered in Galaxy, surprisingly.

Here is an example:

When I launch a workflow, I get the following traceback even though 
the workflow is properly executed:


http://localhost/galaxy-dev/api/workflows?key=273c7b4e3aaffd3884ef715aaf780d9a 


  File "automated_preprocessing.py", line 61, in expandFile
result = submit( api_key, api_url + 'workflows', wf_data, 
return_formatted=False)

  File "common.py", line 100, in submit
r = post( api_key, url, data )
  File "common.py", line 44, in post
return simplejson.loads( urllib2.urlopen( req ).read() )
  File 
"/g/steinmetz/collaboration/software/CentOS5/opt/Python-2.6.5/lib/python2.6/socket.py", 
line 329, in read

data = self._sock.recv(rbufsize)
  File 
"/g/steinmetz/collaboration/software/CentOS5/opt/Python-2.6.5/lib/python2.6/httplib.py", 
line 518, in read

return self._read_chunked(amt)
  File 
"/g/steinmetz/collaboration/software/CentOS5/opt/Python-2.6.5/lib/python2.6/httplib.py", 
line 561, in _read_chunked

raise IncompleteRead(''.join(value))
Failed to expand file A:
Type: 
IncompleteRead(118 bytes read)

Therefore, I cannot get the results within the script.

Any idea?

Best,
L-A
___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

 http://lists.bx.psu.edu/


___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

 http://lists.bx.psu.edu/


[galaxy-dev] [API] Apache error?

2011-07-29 Thread Louise-Amélie Schmitt

Hello everyone,

I'm working on a script that uploads files and launchs workflows on 
them, but I keep getting errors that appear more or less randomly when 
the display() and submit() functions are called. In a nutshell, there is 
a 1/3 chance the calls fail this way.


Nevertheless, the actions are properly triggered in Galaxy, surprisingly.

Here is an example:

When I launch a workflow, I get the following traceback even though the 
workflow is properly executed:


http://localhost/galaxy-dev/api/workflows?key=273c7b4e3aaffd3884ef715aaf780d9a
  File "automated_preprocessing.py", line 61, in expandFile
result = submit( api_key, api_url + 'workflows', wf_data, 
return_formatted=False)

  File "common.py", line 100, in submit
r = post( api_key, url, data )
  File "common.py", line 44, in post
return simplejson.loads( urllib2.urlopen( req ).read() )
  File 
"/g/steinmetz/collaboration/software/CentOS5/opt/Python-2.6.5/lib/python2.6/socket.py", 
line 329, in read

data = self._sock.recv(rbufsize)
  File 
"/g/steinmetz/collaboration/software/CentOS5/opt/Python-2.6.5/lib/python2.6/httplib.py", 
line 518, in read

return self._read_chunked(amt)
  File 
"/g/steinmetz/collaboration/software/CentOS5/opt/Python-2.6.5/lib/python2.6/httplib.py", 
line 561, in _read_chunked

raise IncompleteRead(''.join(value))
Failed to expand file A:
Type: 
IncompleteRead(118 bytes read)

Therefore, I cannot get the results within the script.

Any idea?

Best,
L-A
___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

 http://lists.bx.psu.edu/