You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Dr. Andrew Perella" <aj...@eutechnyx.com> on 2010/11/09 18:47:49 UTC

Cassandra - python communication problem

Hi,

I have been trying to connect to Cassandra 0.7.0-beta3 via python to no avail:

vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$ Cassandra-remote  -h localhost:9160 describe_keyspace system
Traceback (most recent call last):
  File "/usr/local/bin/Cassandra-remote", line 5, in <module>
    pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote", line 204, in <module>
    pp.pprint(client.describe_keyspace(args[0],))
  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1006, in describe_keyspace
    return self.recv_describe_keyspace()
  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1017, in recv_describe_keyspace
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  File "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin
    sz = self.readI32()
  File "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py", line 203, in readI32
    buff = self.trans.readAll(4)
  File "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py", line 58, in readAll
    chunk = self.read(sz-have)
  File "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py", line 155, in read
    self.__rbuf = StringIO(self.__trans.read(max(sz, self.DEFAULT_BUFFER)))
  File "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py", line 94, in read
    raise TTransportException(type=TTransportException.END_OF_FILE, message='TSocket read 0 bytes')
thrift.transport.TTransport.TTransportException: TSocket read 0 bytes

I get similar errors for all queries.

I cannot work out what is going wrong here. Can anyone help? (I need many of the functions only added in 0.7)

Best Regards,
Andrew


This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. 

This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net


www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322

RE: Cassandra - python communication problem

Posted by "Dr. Andrew Perella" <aj...@eutechnyx.com>.
Thanks - I will look into this. The reason for trying to get the python_cassandra package working is that I have a working site talking to a windows hosted version of Cassandra. I now want to move this to linux but cannot get the corresponding linux version (Unfortunately the windows machine was set up with a nightly release somewhere between 0.64 and 0.65!)


From: Tyler Hobbs [mailto:tyler@riptano.com]
Sent: 09 November 2010 18:22
To: user@cassandra.apache.org
Subject: Re: Cassandra - python communication problem

I would recommend using pycassa 0.5.2 <http://github.com/pycassa/pycassa> for working with 0.7.0-beta3 in python.  It's much nicer than raw Thrift, too :)

- Tyler
On Tue, Nov 9, 2010 at 12:19 PM, Jonathan Ellis <jb...@gmail.com>> wrote:
python_cassandra-0.6.1 sure doesn't look like a package I'd expect to
work with 0.7.

On Tue, Nov 9, 2010 at 12:07 PM, Dr. Andrew Perella <aj...@eutechnyx.com>> wrote:
> Thanks Jonathan,
> So it looks like the python bindings are using a deprecated non framed protocol. Leaving that problem aside for a moment I changed the server to work in non framed mode and now get a different error:
>
>
> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$ Cassandra-remote  -h localhost:9160 describe_keyspace systemTraceback (most recent call last):
>  File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>    pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
>    self.require(requires)[0].run_script(script_name, ns)
>  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
>    execfile(script_filename, namespace, namespace)
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote", line 204, in <module>
>    pp.pprint(client.describe_keyspace(args[0],))
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1006, in describe_keyspace
>    return self.recv_describe_keyspace()
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1030, in recv_describe_keyspace
>    raise TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace failed: unknown result");
> thrift.Thrift.TApplicationException: describe_keyspace failed: unknown result
>
> Any ideas?
> Cheers,
> Andrew
>
> -----Original Message-----
> From: Jonathan Ellis [mailto:jbellis@gmail.com<ma...@gmail.com>]
> Sent: 09 November 2010 17:56
> To: user
> Subject: Re: Cassandra - python communication problem
>
> You're using an unframed transport to talk to a framed server, or vice versa.
>
> On Tue, Nov 9, 2010 at 11:47 AM, Dr. Andrew Perella <aj...@eutechnyx.com>> wrote:
>> Hi,
>>
>>
>>
>> I have been trying to connect to Cassandra 0.7.0-beta3 via python to no
>> avail:
>>
>>
>>
>> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
>> Cassandra-remote  -h localhost:9160 describe_keyspace system
>>
>> Traceback (most recent call last):
>>
>>   File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>>
>>     pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>>
>>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
>> run_script
>>
>>     self.require(requires)[0].run_script(script_name, ns)
>>
>>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in
>> run_script
>>
>>     execfile(script_filename, namespace, namespace)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
>> line 204, in <module>
>>
>>     pp.pprint(client.describe_keyspace(args[0],))
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
>> line 1006, in describe_keyspace
>>
>>     return self.recv_describe_keyspace()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
>> line 1017, in recv_describe_keyspace
>>
>>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
>> line 126, in readMessageBegin
>>
>>     sz = self.readI32()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
>> line 203, in readI32
>>
>>     buff = self.trans.readAll(4)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
>> line 58, in readAll
>>
>>     chunk = self.read(sz-have)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
>> line 155, in read
>>
>>     self.__rbuf = StringIO(self.__trans.read(max(sz, self.DEFAULT_BUFFER)))
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py",
>> line 94, in read
>>
>>     raise TTransportException(type=TTransportException.END_OF_FILE,
>> message='TSocket read 0 bytes')
>>
>> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>>
>>
>>
>> I get similar errors for all queries.
>>
>>
>>
>> I cannot work out what is going wrong here. Can anyone help? (I need many of
>> the functions only added in 0.7)
>>
>>
>>
>> Best Regards,
>>
>> Andrew
>>
>>
>>
>>
>>
>> This e-mail is confidential and may be privileged. It may be read, copied
>> and used only by the intended recipient. No communication sent by e-mail to
>> or from Eutechnyx is intended to give rise to contractual or other legal
>> liability, apart from liability which cannot be excluded under English law.
>>
>> This email has been scanned for all known viruses by www.epagency.net<http://www.epagency.net>.
>>
>> www.eutechnyx.com<http://www.eutechnyx.com> Eutechnyx Limited. Registered in England No: 2172322
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
> This email has been scanned for all known viruses by the Email Protection Agency.
> This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law.
>
> This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net
>
>
> www.eutechnyx.com<http://www.eutechnyx.com> Eutechnyx Limited. Registered in England No: 2172322
>



