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.
Related
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.
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).
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.
We are running Magento store having 8k products. The tow indexing is not working. Throwing some errors.
Product Flat Data Error
Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table './bofc_magento/#sql-f22_6554c.frm' (errno: 121)' in /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array)
#5 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array)
#6 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(327): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#7 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(2548): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ca...')
#8 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(816): Varien_Db_Adapter_Pdo_Mysql->addForeignKey('FK_CAT_PRD_FLAT...', 'catalog_product...', 'entity_id', 'catalog_product...', 'entity_id', 'CASCADE', 'CASCADE')
#9 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1390): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(1)
#10 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#11 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(336): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#12 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Index/Model/Process.php(207): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#13 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Index/Model/Process.php(253): Mage_Index_Model_Process->reindexAll()
#14 /var/www/vhosts/beadsofcambay.com/httpdocs/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#15 /var/www/vhosts/beadsofcambay.com/httpdocs/shell/indexer.php(198): Mage_Shell_Compiler->run()
#16 {main}
Catalog Search Index
Catalog Search Index index process unknown error:
exception 'Zend_Cache_Exception' with message 'Could not determine temp directory, please specify a cache_dir manually' in /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Cache.php:209
Stack trace:
#0 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Cache/Backend.php(197): Zend_Cache::throwException('Could not deter...')
#1 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Cache/Backend/File.php(123): Zend_Cache_Backend->getTmpDir()
#2 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Cache.php(153): Zend_Cache_Backend_File->__construct(Array)
#3 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Cache.php(94): Zend_Cache::_makeBackend('File', Array, false, false)
#4 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Locale/Data.php(940): Zend_Cache::factory('Core', 'File', Array, Array)
#5 /var/www/vhosts/beadsofcambay.com/httpdocs/lib/Zend/Locale.php(668): Zend_Locale_Data::getContent('en_US', 'date', NULL)
#6 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(763): Zend_Locale::getTranslation(NULL, 'date', Object(Zend_Locale))
#7 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(699): Mage_CatalogSearch_Model_Resource_Fulltext->_getStoreDate(1, NULL)
#8 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(634): Mage_CatalogSearch_Model_Resource_Fulltext->_getAttributeValue(145, NULL, 1)
#9 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(230): Mage_CatalogSearch_Model_Resource_Fulltext->_prepareProductIndex(Array, Array, 1)
#10 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php(128): Mage_CatalogSearch_Model_Resource_Fulltext->_rebuildStoreIndex(1, NULL)
#11 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Fulltext.php(83): Mage_CatalogSearch_Model_Resource_Fulltext->rebuildIndex(NULL, NULL)
#12 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php(446): Mage_CatalogSearch_Model_Fulltext->rebuildIndex()
#13 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Index/Model/Process.php(207): Mage_CatalogSearch_Model_Indexer_Fulltext->reindexAll()
#14 /var/www/vhosts/beadsofcambay.com/httpdocs/app/code/core/Mage/Index/Model/Process.php(253): Mage_Index_Model_Process->reindexAll()
#15 /var/www/vhosts/beadsofcambay.com/httpdocs/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#16 /var/www/vhosts/beadsofcambay.com/httpdocs/shell/indexer.php(198): Mage_Shell_Compiler->run()
#17 {main}
Both indexes are run from command line. I Googled both errors but did not find any suitable solutions.
I had the same issue a few days ago.
1 - Please make a DB backup
2 - Switch off the Use Flat Product and Category options in Magento and switch the Index mode from the Product Flat Data to Manual update;
3 - Now go into your DB. delete the catalog_product_flat_xx table(s);
4 - You must reindex the catalog via SSH. It should look like this:
usr/local/bin/php public_html/shell/indexer.php --reindex catalog_product_flat
Magento will create new tables for each shop. I could take a while.
Once it done, you can activate the Flat products option and check out whether Magento can do the reindex itself.
Truncate Product Flat Data and then run this script again.
Should be foreign key constraint issue.
I saw that error when I tried manually to change columns which had FK (relation) to it. Truncating flat index tables should make it go away -- also try DELETE FROM instead TRUNCATE if fails.
How many attributes are set to visible on the frontend (and added to flat tables)? MySQL has a limit of 64k per row and bad things can happen if you break it (like corrupted tables...)
Second error looks like just wrong cache setup (local.xml) or problem with file permissions of the var folder.
I was not able to reindex catalog_product_flat index process. After spending a day and trying several solutions on the Internet. i was able to fix the issue.
Below is the steps.
Create a clone of the Magento Db which is facing the indexing issue.
Dump the database into the newly created db.
truncate the table catalog_product_flat_1 for single store and for multiple store there will be multiple table catalog_product_flat_* where * is the store id. Here truncate all that table.
point the mangento running instance to the newly created database and configure the databse, so that site is functioning normally.
Now run the command php document_root/shell/indexer.php --reindex catalog_product_flat or try reindexing from Admin. php document_root/shell/indexer.php --reindexall for reindexing all the process.
I faced the same problem for re-indexing in catalog search ... after 10 days I have found the solution.
Catalog Search Index error I was getting:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error:
1785 When ##GLOBAL.ENFORCE_GTID_CONSISTEN CY = 1, updates to
non-transactional tables can only be done in either autocommitted
statements or single-statement transactions, and never in the same
statement as updates to transactional tables.'
The solution is:
Drop Table catalogsearch_fulltext
Create again catalogsearch_fulltext table using exist structure.
Update table catalogsearch_query using blow mentioned query.
UPDATE catalogsearch_query SET is_processed = 0
Then open your SSH and run the command to make it work again:
[~/public_html/shell]# php indexer.php reindexall
I am trying to create sample project in yii but I am having this problem while trying to run my code:
CHttpException
The system is unable to find the requested action "error". (C:\wamp\www\yii\framework\web\CController.php:484)
#0 C:\wamp\www\yii\framework\web\CController.php(271): CController->missingAction('error')
#1 C:\wamp\www\yii\framework\web\CWebApplication.php(276): CController->run('error')
#2 C:\wamp\www\yii\framework\base\CErrorHandler.php(310): CWebApplication->runController('site/error')
#3 C:\wamp\www\yii\framework\base\CErrorHandler.php(183): CErrorHandler->render('error', Array)
#4 C:\wamp\www\yii\framework\base\CErrorHandler.php(108): CErrorHandler->handleException(Object(CHttpException))
#5 C:\wamp\www\yii\framework\base\CApplication.php(713): CErrorHandler->handle(Object(CExceptionEvent))
#6 [internal function]: CApplication->handleException(Object(CHttpException))
#7 {main}
Can anyone tell me the reason ? As I think this is not the problem of my code.
An exception has occurred (most likely due to a bug or misconfiguration) and Yii attempted to run the error handler, which in this case is the error action on the site controller.
The error occurs because you do not have a site controller, or it does not have an error action.