Hi Conrad,


I will see if I can change to POST.

To explain a bit: Jalview (Java) application uses POST, we now have a Javascript version which for the moment is limited to sending GET requests, so I tweaked the code for that. I will see if I can persuade it to fake a POST instead and let you know what I find.


Thanks,


Mungo


Email signature
 
University of Dundee shield logo    

Mungo Carstairs
Jalview Computational Scientist

The Barton Group
Division of Computational Biology

School of Life Sciences

University of Dundee, Dundee, Scotland, UK

www.jalview.org

www.compbio.dundee.ac.uk 
g.m.carstairs@dundee.ac.uk

University of Dundee Facebook University of Dundee Twitter University of Dundee LinkedIn University of Dundee YouTube University of Dundee Instagram University of Dundee Snapchat 
We're Scottish University of the Year again!
The Times / Sunday Times Good University Guide 2016 and 2017

From: Conrad Huang <conrad@cgl.ucsf.edu>
Sent: 04 February 2019 21:21:12
To: Mungo Carstairs (Staff); chimera-users@cgl.ucsf.edu
Subject: Re: [Chimera-users] Help: 'broken pipe' error
 
Hi, Mungo.

I tried using the RESTserver on a recent daily build, and it opening
4zhp worked fine.  Since RESTserver hasn't changed in a very long time,
I suspect the results would be the same with 1.13.

The way I tested it is to start the RESTserver in Chimera, and then go
to a browser to visit "http://localhost:PORT/static/cmdline.html" where
PORT is the port number reported in the Reply Log.  A form is displayed
in the browser and I type in "open cifID:4zhp", which runs the command
and displays Chimera messages in the browser rather than the Reply Log.

I did notice that your tests show messages like:

> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET /run?command=list%20residues%20spec%20%230 HTTP/1.1" 200 -

whereas mine show:

> 127.0.0.1 - - [04/Feb/2019 12:02:46] "POST /run HTTP/1.1" 200 -

That looks to me like you are sending requests using http GET, whereas
my tests are using POST.  It /shouldn't/ make any difference, but would
it be possible for you to test using POST to send requests to Chimera
instead of GET?

Conrad

