2016-01-27 8 views
5

Magentoで問題が発生しているようです。 1を除くすべての利用可能なインデックスのインデックス・ファイン:タグ集計データインデックスプロセス不明エラー

タグ集計データ

次のエラーによってインデックス付けが、私はかなり問題が何であるかを見ることができません。

Tag Aggregation Data index process unknown error: 
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'COUNT(tr.customer_id) + MIN(IF(tp.base_popularity IS NOT NULL, tp.base_popularity, 0))' in 'field list'' in /mywebsite-domain/httpd.www/lib/Zend/Db/Statement/Pdo.php:228 
Stack trace: 
#0 /mywebsite-domain/httpd.www/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) 
#1 /mywebsite-domain/httpd.www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) 
#2 /mywebsite-domain/httpd.www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) 
#3 /mywebsite-domain/httpd.www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) 
#4 /mywebsite-domain/httpd.www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ma...', Array) 
#5 /mywebsite-domain/httpd.www/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ma...', Array) 
#6 /mywebsite-domain/httpd.www/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php(233): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ma...') 
#7 /mywebsite-domain/httpd.www/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php(135): Mage_Tag_Model_Resource_Indexer_Summary->aggregate() 
#8 /mywebsite-domain/httpd.www/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Tag_Model_Resource_Indexer_Summary->reindexAll() 
#9 /mywebsite-domain/httpd.www/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll() 
#10 /mywebsite-domain/httpd.www/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll() 
#11 /mywebsite-domain/httpd.www/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything() 
#12 /mywebsite-domain/httpd.www/shell/indexer.php(216): Mage_Shell_Compiler->run() 
#13 {main} 

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'COUNT(tr.customer_id) + MIN(IF(tp.base_popularity IS NOT NULL, tp.base_popularity, 0))' in 'field list', query was: INSERT INTO `magentotag_summary` (`tag_id`, `store_id`, `customers`, `products`, `popularity`, `uses`, `historical_uses`, `base_popularity`) SELECT `tr`.`tag_id`, `tr`.`store_id`, COUNT(DISTINCT tr.customer_id) AS `customers`, COUNT(DISTINCT tr.product_id) AS `products`, `COUNT(tr.customer_id) + MIN(IF(tp.base_popularity IS NOT NULL, tp`.`base_popularity, 0))` AS `popularity`, 0 AS `uses`, 0 AS `historical_uses`, 0 AS `base_popularity` FROM `magentotag_relation` AS `tr` 
INNER JOIN `magentocore_store` AS `cs` ON cs.store_id = tr.store_id 
INNER JOIN `magentocatalog_product_website` AS `pw` ON cs.website_id = pw.website_id AND tr.product_id = pw.product_id 
INNER JOIN `magentocatalog_product_entity` AS `e` ON tr.product_id = e.entity_id 
LEFT JOIN `magentotag_properties` AS `tp` ON tp.tag_id = tr.tag_id AND tp.store_id = tr.store_id 
INNER JOIN `magentocatalog_product_entity_int` AS `tad_status` ON tad_status.entity_id = e.entity_id AND tad_status.attribute_id = 273 AND tad_status.store_id = 0 
LEFT JOIN `magentocatalog_product_entity_int` AS `tas_status` ON tas_status.entity_id = e.entity_id AND tas_status.attribute_id = 273 AND tas_status.store_id = cs.store_id 
INNER JOIN `magentocatalog_product_entity_int` AS `tad_visibility` ON tad_visibility.entity_id = e.entity_id AND tad_visibility.attribute_id = 526 AND tad_visibility.store_id = 0 
LEFT JOIN `magentocatalog_product_entity_int` AS `tas_visibility` ON tas_visibility.entity_id = e.entity_id AND tas_visibility.attribute_id = 526 AND tas_visibility.store_id = cs.store_id 
INNER JOIN `magentocataloginventory_stock_status` AS `ciss` ON ciss.product_id = e.entity_id AND ciss.website_id = cs.website_id WHERE (tr.active = 1) AND (IF(IFNULL(tas_status.value_id, -1) > 0, tas_status.value, tad_status.value)=1) AND (IF(IFNULL(tas_visibility.value_id, -1) > 0, tas_visibility.value, tad_visibility.value)!=1) AND (ciss.stock_status = 1) GROUP BY `tr`.`tag_id`, 
     `tr`.`store_id` ON DUPLICATE KEY UPDATE `tag_id` = VALUES(`tag_id`), `store_id` = VALUES(`store_id`), `customers` = VALUES(`customers`), `products` = VALUES(`products`), `popularity` = VALUES(`popularity`), `uses` = VALUES(`uses`), `historical_uses` = VALUES(`historical_uses`), `base_popularity` = VALUES(`base_popularity`)' in /mywebsite-domain/httpd.www/lib/Zend/Db/Statement/Pdo.php:235 