--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com


This email has been scanned for all known viruses by the Email Protection Agency
This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. 

This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net


www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322

Re: Cassandra - python communication problem

Posted by Tyler Hobbs <ty...@riptano.com>.
I would recommend using pycassa 0.5.2 <http://github.com/pycassa/pycassa>for
working with 0.7.0-beta3 in python.  It's much nicer than raw Thrift, too :)

- Tyler

On Tue, Nov 9, 2010 at 12:19 PM, Jonathan Ellis <jb...@gmail.com> wrote:

> python_cassandra-0.6.1 sure doesn't look like a package I'd expect to
> work with 0.7.
>
> On Tue, Nov 9, 2010 at 12:07 PM, Dr. Andrew Perella <aj...@eutechnyx.com>
> wrote:
> > Thanks Jonathan,
> > So it looks like the python bindings are using a deprecated non framed
> protocol. Leaving that problem aside for a moment I changed the server to
> work in non framed mode and now get a different error:
> >
> >
> > vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
> Cassandra-remote  -h localhost:9160 describe_keyspace systemTraceback (most
> recent call last):
> >  File "/usr/local/bin/Cassandra-remote", line 5, in <module>
> >    pkg_resources.run_script('python-cassandra==0.6.1',
> 'Cassandra-remote')
> >  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
> run_script
> >    self.require(requires)[0].run_script(script_name, ns)
> >  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in
> run_script
> >    execfile(script_filename, namespace, namespace)
> >  File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
> line 204, in <module>
> >    pp.pprint(client.describe_keyspace(args[0],))
> >  File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> line 1006, in describe_keyspace
> >    return self.recv_describe_keyspace()
> >  File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> line 1030, in recv_describe_keyspace
> >    raise TApplicationException(TApplicationException.MISSING_RESULT,
> "describe_keyspace failed: unknown result");
> > thrift.Thrift.TApplicationException: describe_keyspace failed: unknown
> result
> >
> > Any ideas?
> > Cheers,
> > Andrew
> >
> > -----Original Message-----
> > From: Jonathan Ellis [mailto:jbellis@gmail.com]
> > Sent: 09 November 2010 17:56
> > To: user
> > Subject: Re: Cassandra - python communication problem
> >
> > You're using an unframed transport to talk to a framed server, or vice
> versa.
> >
> > On Tue, Nov 9, 2010 at 11:47 AM, Dr. Andrew Perella <aj...@eutechnyx.com>
> wrote:
> >> Hi,
> >>
> >>
> >>
> >> I have been trying to connect to Cassandra 0.7.0-beta3 via python to no
> >> avail:
> >>
> >>
> >>
> >> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
> >> Cassandra-remote  -h localhost:9160 describe_keyspace system
> >>
> >> Traceback (most recent call last):
> >>
> >>   File "/usr/local/bin/Cassandra-remote", line 5, in <module>
> >>
> >>     pkg_resources.run_script('python-cassandra==0.6.1',
> 'Cassandra-remote')
> >>
> >>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
> >> run_script
> >>
> >>     self.require(requires)[0].run_script(script_name, ns)
> >>
> >>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194,
> in
> >> run_script
> >>
> >>     execfile(script_filename, namespace, namespace)
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
> >> line 204, in <module>
> >>
> >>     pp.pprint(client.describe_keyspace(args[0],))
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> >> line 1006, in describe_keyspace
> >>
> >>     return self.recv_describe_keyspace()
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> >> line 1017, in recv_describe_keyspace
> >>
> >>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
> >> line 126, in readMessageBegin
> >>
> >>     sz = self.readI32()
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
> >> line 203, in readI32
> >>
> >>     buff = self.trans.readAll(4)
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
> >> line 58, in readAll
> >>
> >>     chunk = self.read(sz-have)
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
> >> line 155, in read
> >>
> >>     self.__rbuf = StringIO(self.__trans.read(max(sz,
> self.DEFAULT_BUFFER)))
> >>
> >>   File
> >>
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py",
> >> line 94, in read
> >>
> >>     raise TTransportException(type=TTransportException.END_OF_FILE,
> >> message='TSocket read 0 bytes')
> >>
> >> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
> >>
> >>
> >>
> >> I get similar errors for all queries.
> >>
> >>
> >>
> >> I cannot work out what is going wrong here. Can anyone help? (I need
> many of
> >> the functions only added in 0.7)
> >>
> >>
> >>
> >> Best Regards,
> >>
> >> Andrew
> >>
> >>
> >>
> >>
> >>
> >> This e-mail is confidential and may be privileged. It may be read,
> copied
> >> and used only by the intended recipient. No communication sent by e-mail
> to
> >> or from Eutechnyx is intended to give rise to contractual or other legal
> >> liability, apart from liability which cannot be excluded under English
> law.
> >>
> >> This email has been scanned for all known viruses by www.epagency.net.
> >>
> >> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
> >
> >
> >
> > --
> > Jonathan Ellis
> > Project Chair, Apache Cassandra
> > co-founder of Riptano, the source for professional Cassandra support
> > http://riptano.com
> > This email has been scanned for all known viruses by the Email Protection
> Agency.
> > This e-mail is confidential and may be privileged. It may be read, copied
> and used only by the intended recipient. No communication sent by e-mail to
> or from Eutechnyx is intended to give rise to contractual or other legal
> liability, apart from liability which cannot be excluded under English law.
> >
> > This email has been scanned for all known viruses by the Email Protection
> Agency. http://www.epagency.net
> >
> >
> > www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
> >
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
>

