thobbs / phpcassa

PHP client library for Apache Cassandra
thobbs.github.com/phpcassa
MIT License
248 stars 78 forks source link

Cassandra_set_keyspace_result not found. #68

Closed SalocinDotTEN closed 12 years ago

SalocinDotTEN commented 12 years ago

While initiating.ColumnFamily object...

PHP Fatal error:  Class '\cassandra\Cassandra_set_keyspace_result' not found in .../include/phpcassa/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php on line 100
PHP Stack trace:
PHP   1. {main}() .../hostIpFraud2.php:0
PHP   2. phpcassa\ColumnFamily->__construct() /opt/...
PHP   3. phpcassa\Connection\ConnectionPool->describe_keyspace() .../include/phpcassa/lib/phpcassa/ColumnFamily.php:175
PHP   4. phpcassa\Connection\ConnectionPool->call() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:192
PHP   5. phpcassa\Connection\ConnectionPool->get() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:257
PHP   6. phpcassa\Connection\ConnectionPool->make_conn() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:163
PHP   7. phpcassa\Connection\ConnectionWrapper->__construct() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:125
PHP   8. phpcassa\Connection\ConnectionWrapper->set_keyspace() .../include/phpcassa/lib/phpcassa/Connection/ConnectionWrapper.php:53
PHP   9. cassandra\CassandraClient->set_keyspace() .../include/phpcassa/lib/phpcassa/Connection/ConnectionWrapper.php:71
PHP  10. cassandra\CassandraClient->recv_set_keyspace() .../include/phpcassa/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:76
PHP  11. thrift_protocol_read_binary() .../include/phpcassa/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:100

Fatal error: Class '\cassandra\Cassandra_set_keyspace_result' not found in .../include/phpcassa/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php on line 100

Call Stack:
    0.0003     345052   1. {main}() .../hostIpFraud2.php:0
    0.9295   16955684   2. phpcassa\ColumnFamily->__construct() /opt/...
    0.9295   16956012   3. phpcassa\Connection\ConnectionPool->describe_keyspace() .../include/phpcassa/lib/phpcassa/ColumnFamily.php:175
    0.9295   16956116   4. phpcassa\Connection\ConnectionPool->call() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:192
    0.9295   16958080   5. phpcassa\Connection\ConnectionPool->get() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:257
    0.9295   16958132   6. phpcassa\Connection\ConnectionPool->make_conn() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:163
    0.9313   17236628   7. phpcassa\Connection\ConnectionWrapper->__construct() .../include/phpcassa/lib/phpcassa/Connection/ConnectionPool.php:125
    0.9366   18080736   8. phpcassa\Connection\ConnectionWrapper->set_keyspace() .../include/phpcassa/lib/phpcassa/Connection/ConnectionWrapper.php:53
    0.9366   18080736   9. cassandra\CassandraClient->set_keyspace() .../include/phpcassa/lib/phpcassa/Connection/ConnectionWrapper.php:71
    0.9373   18093400  10. cassandra\CassandraClient->recv_set_keyspace() .../include/phpcassa/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:76
    0.9373   18093600  11. thrift_protocol_read_binary() .../include/phpcassa/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:100
thobbs commented 12 years ago

Can you print_r($GLOBALS['THRIFT_AUTOLOAD']) just prior to creating the ColumnFamily object and past the results here?

SalocinDotTEN commented 12 years ago

Hi Tyler Hobbs! Thanks for replying. Here is the print_r...

