Yii2 Can't connect to the MongoDB cluster - php

I try to find out what's wrong on https://github.com/yiisoft/yii2-mongodb, but someone just keeps me the link to docs and official chat. There is no any answer how to connect to the cluster. Please help me to solve this issue, I try a lot and spent last 2 days to solve it, but can't understand why it doesn't connect.
I try to configure yii2-mongodb on my project, installed it using composer, then add
in config/web.php
'mongodb' => [
'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://user:password#insta1-shard-00-00-s0vxe.mongodb.net:27017,insta1-shard-00-01-s0vxe.mongodb.net:27017,insta1-shard-00-02-s0vxe.mongodb.net:27017/database?ssl=true&replicaSet=Insta1-shard-0&authSource=admin',
]
and use this model:
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use yii\mongodb\Query;
/**
* BlogContent is the model behind the contact form.
*/
class BlogContent extends Model
{
public function getPostList($page) {
$query = new Query();
// compose the query
$rows = $query->select(['name', 'price', 'title'])
->from('services')->all();
}
}
it should return me all documents from the collection, but it returns to me this stack:
yii\base\UnknownMethodException: Calling unknown method: yii\mongodb\QueryBuilder::build() in /var/www/service/vendor/yiisoft/yii2/base/Object.php:220
Stack trace:
#0 /var/www/service/vendor/yiisoft/yii2/db/Query.php(126): yii\base\Object->__call('build', Array)
#1 /var/www/service/vendor/yiisoft/yii2/db/Query.php(213): yii\db\Query->createCommand(Object(yii\mongodb\Connection))
#2 /var/www/service/models/BlogContent.php(21): yii\db\Query->all()
#3 /var/www/service/controllers/BlogController.php(35): app\models\BlogContent->getPostList(1)
#4 [internal function]: app\controllers\BlogController->actionIndex(1)
#5 /var/www/service/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#6 /var/www/service/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#7 /var/www/service/vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('index', Array)
#8 /var/www/service/vendor/yiisoft/yii2/web/Application.php(102): yii\base\Module->runAction('blog/index', Array)
#9 /var/www/service/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request))
#10 /var/www/service/web/index.php(12): yii\base\Application->run()
#11 {main}
Additional info:
Yii version | ~2.0.5
Yii MongoDB version | ~2.1.0
MongoDB server version | MongoDB Atlas
PHP version | 7.0
Operating system | Ubuntu 16.04
I solve this first issue by passing a $db connection to query as an optional argument, but it can't connect anyway. Also, I test connection to MongoDB on my local machine - for a single database it works as need.

The issue was because my php-mongodb has a conflict with php7, after I update it all begin to work as need.

Related

Call to undefined method Illuminate\Database\Query\Builder::getEntityAttribute()