RE: Cassandra - python communication problem

Posted by "Dr. Andrew Perella" <aj...@eutechnyx.com>.
Indeed, that has certainly troubled me! The python package index just links back to the main apache cassandra page and I can see no later version. My google-fu skills seem to be weak in tracking down any source repository of this.

Are you saying that no later version exists and I will have to create one? I had assumed Cassandra would commonly be used from python so would be able to jump in and use it.

Cheers,
Andrew



-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com] 
Sent: 09 November 2010 18:20
To: user
Subject: Re: Cassandra - python communication problem

python_cassandra-0.6.1 sure doesn't look like a package I'd expect to
work with 0.7.

On Tue, Nov 9, 2010 at 12:07 PM, Dr. Andrew Perella <aj...@eutechnyx.com> wrote:
> Thanks Jonathan,
> So it looks like the python bindings are using a deprecated non framed protocol. Leaving that problem aside for a moment I changed the server to work in non framed mode and now get a different error:
>
>
> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$ Cassandra-remote  -h localhost:9160 describe_keyspace systemTraceback (most recent call last):
>  File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>    pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
>    self.require(requires)[0].run_script(script_name, ns)
>  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
>    execfile(script_filename, namespace, namespace)
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote", line 204, in <module>
>    pp.pprint(client.describe_keyspace(args[0],))
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1006, in describe_keyspace
>    return self.recv_describe_keyspace()
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1030, in recv_describe_keyspace
>    raise TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace failed: unknown result");
> thrift.Thrift.TApplicationException: describe_keyspace failed: unknown result
>
> Any ideas?
> Cheers,
> Andrew
>
> -----Original Message-----
> From: Jonathan Ellis [mailto:jbellis@gmail.com]
> Sent: 09 November 2010 17:56
> To: user
> Subject: Re: Cassandra - python communication problem
>
> You're using an unframed transport to talk to a framed server, or vice versa.
>
> On Tue, Nov 9, 2010 at 11:47 AM, Dr. Andrew Perella <aj...@eutechnyx.com> wrote:
>> Hi,
>>
>>
>>
>> I have been trying to connect to Cassandra 0.7.0-beta3 via python to no
>> avail:
>>
>>
>>
>> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
>> Cassandra-remote  -h localhost:9160 describe_keyspace system
>>
>> Traceback (most recent call last):
>>
>>   File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>>
>>     pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>>
>>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
>> run_script
>>
>>     self.require(requires)[0].run_script(script_name, ns)
>>
>>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in
>> run_script
>>
>>     execfile(script_filename, namespace, namespace)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
>> line 204, in <module>
>>
>>     pp.pprint(client.describe_keyspace(args[0],))
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
>> line 1006, in describe_keyspace
>>
>>     return self.recv_describe_keyspace()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
>> line 1017, in recv_describe_keyspace
>>
>>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
>> line 126, in readMessageBegin
>>
>>     sz = self.readI32()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
>> line 203, in readI32
>>
>>     buff = self.trans.readAll(4)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
>> line 58, in readAll
>>
>>     chunk = self.read(sz-have)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
>> line 155, in read
>>
>>     self.__rbuf = StringIO(self.__trans.read(max(sz, self.DEFAULT_BUFFER)))
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py",
>> line 94, in read
>>
>>     raise TTransportException(type=TTransportException.END_OF_FILE,
>> message='TSocket read 0 bytes')
>>
>> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>>
>>
>>
>> I get similar errors for all queries.
>>
>>
>>
>> I cannot work out what is going wrong here. Can anyone help? (I need many of
>> the functions only added in 0.7)
>>
>>
>>
>> Best Regards,
>>
>> Andrew
>>
>>
>>
>>
>>
>> This e-mail is confidential and may be privileged. It may be read, copied
>> and used only by the intended recipient. No communication sent by e-mail to
>> or from Eutechnyx is intended to give rise to contractual or other legal
>> liability, apart from liability which cannot be excluded under English law.
>>
>> This email has been scanned for all known viruses by www.epagency.net.
>>
>> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
> This email has been scanned for all known viruses by the Email Protection Agency.
> This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law.
>
> This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net
>
>
> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
This email has been scanned for all known viruses by the Email Protection Agency.
This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. 