Array ( [cassandra\column] => cassandra/cassandra.Column.php [cassandra\supercolumn] => cassandra/cassandra.SuperColumn.php [cassandra\countercolumn] => cassandra/cassandra.CounterColumn.php [cassandra\countersupercolumn] => cassandra/cassandra.CounterSuperColumn.php [cassandra\columnorsupercolumn] => cassandra/cassandra.ColumnOrSuperColumn.php [cassandra\notfoundexception] => cassandra/cassandra.NotFoundException.php [cassandra\invalidrequestexception] => cassandra/cassandra.InvalidRequestException.php [cassandra\unavailableexception] => cassandra/cassandra.UnavailableException.php [cassandra\timedoutexception] => cassandra/cassandra.TimedOutException.php [cassandra\authenticationexception] => cassandra/cassandra.AuthenticationException.php [cassandra\authorizationexception] => cassandra/cassandra.AuthorizationException.php [cassandra\schemadisagreementexception] => cassandra/cassandra.SchemaDisagreementException.php [cassandra\columnparent] => cassandra/cassandra.ColumnParent.php [cassandra\columnpath] => cassandra/cassandra.ColumnPath.php [cassandra\slicerange] => cassandra/cassandra.SliceRange.php [cassandra\slicepredicate] => cassandra/cassandra.SlicePredicate.php [cassandra\indexexpression] => cassandra/cassandra.IndexExpression.php [cassandra\indexclause] => cassandra/cassandra.IndexClause.php [cassandra\keyrange] => cassandra/cassandra.KeyRange.php [cassandra\keyslice] => cassandra/cassandra.KeySlice.php [cassandra\keycount] => cassandra/cassandra.KeyCount.php [cassandra\deletion] => cassandra/cassandra.Deletion.php [cassandra\mutation] => cassandra/cassandra.Mutation.php [cassandra\endpointdetails] => cassandra/cassandra.EndpointDetails.php [cassandra\tokenrange] => cassandra/cassandra.TokenRange.php [cassandra\authenticationrequest] => cassandra/cassandra.AuthenticationRequest.php [cassandra\columndef] => cassandra/cassandra.ColumnDef.php [cassandra\cfdef] => cassandra/cassandra.CfDef.php [cassandra\ksdef] => cassandra/cassandra.KsDef.php [cassandra\cqlrow] => cassandra/cassandra.CqlRow.php [cassandra\cqlmetadata] => cassandra/cassandra.CqlMetadata.php [cassandra\cqlresult] => cassandra/cassandra.CqlResult.php [cassandra\cqlpreparedresult] => cassandra/cassandra.CqlPreparedResult.php [cassandra\cassandra_login_args] => cassandra/cassandra.Cassandra_login_args.php [cassandra\cassandra_login_result] => cassandra/cassandra.Cassandra_login_result.php [cassandra\cassandra_set_keyspace_args] => cassandra/cassandra.Cassandra_set_keyspace_args.php [cassandra\cassandra_set_keyspace_result] => cassandra/cassandra.Cassandra_set_keyspace_result.php [cassandra\cassandra_get_args] => cassandra/cassandra.Cassandra_get_args.php [cassandra\cassandra_get_result] => cassandra/cassandra.Cassandra_get_result.php [cassandra\cassandra_get_slice_args] => cassandra/cassandra.Cassandra_get_slice_args.php [cassandra\cassandra_get_slice_result] => cassandra/cassandra.Cassandra_get_slice_result.php [cassandra\cassandra_get_count_args] => cassandra/cassandra.Cassandra_get_count_args.php [cassandra\cassandra_get_count_result] => cassandra/cassandra.Cassandra_get_count_result.php [cassandra\cassandra_multiget_slice_args] => cassandra/cassandra.Cassandra_multiget_slice_args.php [cassandra\cassandra_multiget_slice_result] => cassandra/cassandra.Cassandra_multiget_slice_result.php [cassandra\cassandra_multiget_count_args] => cassandra/cassandra.Cassandra_multiget_count_args.php [cassandra\cassandra_multiget_count_result] => cassandra/cassandra.Cassandra_multiget_count_result.php [cassandra\cassandra_get_range_slices_args] => cassandra/cassandra.Cassandra_get_range_slices_args.php [cassandra\cassandra_get_range_slices_result] => cassandra/cassandra.Cassandra_get_range_slices_result.php [cassandra\cassandra_get_paged_slice_args] => cassandra/cassandra.Cassandra_get_paged_slice_args.php [cassandra\cassandra_get_paged_slice_result] => cassandra/cassandra.Cassandra_get_paged_slice_result.php [cassandra\cassandra_get_indexed_slices_args] => cassandra/cassandra.Cassandra_get_indexed_slices_args.php [cassandra\cassandra_get_indexed_slices_result] => cassandra/cassandra.Cassandra_get_indexed_slices_result.php [cassandra\cassandra_insert_args] => cassandra/cassandra.Cassandra_insert_args.php [cassandra\cassandra_insert_result] => cassandra/cassandra.Cassandra_insert_result.php [cassandra\cassandra_add_args] => cassandra/cassandra.Cassandra_add_args.php [cassandra\cassandra_add_result] => cassandra/cassandra.Cassandra_add_result.php [cassandra\cassandra_remove_args] => cassandra/cassandra.Cassandra_remove_args.php [cassandra\cassandra_remove_result] => cassandra/cassandra.Cassandra_remove_result.php [cassandra\cassandra_remove_counter_args] => cassandra/cassandra.Cassandra_remove_counter_args.php [cassandra\cassandra_remove_counter_result] => cassandra/cassandra.Cassandra_remove_counter_result.php [cassandra\cassandra_batch_mutate_args] => cassandra/cassandra.Cassandra_batch_mutate_args.php [cassandra\cassandra_batch_mutate_result] => cassandra/cassandra.Cassandra_batch_mutate_result.php [cassandra\cassandra_truncate_args] => cassandra/cassandra.Cassandra_truncate_args.php [cassandra\cassandra_truncate_result] => cassandra/cassandra.Cassandra_truncate_result.php [cassandra\cassandra_describe_schema_versions_args] => cassandra/cassandra.Cassandra_describe_schema_versions_args.php [cassandra\cassandra_describe_schema_versions_result] => cassandra/cassandra.Cassandra_describe_schema_versions_result.php [cassandra\cassandra_describe_keyspaces_args] => cassandra/cassandra.Cassandra_describe_keyspaces_args.php [cassandra\cassandra_describe_keyspaces_result] => cassandra/cassandra.Cassandra_describe_keyspaces_result.php [cassandra\cassandra_describe_cluster_name_args] => cassandra/cassandra.Cassandra_describe_cluster_name_args.php [cassandra\cassandra_describe_cluster_name_result] => cassandra/cassandra.Cassandra_describe_cluster_name_result.php [cassandra\cassandra_describe_version_args] => cassandra/cassandra.Cassandra_describe_version_args.php [cassandra\cassandra_describe_version_result] => cassandra/cassandra.Cassandra_describe_version_result.php [cassandra\cassandra_describe_ring_args] => cassandra/cassandra.Cassandra_describe_ring_args.php [cassandra\cassandra_describe_ring_result] => cassandra/cassandra.Cassandra_describe_ring_result.php [cassandra\cassandra_describe_partitioner_args] => cassandra/cassandra.Cassandra_describe_partitioner_args.php [cassandra\cassandra_describe_partitioner_result] => cassandra/cassandra.Cassandra_describe_partitioner_result.php [cassandra\cassandra_describe_snitch_args] => cassandra/cassandra.Cassandra_describe_snitch_args.php [cassandra\cassandra_describe_snitch_result] => cassandra/cassandra.Cassandra_describe_snitch_result.php [cassandra\cassandra_describe_keyspace_args] => cassandra/cassandra.Cassandra_describe_keyspace_args.php [cassandra\cassandra_describe_keyspace_result] => cassandra/cassandra.Cassandra_describe_keyspace_result.php [cassandra\cassandra_describe_splits_args] => cassandra/cassandra.Cassandra_describe_splits_args.php [cassandra\cassandra_describe_splits_result] => cassandra/cassandra.Cassandra_describe_splits_result.php [cassandra\cassandra_system_add_column_family_args] => cassandra/cassandra.Cassandra_system_add_column_family_args.php [cassandra\cassandra_system_add_column_family_result] => cassandra/cassandra.Cassandra_system_add_column_family_result.php [cassandra\cassandra_system_drop_column_family_args] => cassandra/cassandra.Cassandra_system_drop_column_family_args.php [cassandra\cassandra_system_drop_column_family_result] => cassandra/cassandra.Cassandra_system_drop_column_family_result.php [cassandra\cassandra_system_add_keyspace_args] => cassandra/cassandra.Cassandra_system_add_keyspace_args.php [cassandra\cassandra_system_add_keyspace_result] => cassandra/cassandra.Cassandra_system_add_keyspace_result.php [cassandra\cassandra_system_drop_keyspace_args] => cassandra/cassandra.Cassandra_system_drop_keyspace_args.php [cassandra\cassandra_system_drop_keyspace_result] => cassandra/cassandra.Cassandra_system_drop_keyspace_result.php [cassandra\cassandra_system_update_keyspace_args] => cassandra/cassandra.Cassandra_system_update_keyspace_args.php [cassandra\cassandra_system_update_keyspace_result] => cassandra/cassandra.Cassandra_system_update_keyspace_result.php [cassandra\cassandra_system_update_column_family_args] => cassandra/cassandra.Cassandra_system_update_column_family_args.php [cassandra\cassandra_system_update_column_family_result] => cassandra/cassandra.Cassandra_system_update_column_family_result.php [cassandra\cassandra_execute_cql_query_args] => cassandra/cassandra.Cassandra_execute_cql_query_args.php [cassandra\cassandra_execute_cql_query_result] => cassandra/cassandra.Cassandra_execute_cql_query_result.php [cassandra\cassandra_prepare_cql_query_args] => cassandra/cassandra.Cassandra_prepare_cql_query_args.php [cassandra\cassandra_prepare_cql_query_result] => cassandra/cassandra.Cassandra_prepare_cql_query_result.php [cassandra\cassandra_execute_prepared_cql_query_args] => cassandra/cassandra.Cassandra_execute_prepared_cql_query_args.php [cassandra\cassandra_execute_prepared_cql_query_result] => cassandra/cassandra.Cassandra_execute_prepared_cql_query_result.php [cassandra\cassandra_set_cql_version_args] => cassandra/cassandra.Cassandra_set_cql_version_args.php [cassandra\cassandra_set_cql_version_result] => cassandra/cassandra.Cassandra_set_cql_version_result.php [cassandra\cassandraclient] => cassandra/cassandra.Cassandra.client.php )