On 2/1/2019 2:43 AM, Mungo Carstairs (Staff) wrote:
> Hi there,
>
>
> I'm experimenting with Jalview /as Javascript/ talking to Chimera over
> the latter's REST server.
>
> The first few 'list models' commands work fine, but when I send a
> command 'open cifID:4zhp' I (usually but not always) get an error
> '[Errno 32] Broken Pipe' in Chimera. Is there a clue in the stack traces
> below as to the reason for this? Thanks.
>
>
> Chimera 1.12 (build 41481) on OSX Sierra 10.12.6.
>
>
> REST server on host 127.0.0.1 port 53135
> 127.0.0.1 - - [01/Feb/2019 10:06:14] "GET
> /run?command=list%20models%20type%20molecule HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=list%20models%20type%20molecule HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=list%20models%20type%20molecule HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=open%20cifID%3A4zhp HTTP/1.1" 200 -
> Traceback (most recent call last):
>    File
> "/Applications/Chimera.app/Contents/Resources/share/chimera/threadq.py",
> line 50, in _checkThread
>      callable()
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 83, in run
>      _run(q, h, args)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 163, in _run
>      replyobj.error(str(v) + '\n')
>    File
> "/Applications/Chimera.app/Contents/Resources/share/chimera/replyobj.py", line
> 637, in error
>      _replyStack[-1].error(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 184, in writeLine
>      self.write(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 191, in write
>      self.f.write(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 328, in write
>      self.flush()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 307, in flush
>      self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 32] Broken pipe
> thread callback:
> error: [Errno 32] Broken pipe
>
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 307, in flush
>      self._sock.sendall(view[write_offset:write_offset+buffer_size])
>
> See reply log for Python traceback.
>
>
> ----------------------------------------
> Exception happened during processing of request from ('127.0.0.1', 53326)
> Traceback (most recent call last):
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 295, in _handle_request_noblock
>      self.process_request(request, client_address)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 321, in process_request
>      self.finish_request(request, client_address)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 334, in finish_request
>      self.RequestHandlerClass(request, client_address, self)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 657, in __init__
>      self.finish()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 716, in finish
>      self.wfile.close()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 283, in close
>      self.flush()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 307, in flush
>      self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 32] Broken pipe
> ----------------------------------------
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=list%20models%20type%20molecule HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=list%20model%20spec%20%230%20attribute%20color HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=list%20residues%20spec%20%230 HTTP/1.1" 200 -
> Traceback (most recent call last):
>    File
> "/Applications/Chimera.app/Contents/Resources/share/chimera/threadq.py",
> line 50, in _checkThread
>      callable()
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 83, in run
>      _run(q, h, args)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 159, in _run
>      chimera.runCommand(cmd)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/chimera/__init__.py", line
> 2750, in runCommand
>      makeCommand(*args, **kw)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/Midas/midas_text.py", line
> 69, in makeCommand
>      f(c, args)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/ListInfo/ChimeraExtension.py",
> line 20, in command
>      self.module("cmdline").process(cmdName, args)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/ListInfo/cmdline.py", line
> 12, in process
>      doList(args)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/ListInfo/cmdline.py", line
> 543, in doList
>      doExtensionFunc(func, otherArgs, **kwargs)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/Midas/midas_text.py", line
> 451, in doExtensionFunc
>      extFunc(*tuple(processedArgs), **kw)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/ListInfo/cmdline.py", line
> 192, in listr
>      replyobj.info(info)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/chimera/replyobj.py", line
> 625, in info
>      _replyStack[-1].info(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 202, in message
>      self.writeLine(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 184, in writeLine
>      self.write(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/share/RESTServer/__init__.py",
> line 191, in write
>      self.f.write(s)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 328, in write
>      self.flush()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 307, in flush
>      self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 32] Broken pipe
> thread callback:
> error: [Errno 32] Broken pipe
>
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 307, in flush
>      self._sock.sendall(view[write_offset:write_offset+buffer_size])
>
> See reply log for Python traceback.
>
>
> ----------------------------------------
> Exception happened during processing of request from ('127.0.0.1', 53329)
> Traceback (most recent call last):
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 295, in _handle_request_noblock
>      self.process_request(request, client_address)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 321, in process_request
>      self.finish_request(request, client_address)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 334, in finish_request
>      self.RequestHandlerClass(request, client_address, self)
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 657, in __init__
>      self.finish()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/SocketServer.py",
> line 716, in finish
>      self.wfile.close()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 283, in close
>      self.flush()
>    File
> "/Applications/Chimera.app/Contents/Resources/lib/python2.7/socket.py",
> line 307, in flush
>      self._sock.sendall(view[write_offset:write_offset+buffer_size])
> error: [Errno 32] Broken pipe
> ----------------------------------------
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET /run?command=focus HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:03] "GET
> /run?command=list%20models%20type%20molecule HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:05] "GET
> /run?command=color%20%238db520%20%230%3A2-98.A HTTP/1.1" 200 -
> 127.0.0.1 - - [01/Feb/2019 10:32:05] "GET
> /run?command=color%20%238db520%20%230%3A2-98.A HTTP/1.1" 200 -
>
>
> Email signature
> University of Dundee shield logo <http://uod.ac.uk/sig-home>                  
>
> *Mungo Carstairs*
> Jalview Computational Scientist
>
> The Barton Group
> Division of Computational Biology
>
> School of Life Sciences
>
> University of Dundee, Dundee, Scotland, UK
>
> www.jalview.org <http://www.jalview.org>
>
> www.compbio.dundee.ac.uk <http://www.compbio.dundee.ac.uk>
> g.m.carstairs@dundee.ac.uk <mailto:g.m.carstairs@dundee.ac.uk>
>
> University of Dundee Facebook <http://uod.ac.uk/sig-fb> University of
> Dundee Twitter <http://uod.ac.uk/sig-tw> University of Dundee LinkedIn
> <http://uod.ac.uk/sig-li> University of Dundee YouTube
> <http://uod.ac.uk/sig-yt> University of Dundee Instagram
> <http://uod.ac.uk/sig-ig> University of Dundee Snapchat
> <http://uod.ac.uk/sig-sc>
> *We're Scottish University of the Year again!*
> <http://uod.ac.uk/sig-strapline>
> The Times / Sunday Times Good University Guide 2016 and 2017
>
>
> The University of Dundee is a registered Scottish Charity, No: SC015096
>
> _______________________________________________
> Chimera-users mailing list: Chimera-users@cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>


The University of Dundee is a registered Scottish Charity, No: SC015096