This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net


www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322

Re: Cassandra - python communication problem

Posted by Jonathan Ellis <jb...@gmail.com>.
python_cassandra-0.6.1 sure doesn't look like a package I'd expect to
work with 0.7.

On Tue, Nov 9, 2010 at 12:07 PM, Dr. Andrew Perella <aj...@eutechnyx.com> wrote:
> Thanks Jonathan,
> So it looks like the python bindings are using a deprecated non framed protocol. Leaving that problem aside for a moment I changed the server to work in non framed mode and now get a different error:
>
>
> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$ Cassandra-remote  -h localhost:9160 describe_keyspace systemTraceback (most recent call last):
>  File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>    pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
>    self.require(requires)[0].run_script(script_name, ns)
>  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
>    execfile(script_filename, namespace, namespace)
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote", line 204, in <module>
>    pp.pprint(client.describe_keyspace(args[0],))
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1006, in describe_keyspace
>    return self.recv_describe_keyspace()
>  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1030, in recv_describe_keyspace
>    raise TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace failed: unknown result");
> thrift.Thrift.TApplicationException: describe_keyspace failed: unknown result
>
> Any ideas?
> Cheers,
> Andrew
>
> -----Original Message-----
> From: Jonathan Ellis [mailto:jbellis@gmail.com]
> Sent: 09 November 2010 17:56
> To: user
> Subject: Re: Cassandra - python communication problem
>
> You're using an unframed transport to talk to a framed server, or vice versa.
>
> On Tue, Nov 9, 2010 at 11:47 AM, Dr. Andrew Perella <aj...@eutechnyx.com> wrote:
>> Hi,
>>
>>
>>
>> I have been trying to connect to Cassandra 0.7.0-beta3 via python to no
>> avail:
>>
>>
>>
>> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
>> Cassandra-remote  -h localhost:9160 describe_keyspace system
>>
>> Traceback (most recent call last):
>>
>>   File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>>
>>     pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>>
>>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
>> run_script
>>
>>     self.require(requires)[0].run_script(script_name, ns)
>>
>>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in
>> run_script
>>
>>     execfile(script_filename, namespace, namespace)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
>> line 204, in <module>
>>
>>     pp.pprint(client.describe_keyspace(args[0],))
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
>> line 1006, in describe_keyspace
>>
>>     return self.recv_describe_keyspace()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
>> line 1017, in recv_describe_keyspace
>>
>>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
>> line 126, in readMessageBegin
>>
>>     sz = self.readI32()
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
>> line 203, in readI32
>>
>>     buff = self.trans.readAll(4)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
>> line 58, in readAll
>>
>>     chunk = self.read(sz-have)
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
>> line 155, in read
>>
>>     self.__rbuf = StringIO(self.__trans.read(max(sz, self.DEFAULT_BUFFER)))
>>
>>   File
>> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py",
>> line 94, in read
>>
>>     raise TTransportException(type=TTransportException.END_OF_FILE,
>> message='TSocket read 0 bytes')
>>
>> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>>
>>
>>
>> I get similar errors for all queries.
>>
>>
>>
>> I cannot work out what is going wrong here. Can anyone help? (I need many of
>> the functions only added in 0.7)
>>
>>
>>
>> Best Regards,
>>
>> Andrew
>>
>>
>>
>>
>>
>> This e-mail is confidential and may be privileged. It may be read, copied
>> and used only by the intended recipient. No communication sent by e-mail to
>> or from Eutechnyx is intended to give rise to contractual or other legal
>> liability, apart from liability which cannot be excluded under English law.
>>
>> This email has been scanned for all known viruses by www.epagency.net.
>>
>> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptano.com
> This email has been scanned for all known viruses by the Email Protection Agency.
> This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law.
>
> This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net
>
>
> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