thobbs commented 12 years ago

What version of php are you running? Are you using Zend or anything?

SalocinDotTEN commented 12 years ago

I am running it through command line, so I am not sure if the Zend influences it in any way...

Here is php -v ...

PHP 5.3.2-1ubuntu4.15 with Suhosin-Patch (cli) (built: May 4 2012 00:38:52) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

thobbs commented 12 years ago

Are you using an older version of the compiled C extension (thrift_protocol.so), maybe?

SalocinDotTEN commented 12 years ago

Hi,

I have recompiled the Thrift C extension from this phpcassa version and it is still not working. :)

thobbs commented 12 years ago

Can you try running one of the example scipts directly? Just do 'php examples/basic.php' from the top-level phpcassa directory.

If that has the same error, what version of Ubuntu are you running?

SalocinDotTEN commented 12 years ago

Hi Tyler,

The error message seems to be very different now: -

PHP Fatal error:  Class '\cassandra\Cassandra_login_result' not found in [..]/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php on line 46
PHP Stack trace:
PHP   1. {main}() [..]/examples/basic.php:0
PHP   2. phpcassa\SystemManager->__construct() [..]/examples/basic.php:25
PHP   3. phpcassa\Connection\ConnectionWrapper->__construct() [..]/lib/phpcassa/SystemManager.php:36
PHP   4. cassandra\CassandraClient->login() [..]/lib/phpcassa/Connection/ConnectionWrapper.php:57
PHP   5. cassandra\CassandraClient->recv_login() [..]/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:22
PHP   6. thrift_protocol_read_binary() [..]/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:46