I have this strange issue.
It was not happening before and after I pulled form github ,
when I send json responses and send and eloquent object with it, it gives me this error. Presumably when the model gets serialized.
I've tried to parse it with json_encode but still the same issue.
I don't know whats going on , is it the issue of the json_encode or a problem with the eloquent model.It's related to all the models because all of them return the same error when i try to parse them to json.
It was ok before but now I don't know what went wrong.
I've compared commits to see the differences but still no luck.
I could not find anything that might have caused this issue so I'm guessing it is the fault of an nontracked file so I reinstalled the dependencies again through composer install still no luck.
When I reverse to the last commit it works fine so the theory of the untracked files is rubish.
Has anyone have any idea ?
I'm going nuts over this.
This is the stacktrace form when it starts to convert to json :
[2018-04-18 14:22:53] local.ERROR: Call to undefined method Illuminate\Database\Query\Builder::getEntityAttribute() {"exception":"[object] (BadMethodCallException(code: 0): Call to undefined method Illuminate\\Database\\Query\\Builder::getEntityAttribute() at /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)
[stacktrace]
#0 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1288): Illuminate\\Database\\Query\\Builder->__call('getEntityAttrib...', Array)
#1 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1470): Illuminate\\Database\\Eloquent\\Builder->__call('getEntityAttrib...', Array)
#2 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(438): Illuminate\\Database\\Eloquent\\Model->__call('getEntityAttrib...', Array)
#3 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(450): Illuminate\\Database\\Eloquent\\Model->mutateAttribute('entity', NULL)
#4 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(109): Illuminate\\Database\\Eloquent\\Model->mutateAttributeForArray('entity', NULL)
#5 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(970): Illuminate\\Database\\Eloquent\\Model->attributesToArray()
#6 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1611): Illuminate\\Database\\Eloquent\\Model->toArray()
#7 [internal function]: Illuminate\\Support\\Collection->Illuminate\\Support\\{closure}(Object(App\\AdminActivity))
#8 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1612): array_map(Object(Closure), Array)
#9 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(237): Illuminate\\Support\\Collection->toArray()
#10 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(970): Illuminate\\Database\\Eloquent\\Model->relationsToArray()
#11 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(237): Illuminate\\Database\\Eloquent\\Model->toArray()
#12 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(970): Illuminate\\Database\\Eloquent\\Model->relationsToArray()
#13 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(999): Illuminate\\Database\\Eloquent\\Model->toArray()
#14 [internal function]: Illuminate\\Database\\Eloquent\\Model->jsonSerialize()
#15 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php(71): json_encode(Array, 0)
#16 /home/marlind/PhpstormProjects/ital-restaurant/vendor/symfony/http-foundation/JsonResponse.php(50): Illuminate\\Http\\JsonResponse->setData(Array)
#17 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php(31): Symfony\\Component\\HttpFoundation\\JsonResponse->__construct(Array, 200, Array)
#18 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(83): Illuminate\\Http\\JsonResponse->__construct(Array, 200, Array, 0)
#19 /home/marlind/PhpstormProjects/ital-restaurant/app/Http/Controllers/BaseController.php(19): Illuminate\\Routing\\ResponseFactory->json(Array)
#20 /home/marlind/PhpstormProjects/ital-
I assume you have a problem with getting custom attribute. You can do that in a model by writing get{name}Attribute. You didn't provide us with any code so it's hard to point an error.
Old question but found it when searching for a problem I encountered.
Given that the stack trace is similar to mine I think the information and solution I found could shed more light on the matter.
Here's a link to Laravel's documentation about mutators as array:
https://laravel.com/docs/9.x/eloquent-mutators#array-object-and-collection-casting
For me the problem was when doing ->toArray() on a model that had attribute mutators.
Solved it by adding the following to the model:
protected $casts = [
'entity' => AsArrayObject::class,
];

Missing Controller Exception after installing FriendsOfCake/cakephp-csvview

I installed FriendsOfCake/cakephp-csvview using
php ../composer.phar require friendsofcake/cakephp-csvview:~3.0.
After which all pages show Missing Controller Exception (they were definitely OK), even after commenting out Plugin::load('CsvView') in bootstrap.php. I doubt php was unable to locate the controller class but don't know why. I have used find . -mtime -1, no files under src have changed.
Could anyone please tell me how Cakephp figures out the class file locations so I can troubleshoot?
Stack trace below:
2016-10-04 03:20:39 Warning: Headers already sent in {base}/vendor/cakephp/cakephp/src/Error/Debugger.php:753
2016-10-04 03:20:39 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Holders could not be found.
Exception Attributes: array (
'class' => 'Holders',
'plugin' => false,
'prefix' => false,
'_ext' => false,
)
Request URL: /
Client IP: 127.0.0.1
Stack Trace:
#0 {base}/vendor/cakephp/cakephp/src/Http/ControllerFactory.php(72): Cake\Http\ControllerFactory->missingController(Object(Cake\Network\Request))
#1 {base}/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(63): Cake\Http\ControllerFactory->create(Object(Cake\Network\Request), Object(Cake\Network\Response))
#2 {base}/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(49): Cake\Routing\Filter\ControllerFactoryFilter->_getController(Object(Cake\Network\Request), Object(Cake\Network\Response))
#3 {base}/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php(144): Cake\Routing\Filter\ControllerFactoryFilter->beforeDispatch(Object(Cake\Event\Event))
#4 {base}/vendor/cakephp/cakephp/src/Event/EventManager.php(426): Cake\Routing\DispatcherFilter->handle(Object(Cake\Event\Event), Object(Cake\Network\Request), Object(Cake\Network\Response))
#5 {base}/vendor/cakephp/cakephp/src/Event/EventManager.php(391): Cake\Event\EventManager->_callListener(Array, Object(Cake\Event\Event))
#6 {base}/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php(78): Cake\Event\EventManager->dispatch(Object(Cake\Event\Event))
#7 {base}/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(81): Cake\Http\ActionDispatcher->dispatchEvent('Dispatcher.befo...', Array)
#8 {base}/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(60): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#9 {base}/webroot/index.php(37): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#10 {main}
If at all, CakePHP only tries to figure fully qualified classnames from shorter ones, it doesn't handle including class files or figuring their locations, as of CakePHP 3 it relies on the composer autoloader (vendor/autoload.php) to do that.
If things broke after updating a dependency, which will also cause the autoloader to be re-dumped, chances are good that the autoloader broke (for whatever reason).

"Class String could not be loaded" PHP Haxe Error

I'm getting the following stacktrace, which appears as if PHP chokes while attempting to parse the boot class:
<pre>uncaught exception: <b>Class String could not be loaded</b><br /><br />in file: /path/to/haxe-php-lib/lib/php/Boot.class.php line 751<br />#0 [internal function]: spl_autoload('String')
#1 /path/to/haxe-php-lib/lib/php/Boot.class.php(751): property_exists('String', '__meta__')
#2 /path/to/haxe-php-lib/lib/php/Boot.class.php(857): _hx_type->__construct('String', 'String')
#3 /path/to/NativePHPUtil.php(334): require_once('/path/to/haxe-php-lib/include.php') //include.php is basically `require_once dirname(__FILE__).'/lib/php/Boot.class.php'; restore_exception_handler();`
#4 [internal function]: NativePHPUtil->addRecord('record-name', 'record-type', Object(stdClass))
#5 /path/to/NativePHPController.php(244): call_user_func_array(Array, Array)
#6 /path/index.php(89): NativePHPController->handle()
#7 {main}</pre>
Function from Boot.class.php(751):
public function __construct($cn, $qn, $path = null) {
$this->__tname__ = $cn;
$this->__qname__ = $qn;
$this->__path__ = $path;
if(property_exists($cn, '__meta__'))
$this->__meta__ = eval($cn.'::$__meta__');
}
It doesn't appear to be getting to using haxe-php-lib, just loading the necessary files. So I tried turning off dead-code-removal for PHP and reverting to using the require_once dirname(__FILE__).'/lib/php/Boot.class.php' directly, no joy.
This just started happening on my testing server (PHP 5.3 on Debian) a few days ago and there were no obvious changes to prompt the issue. I've tried pulling down a fresh copy from Git and fiddling with permissions.
What is spl_autoload('String') doing? Any guesses as to what might be causing the issue?
Update We commented out the if statement and everything seems to be working just fine....

CakePHP v3.x how to bake without database connection

I'm using CakePHP v3.x and my app doesn't have any models but I'd like to back a couple views or controllers.
$ bin/cake bake template Reports
I tried:
* using the --connection option with false or an empty string
* Removing Datasources from app.php
* Leaving in Datasources but set Datasources['default'] to false
All of these result in an error:
Welcome to CakePHP v3.1.2 Console
---------------------------------------------------------------
App : src
Path: /Applications/MAMP/htdocs/listings/src/
PHP : 5.6.10
---------------------------------------------------------------
Exception: The datasource configuration "default" was not found. in [/Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php, line 187]
2015-10-22 02:30:48 Error: [Cake\Datasource\Exception\MissingDatasourceConfigException] The datasource configuration "default" was not found.
Exception Attributes: array (
'name' => 'default',
)
Stack Trace:
#0 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php(164): Cake\Datasource\ConnectionManager::get('default')
#1 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/ORM/TableRegistry.php(109): Cake\ORM\Locator\TableLocator->get('Reports', Array)
#2 /Applications/MAMP/htdocs/listings/vendor/cakephp/bake/src/Shell/Task/TemplateTask.php(282): Cake\ORM\TableRegistry::get('Reports')
#3 /Applications/MAMP/htdocs/listings/vendor/cakephp/bake/src/Shell/Task/TemplateTask.php(147): Bake\Shell\Task\TemplateTask->_loadController()
#4 [internal function]: Bake\Shell\Task\TemplateTask->main('Reports')
#5 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/Console/Shell.php(447): call_user_func_array(Array, Array)
#6 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/Console/Shell.php(442): Cake\Console\Shell->runCommand(Array, false)
#7 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(212): Cake\Console\Shell->runCommand(Array, true, Array)
#8 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(179): Cake\Console\ShellDispatcher->_dispatch(Array)
#9 /Applications/MAMP/htdocs/listings/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(126): Cake\Console\ShellDispatcher->dispatch(Array)
#10 /Applications/MAMP/htdocs/listings/bin/cake.php(33): Cake\Console\ShellDispatcher::run(Array)
#11 {main}
I doubt this will work any time soon. You can create feature request type ticket on Github but it's unlikely to happen, because bake uses the DB schema to read the fields and builds everything based on the schema.
Also the Table class, which replaced Model from Cake2, doesn't allow $useTable = false any more. Because a table requires a DB table. For model less forms see this link.

Time-out until restart

I set up a cassandra cluster with 2 nodes. After a couple thousand of writes, it starts throwing TimeOut exceptions that don’t go away until after I restart the cassandra services. I am using phpcassa (latest at time of writing).
Cassandra.yaml both
cluster_name: 'Test Cluster'
seed_provider:
class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
seeds: "192.168.2.101"
rpc_address: 0.0.0.0
rpc_port: 8080
Cassandra.yaml 1
initial_token: 0
listen_address: 192.168.2.101
Cassandra.yaml 2
initial_token: 85070591730234615865843651857942052864
listen_address: 192.168.2.102
Assuming this configuration is correct, there must be an issue with my code. Here’s the test script I made to reproduce the error:
$pool = Config::ConnectionPool();
$stressTest = new ColumnFamily($pool, 'TwitterTest');
$id = 392766928478932992;
while(true)
{
try
{
$stressTest->insert($id++, array("analyzed"=>0, "followersCount"=>"35",
"friendsCount"=>"30", "lang"=>"en", "listedCount"=>"0",
"name"=>"Henky Tanky", "statusesCount"=>"X", "text"=>"#HERPDERP dude i kno i lost a 16gb flash drive #MEH",
"time"=>"2013-10-22 23:38:27", "twitterId"=>"392766928478932992", "username"=>"mehzor"),
null, null, \cassandra\ConsistencyLevel::ANY);
}
catch (Exception $ex){
print_r($ex);
exit;
}
}
class Config {
static function ConnectionPool(){
return new ConnectionPool('KSTwit', array('192.168.2.101:8080', '192.168.2.102:8080'));
}
}
With that config I get a 'cassandra\TimedOutException' (Stacktrace 1)
// Set max-retries to 5, and read/write timeout to 60 seconds
new ConnectionPool('KSTwit', array('192.168.2.101:8080', '192.168.2.102:8080'), NULL, 5, 60000, 60000);
With that config I get a 'Thrift\Exception\TTransportException' (Stacktrace 2)
I have tried various ConsistencyLevels;
ONE, QUORUM and ANY. Same issue with all of them.
As I said, the exceptions don’t occur until after a couple throusand of writes. However, if I restart the script after an exception ocurred it will throw exceptions immediately. I have to restart the cassandra services and then it can take a couple thousand again. This only seems to occur with writes. It also occurs if I don’t use counter columns so it’s not an issue with that.
Stack trace 1
Error performing add on 192.168.2.101:8080: exception 'cassandra\TimedOutException' in /var/installstuff/cassphp/lib/Thrift/Base/TBase.php:206
Stack trace:
#0 /var/installstuff/cassphp/lib/cassandra/Cassandra.php(3575): Thrift\Base\TBase->_read('Cassandra_add_r...', Array, Object(Thrift\Protocol\TBinaryProtocolAccelerated))
#1 /var/installstuff/cassphp/lib/cassandra/Cassandra.php(768): cassandra\Cassandra_add_result->read(Object(Thrift\Protocol\TBinaryProtocolAccelerated))
#2 /var/installstuff/cassphp/lib/cassandra/Cassandra.php(728): cassandra\CassandraClient->recv_add()
#3 [internal function]: cassandra\CassandraClient->add('All Tweets', Object(cassandra\ColumnParent), Object(cassandra\CounterColumn), 1)
#4 /var/installstuff/cassphp/lib/phpcassa/Connection/ConnectionPool.php(264): call_user_func_array(Array, Array)
#5 /var/installstuff/cassphp/lib/phpcassa/ColumnFamily.php(44): phpcassa\Connection\ConnectionPool->call('add', 'All Tweets', Object(cassandra\ColumnParent), Object(cassandra\CounterColumn), 1)
#6 /var/installstuff/cassphp/examples/db/TweetDatabase.php(103): phpcassa\ColumnFamily->add('All Tweets', 'Total')
#7 /var/installstuff/cassphp/examples/core/Helper.php(16): {closure}()
#8 /var/installstuff/cassphp/examples/db/TweetDatabase.php(104): Helper::DoForgiving(Object(Closure))
#9 /var/installstuff/cassphp/examples/core/twitterParser.php(98): TweetDatabaseCassandra->AddTweet('392633738364190...', Array)
#10 /var/installstuff/cassphp/examples/core/twitterParser.php(192): TwitterParser->RunOnce()
#11 /var/installstuff/cassphp/examples/runners/twitterParserCassandra.php(19): TwitterParser->Run()
#12 {main}
Stack trace 2
Error performing add on 192.168.2.101:8080: exception 'Thrift\Exception\TTransportException' with message 'TSocket: timed out reading 4 bytes from 192.168.2.101:8080' in /var/installstuff/cassphp/lib/Thrift/Transport/TSocket.php:284
Stack trace:
#0 /var/installstuff/cassphp/lib/Thrift/Transport/TTransport.php(74): Thrift\Transport\TSocket->read(4)
#1 /var/installstuff/cassphp/lib/Thrift/Transport/TFramedTransport.php(139): Thrift\Transport\TTransport->readAll(4)
#2 /var/installstuff/cassphp/lib/Thrift/Transport/TFramedTransport.php(106): Thrift\Transport\TFramedTransport->readFrame()
#3 /var/installstuff/cassphp/lib/Thrift/Transport/TTransport.php(74): Thrift\Transport\TFramedTransport->read(4)
#4 /var/installstuff/cassphp/lib/Thrift/Protocol/TBinaryProtocol.php(305): Thrift\Transport\TTransport->readAll(4)
#5 /var/installstuff/cassphp/lib/Thrift/Protocol/TBinaryProtocol.php(197): Thrift\Protocol\TBinaryProtocol->readI32(NULL)
#6 /var/installstuff/cassphp/lib/cassandra/Cassandra.php(760): Thrift\Protocol\TBinaryProtocol->readMessageBegin(NULL, 0, 0)
#7 /var/installstuff/cassphp/lib/cassandra/Cassandra.php(728): cassandra\CassandraClient->recv_add()
#8 [internal function]: cassandra\CassandraClient->add('All Tweets', Object(cassandra\ColumnParent), Object(cassandra\CounterColumn), 1)
#9 /var/installstuff/cassphp/lib/phpcassa/Connection/ConnectionPool.php(264): call_user_func_array(Array, Array)
#10 /var/installstuff/cassphp/lib/phpcassa/ColumnFamily.php(44): phpcassa\Connection\ConnectionPool->call('add', 'All Tweets', Object(cassandra\ColumnParent), Object(cassandra\CounterColumn), 1)
#11 /var/installstuff/cassphp/examples/db/TweetDatabase.php(103): phpcassa\ColumnFamily->add('All Tweets', 'Total')
#12 /var/installstuff/cassphp/examples/core/Helper.php(17): {closure}()
#13 /var/installstuff/cassphp/examples/db/TweetDatabase.php(104): Helper::DoForgiving(Object(Closure))
#14 /var/installstuff/cassphp/examples/core/twitterParser.php(98): TweetDatabaseCassandra->AddTweet('392642135327264...', Array)
#15 /var/installstuff/cassphp/examples/core/twitterParser.php(192): TwitterParser->RunOnce()
#16 /var/installstuff/cassphp/examples/runners/twitterParserCassandra.php(19): TwitterParser->Run()
#17 {main}
The cassandra log doesn't really show anything interesting. Except for this ocurring a lot, but that happens even when the exceptions don't occur so I don't think it's the issue;
INFO 10:58:58,241 Timed out replaying hints to /192.168.2.102; aborting further deliveries
WARN 11:07:17,979 MemoryMeter uninitialized (jamm not specified as java agent); assuming liveRatio of 10.0. Usually this means cassandra-env.sh disabled jamm because you are using a buggy JRE; upgrade to the Sun JRE instead
Keyspace is setup using ‘SIMPLE_STRATEGY’ and ‘replication_factor=2’ According to the ‘nodetool ring’ command on both machines, the nodes are functioning ‘normal’ even after the exceptions have been triggered. I honestly don’t know what to try next, can anyone spot the issue?
I fixed the issue in one of two ways (can't be sure.)
I initially installed cassandra using a guide online which listed these repo's;
deb http://www.apache.org/dist/cassandra/debian 11x main
deb-src http://www.apache.org/dist/cassandra/debian 11x main
These are outdated, there's a 20x version, so I updated to that.
I also replaced jsvc with sun's java. It's all working fine now.

Categories