RE: Cassandra - python communication problem

Posted by "Dr. Andrew Perella" <aj...@eutechnyx.com>.
Thanks Jonathan, 
So it looks like the python bindings are using a deprecated non framed protocol. Leaving that problem aside for a moment I changed the server to work in non framed mode and now get a different error:


vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$ Cassandra-remote  -h localhost:9160 describe_keyspace systemTraceback (most recent call last):
  File "/usr/local/bin/Cassandra-remote", line 5, in <module>
    pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote", line 204, in <module>
    pp.pprint(client.describe_keyspace(args[0],))
  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1006, in describe_keyspace
    return self.recv_describe_keyspace()
  File "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py", line 1030, in recv_describe_keyspace
    raise TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace failed: unknown result");
thrift.Thrift.TApplicationException: describe_keyspace failed: unknown result

Any ideas?
Cheers,
Andrew

-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com] 
Sent: 09 November 2010 17:56
To: user
Subject: Re: Cassandra - python communication problem

You're using an unframed transport to talk to a framed server, or vice versa.

On Tue, Nov 9, 2010 at 11:47 AM, Dr. Andrew Perella <aj...@eutechnyx.com> wrote:
> Hi,
>
>
>
> I have been trying to connect to Cassandra 0.7.0-beta3 via python to no
> avail:
>
>
>
> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
> Cassandra-remote  -h localhost:9160 describe_keyspace system
>
> Traceback (most recent call last):
>
>   File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>
>     pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
> run_script
>
>     self.require(requires)[0].run_script(script_name, ns)
>
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in
> run_script
>
>     execfile(script_filename, namespace, namespace)
>
>   File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
> line 204, in <module>
>
>     pp.pprint(client.describe_keyspace(args[0],))
>
>   File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> line 1006, in describe_keyspace
>
>     return self.recv_describe_keyspace()
>
>   File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> line 1017, in recv_describe_keyspace
>
>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
> line 126, in readMessageBegin
>
>     sz = self.readI32()
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
> line 203, in readI32
>
>     buff = self.trans.readAll(4)
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
> line 58, in readAll
>
>     chunk = self.read(sz-have)
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
> line 155, in read
>
>     self.__rbuf = StringIO(self.__trans.read(max(sz, self.DEFAULT_BUFFER)))
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py",
> line 94, in read
>
>     raise TTransportException(type=TTransportException.END_OF_FILE,
> message='TSocket read 0 bytes')
>
> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>
>
>
> I get similar errors for all queries.
>
>
>
> I cannot work out what is going wrong here. Can anyone help? (I need many of
> the functions only added in 0.7)
>
>
>
> Best Regards,
>
> Andrew
>
>
>
>
>
> This e-mail is confidential and may be privileged. It may be read, copied
> and used only by the intended recipient. No communication sent by e-mail to
> or from Eutechnyx is intended to give rise to contractual or other legal
> liability, apart from liability which cannot be excluded under English law.
>
> This email has been scanned for all known viruses by www.epagency.net.
>
> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com
This email has been scanned for all known viruses by the Email Protection Agency.
This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. No communication sent by e-mail to or from Eutechnyx is intended to give rise to contractual or other legal liability, apart from liability which cannot be excluded under English law. 