Fatal error: Class '\cassandra\Cassandra_login_result' not found in [..]/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php on line 46

Call Stack:
    0.0002     337564   1. {main}() [..]/examples/basic.php:0
    0.0039     885572   2. phpcassa\SystemManager->__construct() [..]/examples/basic.php:25
    0.0056    1148764   3. phpcassa\Connection\ConnectionWrapper->__construct() [..]/lib/phpcassa/SystemManager.php:36
    0.0115    1993736   4. cassandra\CassandraClient->login() [..]/lib/phpcassa/Connection/ConnectionWrapper.php:57
    0.0117    2006904   5. cassandra\CassandraClient->recv_login() [..]/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:22
    0.0117    2007096   6. thrift_protocol_read_binary() [..]/lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:46

I am using Ubuntu Server 10.04.4 LTS

thobbs commented 12 years ago

I'll have to try to reproduce this on Ubuntu 10.04. Is there anything else unusual about your configuration?

SalocinDotTEN commented 12 years ago

Hi Tyler. Alright sure. :-)

I don't see anything else unusual about my configuration. Besides having 4 nodes.

thobbs commented 12 years ago

Okay, I can reproduce this on Ubuntu 10.04. It appears that the problem only occurs when the Thrift C extension is installed and enabled. For now, you might try disabling it. I'll try to figure out why it's breaking.

