cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot initialize the indexer process?

Cannot initialize the indexer process?

Hello guys,

 

I seem to have an issue with running the indexer. I get the above message in my subject. I've tried to run the indexer process in SSH but this is the error I get: (I've replaced IP's & domains):

 

login as: root
root@Server IP's password:
Last login: Thu Nov 12 15:02:29 2015 from Client PC
[root@server ~]# cd /var/www/vhosts/domain/firstcateringredesi                                                                                                                                                             gn.domain/
[root@dedi37344 firstcateringredesign.domain]# cd shell
[root@dedi37344 shell]# php -f indexer.php reindexall
Product Attributes index was rebuilt successfully in 00:00:00
Product Prices index was rebuilt successfully in 00:00:00
Catalog URL Rewrites index was rebuilt successfully in 00:00:02
Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'firstcateringre_.#sql-5fd_a9228' (errno: 121)' in /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array)
#5 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array)
#6 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(423): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#7 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(2833): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ca...')
#8 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(815): Varien_Db_Adapter_Pdo_Mysql->addForeignKey('FK_CAT_PRD_FLAT...', 'catalog_product...', 'entity_id', 'catalog_product...', 'entity_id', 'CASCADE', 'CASCADE')
#9 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1389): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(1)
#10 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#11 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(350): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#12 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(212): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#13 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#14 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#15 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(216): Mage_Shell_Compiler->run()
#16 {main}
Category Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'firstcateringre_.catalog_category_flat_store_1' (errno: 121)' in /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#5 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#6 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(2219): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#7 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(638): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#8 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1461): Mage_Catalog_Model_Resource_Category_Flat->_createTable('1')
#9 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1475): Mage_Catalog_Model_Resource_Category_Flat->_createTables()
#10 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php(260): Mage_Catalog_Model_Resource_Category_Flat->reindexAll()
#11 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(212): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
#12 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#13 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#14 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(216): Mage_Shell_Compiler->run()
#15 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'firstcateringre_.catalog_category_flat_store_1' (errno: 121), query was: CREATE TABLE `catalog_category_flat_store_1` (
  `entity_id` int UNSIGNED NOT NULL COMMENT 'entity_id' ,
  `parent_id` int UNSIGNED NOT NULL default '0' COMMENT 'parent_id' ,
  `created_at` timestamp NULL default NULL COMMENT 'created_at' ,
  `updated_at` timestamp NULL default NULL COMMENT 'updated_at' ,
  `path` varchar(255) NOT NULL default '' COMMENT 'path' ,
  `position` int NOT NULL COMMENT 'position' ,
  `level` int NOT NULL default '0' COMMENT 'level' ,
  `children_count` int NOT NULL COMMENT 'children_count' ,
  `store_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Store Id' ,
  `all_children` text NULL default NULL COMMENT 'All Children' ,
  `available_sort_by` text NULL default NULL COMMENT 'Available Product Listing Sort By' ,
  `children` text NULL default NULL COMMENT 'Children' ,
  `custom_apply_to_products` int NULL default NULL COMMENT 'Apply To Products' ,
  `custom_design` varchar(255) NULL default NULL COMMENT 'Custom Design' ,
  `custom_design_from` datetime NULL default NULL COMMENT 'Active From' ,
  `custom_design_to` datetime NULL default NULL COMMENT 'Active To' ,
  `custom_layout_update` text NULL default NULL COMMENT 'Custom Layout Update' ,
  `custom_use_parent_settings` int NULL default NULL COMMENT 'Use Parent Category Settings' ,
  `default_sort_by` varchar(255) NULL default NULL COMMENT 'Default Product Listing Sort By' ,
  `description` text NULL default NULL COMMENT 'Description' ,
  `display_mode` varchar(255) NULL default NULL COMMENT 'Display Mode' ,
  `filter_price_range` decimal(12,4) NULL default NULL COMMENT 'Layered Navigation Price Step' ,
  `image` varchar(255) NULL default NULL COMMENT 'Image' ,
  `include_in_menu` int NULL default NULL COMMENT 'Include in Navigation Menu' ,
  `is_active` int NULL default NULL COMMENT 'Is Active' ,
  `is_anchor` int NULL default NULL COMMENT 'Is Anchor' ,
  `landing_page` int NULL default NULL COMMENT 'CMS Block' ,
  `meta_description` text NULL default NULL COMMENT 'Meta Description' ,
  `meta_keywords` text NULL default NULL COMMENT 'Meta Keywords' ,
  `meta_title` varchar(255) NULL default NULL COMMENT 'Page Title' ,
  `name` varchar(255) NULL default NULL COMMENT 'Name' ,
  `page_layout` varchar(255) NULL default NULL COMMENT 'Page Layout' ,
  `path_in_store` text NULL default NULL COMMENT 'Path In Store' ,
  `thumbnail` varchar(255) NULL default NULL COMMENT 'Thumbnail Image' ,
  `url_key` varchar(255) NULL default NULL COMMENT 'URL Key' ,
  `url_path` varchar(255) NULL default NULL COMMENT 'Url Path' ,
  PRIMARY KEY  (`entity_id`),
  INDEX `IDX_CATALOG_CATEGORY_FLAT_STORE_1_STORE_ID` (`store_id`),
  INDEX `IDX_CATALOG_CATEGORY_FLAT_STORE_1_PATH` (`path`),
  INDEX `IDX_CATALOG_CATEGORY_FLAT_STORE_1_LEVEL` (`level`),
  CONSTRAINT `FK_CAT_CTGR_FLAT_STORE_1_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_CATALOG_CATEGORY_FLAT_STORE_1_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) COMMENT='Catalog Category Flat (Store 1)' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci' in /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php:236