This email has been scanned for all known viruses by the Email Protection Agency. http://www.epagency.net


www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322

Re: Cassandra - python communication problem

Posted by Jonathan Ellis <jb...@gmail.com>.
You're using an unframed transport to talk to a framed server, or vice versa.

On Tue, Nov 9, 2010 at 11:47 AM, Dr. Andrew Perella <aj...@eutechnyx.com> wrote:
> Hi,
>
>
>
> I have been trying to connect to Cassandra 0.7.0-beta3 via python to no
> avail:
>
>
>
> vu@vs001:~/apache-cassandra-0.7.0-beta3/interface/gen-py/cassandra$
> Cassandra-remote  -h localhost:9160 describe_keyspace system
>
> Traceback (most recent call last):
>
>   File "/usr/local/bin/Cassandra-remote", line 5, in <module>
>
>     pkg_resources.run_script('python-cassandra==0.6.1', 'Cassandra-remote')
>
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in
> run_script
>
>     self.require(requires)[0].run_script(script_name, ns)
>
>   File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in
> run_script
>
>     execfile(script_filename, namespace, namespace)
>
>   File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/EGG-INFO/scripts/Cassandra-remote",
> line 204, in <module>
>
>     pp.pprint(client.describe_keyspace(args[0],))
>
>   File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> line 1006, in describe_keyspace
>
>     return self.recv_describe_keyspace()
>
>   File
> "/usr/local/lib/python2.6/dist-packages/python_cassandra-0.6.1-py2.6.egg/cassandra/Cassandra.py",
> line 1017, in recv_describe_keyspace
>
>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
> line 126, in readMessageBegin
>
>     sz = self.readI32()
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/protocol/TBinaryProtocol.py",
> line 203, in readI32
>
>     buff = self.trans.readAll(4)
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
> line 58, in readAll
>
>     chunk = self.read(sz-have)
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TTransport.py",
> line 155, in read
>
>     self.__rbuf = StringIO(self.__trans.read(max(sz, self.DEFAULT_BUFFER)))
>
>   File
> "/usr/local/lib/python2.6/dist-packages/Thrift-0.2.0-py2.6-linux-x86_64.egg/thrift/transport/TSocket.py",
> line 94, in read
>
>     raise TTransportException(type=TTransportException.END_OF_FILE,
> message='TSocket read 0 bytes')
>
> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>
>
>
> I get similar errors for all queries.
>
>
>
> I cannot work out what is going wrong here. Can anyone help? (I need many of
> the functions only added in 0.7)
>
>
>
> Best Regards,
>
> Andrew
>
>
>
>
>
> This e-mail is confidential and may be privileged. It may be read, copied
> and used only by the intended recipient. No communication sent by e-mail to
> or from Eutechnyx is intended to give rise to contractual or other legal
> liability, apart from liability which cannot be excluded under English law.
>
> This email has been scanned for all known viruses by www.epagency.net.
>
> www.eutechnyx.com Eutechnyx Limited. Registered in England No: 2172322



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com