thobbs commented 12 years ago

Okay, that should fix it. Please let me know if that doesn't work for you. It should work with the C extension installed.

SalocinDotTEN commented 12 years ago

Hmm, I am not quite sure though. This error keeps appearing..

I am getting another message: -

PHP Fatal error:  Uncaught exception 'TApplicationException' with message 'Required field 'reversed' was not found in serialized data! Struct: SliceRange(start:80 01 00 01 00 00 00 09 67 65 74 5F 73 6C 69 63 65 00 00 00 00 0B 00 01 00 00 00 07 35 34 32 36 36 5F 30 0C 00 02 0B 00 03 00 00 00 08 63 6C 69 63 6B 73 44 42 00 0C 00 03 0C 00 02 0B 00 01 00 00 00 00, finish:80 01 00 01 00 00 00 09 67 65 74 5F 73 6C 69 63 65 00 00 00 00 0B 00 01 00 00 00 07 35 34 32 36 36 5F 30 0C 00 02 0B 00 03 00 00 00 08 63 6C 69 63 6B 73 44 42 00 0C 00 03 0C 00 02 0B 00 01 00 00 00 00 0B 00 02 00 00 00 00, reversed:false, count:100)' in /.../lib/thrift/packages/cassandra/cassandra.Cassandra.client.php:219
Stack trace:
    #0 /.../lib/thrift/packages/cassandra/cassandra.Cassandra.client.php(219): thrift_protocol_read_binary(Object(TBinaryProtocolAccelerated), '\cassandra\Cass...', false)
    #1 /..../lib/thrift/packages/cassandra/cassandra.Cassandra.clien in /.../lib/thrift/packages/cassandra/cassandra.Cassandra.client.php on line 219

TApplicationException: Required field 'reversed' was not found in serialized data! Struct: SliceRange(start:80 01 00 01 00 00 00 09 67 65 74 5F 73 6C 69 63 65 00 00 00 00 0B 00 01 00 00 00 07 35 34 32 36 36 5F 30 0C 00 02 0B 00 03 00 00 00 08 63 6C 69 63 6B 73 44 42 00 0C 00 03 0C 00 02 0B 00 01 00 00 00 00, finish:80 01 00 01 00 00 00 09 67 65 74 5F 73 6C 69 63 65 00 00 00 00 0B 00 01 00 00 00 07 35 34 32 36 36 5F 30 0C 00 02 0B 00 03 00 00 00 08 63 6C 69 63 6B 73 44 42 00 0C 00 03 0C 00 02 0B 00 01 00 00 00 00 0B 00 02 00 00 00 00, reversed:false, count:100) in /..../lib/thrift/packages/cassandra/cassandra.Cassandra.client.php on line 219

Call Stack:
    0.0003     345792   1. {main}() /...php:0
   28.9077    2776564   2. phpcassa\ColumnFamily->get() ...php:56
   28.9081    2778040   3. phpcassa\ColumnFamily->_get() /....php:290
   28.9081    2778120   4. phpcassa\Connection\ConnectionPool->call() /...php:296

Is it my fault?

SalocinDotTEN commented 12 years ago

Hi Tyler,

I thought the error went away. Turned out the error does not happen only on secondary index operations.

thobbs commented 12 years ago

That exception probably indicates that you're using the new slicing parameters incorrectly. I recommend you check out this: https://github.com/thobbs/phpcassa/blob/master/examples/column_slices.php

In any case, it's a totally different problem.

SalocinDotTEN commented 12 years ago

Thanks! I have found the error to be a missing new NULL argument by going through the tutorial.

Alright. Wonderful API this is. :-)