Stack trace:
#0 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#4 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#5 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(2219): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#6 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(638): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#7 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1461): Mage_Catalog_Model_Resource_Category_Flat->_createTable('1')
#8 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1475): Mage_Catalog_Model_Resource_Category_Flat->_createTables()
#9 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php(260): Mage_Catalog_Model_Resource_Category_Flat->reindexAll()
#10 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(212): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
#11 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#12 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#13 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(216): Mage_Shell_Compiler->run()
#14 {main}
Category Products index was rebuilt successfully in 00:00:00
Catalog Search Index index was rebuilt successfully in 00:00:00
Stock Status index was rebuilt successfully in 00:00:00
Tag Aggregation Data index was rebuilt successfully in 00:00:00
Sm Shopby index process unknown error:
exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column '`main_table`.`frontend_input`' in 'where clause'' in /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#5 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#6 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#7 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Data/Collection/Db.php(740): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#8 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#9 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#10 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Data/Collection.php(741): Varien_Data_Collection_Db->load()
#11 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php(29): Varien_Data_Collection->getIterator()
#12 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php(20): Sm_Shopby_Model_Resource_Indexer_Attribute->reindexSeoUrlKeys()
#13 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Sm_Shopby_Model_Resource_Indexer_Attribute->reindexAll()
#14 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(212): Mage_Index_Model_Indexer_Abstract->reindexAll()
#15 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#16 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#17 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(216): Mage_Shell_Compiler->run()
#18 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column '`main_table`.`frontend_input`' in 'where clause', query was: SELECT `main_table`.*, `additional_table`.* FROM `eav_attribute` AS `main_table`
 INNER JOIN `catalog_eav_attribute` AS `additional_table` ON additional_table.attribute_id = main_table.attribute_id WHERE (`main_table`.`entity_type_id` = '4') AND (```main_table```.```frontend_input``` IN('select', 'multiselect'))' in /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Statement/Pdo.php:236
Stack trace:
#0 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Data/Collection/Db.php(740): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /var/www/vhosts/domain/firstcateringredesign.domain/lib/Varien/Data/Collection.php(741): Varien_Data_Collection_Db->load()
#10 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php(29): Varien_Data_Collection->getIterator()
#11 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php(20): Sm_Shopby_Model_Resource_Indexer_Attribute->reindexSeoUrlKeys()
#12 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Sm_Shopby_Model_Resource_Indexer_Attribute->reindexAll()
#13 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(212): Mage_Index_Model_Indexer_Abstract->reindexAll()
#14 /var/www/vhosts/domain/firstcateringredesign.domain/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#15 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(168): Mage_Index_Model_Process->reindexEverything()
#16 /var/www/vhosts/domain/firstcateringredesign.domain/shell/indexer.php(216): Mage_Shell_Compiler->run()
#17 {main}
[root@dedi37344 shell]#

I've tried to truncate the 'catalog_category_flat_store_1' table but this doesn't seem to make a difference.

 

Can anyone see what the issue is here?

 

Thanks.

 

3 REPLIES 3

Re: Cannot initialize the indexer process?

Did this happen after a site move?

 

Have you made sure your cache is clear?

Magento Moderator since 2009
Keep Calm and Clear Cache!

Re: Cannot initialize the indexer process?

I first noticed this after using this bulk category importer:

 

http://www.magentocommerce.com/magento-connect/bulk-category-import-export.html

Re: Cannot initialize the indexer process?

I ran into this exact issue as well. I narrowed it down to a problem with Attribute.php.

Open app/code/local/Sm/Shopby/Model/Resource/Indexer/Attribute.php

 

Around line 65 you will find the protected function called _getAttribute.

Change from this,

 

 protected function _getAttributes($attributeId = null){
        $collection = Mage::getSingleton('eav/config')
            ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
            ->getAttributeCollection()
            ->addFieldToFilter('`main_table`.`frontend_input`', array('in' => array('select', 'multiselect')));
        if (!empty($attributeId)) {
            $collection->addFieldToFilter('`main_table`.`attribute_id`', $attributeId);
        }

        return $collection;
    }

 

to this code instead,

    protected function _getAttributes($attributeId = null){
        $collection = Mage::getSingleton('eav/config')
            ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
            ->getAttributeCollection()
            ->addFieldToFilter('main_table.frontend_input', array('in' => array('select', 'multiselect')));
        if (!empty($attributeId)) {
            $collection->addFieldToFilter('main_table.attribute_id', $attributeId);
        }

        return $collection;
    }

What changed?

The only thing I changed was removing the apostrophes (´) at lines 69 and 71. Which means that ´main_table´.´frontend_input' is now changed into main_table.frontend_input. Now the scripts updates SQL properly. Both in Admin and Shell.