Stack trace: 
#0 /mywebsite-domain/httpd.www/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) 
#1 /mywebsite-domain/httpd.www/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) 
#2 /mywebsite-domain/httpd.www/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) 
#3 /mywebsite-domain/httpd.www/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ma...', Array) 
#4 /mywebsite-domain/httpd.www/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ma...', Array) 
#5 /mywebsite-domain/httpd.www/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php(233): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ma...') 
#6 /mywebsite-domain/httpd.www/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php(135): Mage_Tag_Model_Resource_Indexer_Summary->aggregate() 
#7 /mywebsite-domain/httpd.www/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Tag_Model_Resource_Indexer_Summary->reindexAll() 
#8 /mywebsite-domain/httpd.www/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll() 
#9 /mywebsite-domain/httpd.www/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll() 
#10 /mywebsite-domain/httpd.www/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything() 
#11 /mywebsite-domain/httpd.www/shell/indexer.php(216): Mage_Shell_Compiler->run() 
#12 {main} 

手がかりはありますか?

ありがとうございました。

答えて

0

インデックス作成エラーではないと思います。 insert ... select ...ステートメントの選択部分を慎重にチェックすると、式COUNT(tr.customer_id) + MIN(IF(tp.base_popularity IS NOT NULL, tpが表示されます。 base_popularity, 0))はバッククォート( `)で囲まれています。つまり、mysqlはこれを式の列ではなく列の名前として解釈しようとします。明らかに、このような列は存在しないため、エラーメッセージが表示されます。この式の周りのバックティックを削除すると、エラーメッセージが消えます。

0

私はまったく同じ問題を抱えています。 @Shadow Summary.phpにバッククォートがありません。

/** 
* Aggregate tags by specified ids 
* 
* @param null|int|array $tagIds 
* @return Mage_Tag_Model_Resource_Indexer_Summary 
*/ 
public function aggregate($tagIds = null) 
{ 
    $writeAdapter = $this->_getWriteAdapter(); 
    $this->beginTransaction(); 

    try { 
     if (!empty($tagIds)) { 
      $writeAdapter->delete(
       $this->getTable('tag/summary'), array('tag_id IN(?)' => $tagIds) 
      ); 
     } else { 
      $writeAdapter->delete($this->getTable('tag/summary')); 
     } 

     $select = $writeAdapter->select() 
      ->from(
       array('tr' => $this->getTable('tag/relation')), 
       array(
        'tr.tag_id', 
        'tr.store_id', 
        'customers'   => 'COUNT(DISTINCT tr.customer_id)', 
        'products'   => 'COUNT(DISTINCT tr.product_id)', 
        'popularity'  => 'COUNT(tr.customer_id) + MIN(' 
         . $writeAdapter->getCheckSql(
          'tp.base_popularity IS NOT NULL', 
          'tp.base_popularity', 
          '0' 
          ) 
         . ')', 
        'uses'    => new Zend_Db_Expr(0), // deprecated since 1.4.0.1 
        'historical_uses' => new Zend_Db_Expr(0), // deprecated since 1.4.0.1 
        'base_popularity' => new Zend_Db_Expr(0) // deprecated since 1.4.0.1 
       ) 
      ) 

誰かがこれを解決したいと考えています。ほとんどすべてを試しました。

+0

Magento 1.9.2.4では、まったく同じSQLエラーが発生しています。あなたはそれに対する解決策を見つけましたか? – Anse

5

Zend_Db_Select - > _ tableCols()がCOUNT(tr.customer_id) + MIN(IF(tp.base_popularity IS NOT NULL, tp.base_popularity, 0))を何らかのSQL関数として検出できず、その結果、​​に渡す必要があるため、誤ったバックティックが挿入されます。代わりに[currentCorrelationName]。[col]として検出され、通常の文字列として処理されます。

オープンlib/Zend/Db/Select.php、次の行を検索し、文字列の末尾記号($)を削除します:

この問題に対する修正は、SQL関数を検出するための正規表現を緩めることである

const REGEX_COLUMN_EXPR = '/^([\w]*\(([^\(\)]|(?1))*\))$/'; 

を.. 。それはこの1つのようになります。

const REGEX_COLUMN_EXPR = '/^([\w]*\(([^\(\)]|(?1))*\))/'; 

さて、Zend_Db_Select->_tableCols()は​​に式全体を通過し、そしてSQL電子なければなりません不具合は消えるはずです。

サイトがいくつかをインストールするには(もちろん)作曲を使用しています。私は最近、クライアントのサイトでこれを得た

0

、新しいブランドは1.9.3.2ここ

インストール、基本的にベースをインストールするには、私が発見したものですベースパッケージ。それらの

一つがこれです:ターン・ロードの依存関係に

- Installing magento/zendframework1 (1.12.16-patch3) Downloading: 100% Extracting archive REASON: colinmollenhour/php-redis-session-abstract v1.3.1 requires magento/zendframework1 ~1.12.0 -> satisfiable by magento/zendframework1[1.12.0, 1.12.1, 1.12.10, 1.12.13, 1.12.16, 1.12.16-patch1, 1.12.16-patch2, 1.12.16-patch3, 1.12.2, 1.12.3, 1.12.4, 1.12.5, 1.12.6, 1.12.7, 1.12.8, 1.12.9, 1.12.9-patch1]. だから、Magentoの/ zendframework1へのアップデートは、ベンダーにインストールされている

colinmollenhour/magento-redis-session": "^2.0"

こと。現時点では「magento/zendframework1:1.12」がインストールされていました。16-patch3 '

zend updateを削除したredis-session composerパッケージを削除したら、正常に戻ってきました。パッケージのリリースを見てみると

インストールパッケージの作曲エントリがバージョン2.0をインストールするように設定した

Removals: colinmollenhour/magento-redis-session, colinmollenhour/php-redis-session-abstract, magento/zendframework1, colinmollenhour/credis - Removing colinmollenhour/magento-redis-session (2.0.2) - Removing colinmollenhour/php-redis-session-abstract (v1.3.1) - Removing magento/zendframework1 (1.12.16-patch3) - Removing colinmollenhour/credis (1.7)

> (https://github.com/colinmollenhour/Cm_RedisSession/releases

V1.12は次のようにマークされました:Magentoのに切り替える前に、前回のリリース2互換バージョン。そのバージョンに作曲をロックダウン

"colinmollenhour/magento-redis-session": "1.12"

は、問題を解決し、MagentoのコードベースにRedisのセッションの更新を保持します。

したがって、基本的には、redis-session> 1.12はm1互換ではないという問題があります。

+0

幸いな日:https://github.com/colinmollenhour/Cm_RedisSession/issues/105#issuecomment-284162608 – proxiblue