Cannot create keyspace #17

Closed
jeffgirard opened this Issue May 21, 2012 · 6 comments

Comments

Projects
None yet
5 participants
@jeffgirard

Hello!

I'm using Cassandra 1.1.0 installed from deb package (under Ubuntu 12), and I noticed that in the example.php the line

$cassandra->createKeyspace('CassandraExample')" 

isnt working, giving me the following stack trace (after ~10 sec.):

PHP Fatal error:  Uncaught exception 'cassandra_InvalidRequestException' in /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/thrift/packages/cassandra/Cassandra.php:7863
Stack trace:
#0 /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/thrift/packages/cassandra/Cassandra.php(1586): cassandra_Cassandra_system_add_keyspace_result->read(Object(TBinaryProtocolAccelerated))
#1 /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/thrift/packages/cassandra/Cassandra.php(1547): cassandra_CassandraClient->recv_system_add_keyspace()
#2 [internal function]: cassandra_CassandraClient->system_add_keyspace(Object(cassandra_KsDef))
#3 /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/Cassandra.php(971): call_user_func_array(Array, Array)
#4 /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/Cassandra.php(1256): Cassandra->call('system_add_keys...', Object(cassandra_KsDef))
#5 /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/test.php(37): Cassandra->createKeyspace('CassandraExampl...')
#6 {m in /home/jeff/Documents/projects/Cassandra-PHP-Client-Library/Cassandra.php on line 979

*When I create the keyspace manually from cassandra-cli, and after I run the example with commenting the drop-create line, everything works fine, columns family are correctly created into my keyspace, and the rest of the methods seems to work perfectly!

Thanks!

@kallaspriit

This comment has been minimized.

Show comment Hide comment
@kallaspriit

kallaspriit May 22, 2012

Owner

Does the example.php code work for you?

Owner

kallaspriit commented May 22, 2012

Does the example.php code work for you?

@jeffgirard

This comment has been minimized.

Show comment Hide comment
@jeffgirard

jeffgirard May 23, 2012

No, I tried it too, well my "test.php" file you see in stacktrace is a great copy-paste of it ;)

So same problem with example.php, createKeyspace fail.

Are you able on your side to run without any problem the example.php against Cassandra 1.1.0?

No, I tried it too, well my "test.php" file you see in stacktrace is a great copy-paste of it ;)

So same problem with example.php, createKeyspace fail.

Are you able on your side to run without any problem the example.php against Cassandra 1.1.0?

@snipeur

This comment has been minimized.

Show comment Hide comment
@snipeur

snipeur Jun 17, 2012

same issue,

snipeur commented Jun 17, 2012

same issue,

@snipeur

This comment has been minimized.

Show comment Hide comment
@snipeur

snipeur Jun 17, 2012

[client 82.235.109.95] PHP Fatal error: Uncaught exception 'cassandra_InvalidRequestException' in /var/www/kallaspriit/thrift/packages/cassandra/Cassandra.php:7863\nStack trace:\n#0 /var/www/kallaspriit/thrift/packages/cassandra/Cassandra.php(1586): cassandra_Cassandra_system_add_keyspace_result->read(Object(TBinaryProtocolAccelerated))\n#1 /var/www/kallaspriit/thrift/packages/cassandra/Cassandra.php(1547): cassandra_CassandraClient->recv_system_add_keyspace()\n#2 [internal function]: cassandra_CassandraClient->system_add_keyspace(Object(cassandra_KsDef))\n#3 /var/www/kallaspriit/Cassandra.php(996): call_user_func_array(Array, Array)\n#4 /var/www/kallaspriit/Cassandra.php(1281): Cassandra->call('system_add_keys...', Object(cassandra_KsDef))\n#5 /var/www/kallaspriit/example.php(37): Cassandra->createKeyspace('CassandraExampl...')\n#6 {main}\n\nNext exception 'CassandraMaxRetriesException' with message 'Failed calling "system_add_keyspace" the maximum of 5 times' in /var/www/kallaspriit/Cassandra.php:1004\nStack trace:\n#0 /var/www/kallaspriit/Cassandra.php(1281 in /var/www/kallaspriit/Cassandra.php on line 1004

snipeur commented Jun 17, 2012

[client 82.235.109.95] PHP Fatal error: Uncaught exception 'cassandra_InvalidRequestException' in /var/www/kallaspriit/thrift/packages/cassandra/Cassandra.php:7863\nStack trace:\n#0 /var/www/kallaspriit/thrift/packages/cassandra/Cassandra.php(1586): cassandra_Cassandra_system_add_keyspace_result->read(Object(TBinaryProtocolAccelerated))\n#1 /var/www/kallaspriit/thrift/packages/cassandra/Cassandra.php(1547): cassandra_CassandraClient->recv_system_add_keyspace()\n#2 [internal function]: cassandra_CassandraClient->system_add_keyspace(Object(cassandra_KsDef))\n#3 /var/www/kallaspriit/Cassandra.php(996): call_user_func_array(Array, Array)\n#4 /var/www/kallaspriit/Cassandra.php(1281): Cassandra->call('system_add_keys...', Object(cassandra_KsDef))\n#5 /var/www/kallaspriit/example.php(37): Cassandra->createKeyspace('CassandraExampl...')\n#6 {main}\n\nNext exception 'CassandraMaxRetriesException' with message 'Failed calling "system_add_keyspace" the maximum of 5 times' in /var/www/kallaspriit/Cassandra.php:1004\nStack trace:\n#0 /var/www/kallaspriit/Cassandra.php(1281 in /var/www/kallaspriit/Cassandra.php on line 1004

@gykhauth

This comment has been minimized.

Show comment Hide comment
@gykhauth

gykhauth Jun 22, 2012

Same issue. Using: Cassandra 1.1.1 on Windows 7 localhost (for testing purpose) with Apache 2.2.2 and PHP 5.3.14.

Same issue. Using: Cassandra 1.1.1 on Windows 7 localhost (for testing purpose) with Apache 2.2.2 and PHP 5.3.14.

@caseylai

This comment has been minimized.

Show comment Hide comment
@caseylai

caseylai Jun 26, 2012

change the code of line 1277 in Cassandra.php to "$def->strategy_options = $placementStrategyOptions ? $placementStrategyOptions : array("replication_factor" => 1);", then works fine.

change the code of line 1277 in Cassandra.php to "$def->strategy_options = $placementStrategyOptions ? $placementStrategyOptions : array("replication_factor" => 1);", then works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment