Magento - base table core_file_storage Doesn't exist

When I look at the error log for my Magento store, it is full of these errors:

[02-Jun-2011 13:49:12] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite_mysite.core_file_storage' doesn't exist' in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228 Stack trace: #0 /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) #1 /home/mysite/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #2 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) #3 /home/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `e`.* FR...', Array) #4 /home/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `e`.* FR...', Array) #5 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array) #6 /home/mysite/public_html/app/code/core/Mage/Core/Model/Mysql4/File/Storag in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php on line 234 

Does anyone know how to solve this?

+4
source share
8 answers

Apparently, I don't have privileges to comment on Daniel's answer yet, so I'm adding this as a separate answer. A1anm also asked a question on the Magento forum. There, user furnitureforyoultd answered the question two different requests .

First, if you do not have core_directory_storage yet, run:

 CREATE TABLE `core_directory_storage` ( `directory_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL DEFAULT '', `path` VARCHAR(255) NOT NULL DEFAULT '', `upload_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `parent_id` INT(10) UNSIGNED NULL DEFAULT NULL, PRIMARY KEY (`directory_id`), UNIQUE INDEX `IDX_DIRECTORY_PATH` (`name`, `path`), INDEX `parent_id` (`parent_id`), CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `core_directory_storage` (`directory_id`) ON UPDATE CASCADE ON DELETE CASCADE ) COMMENT='Directory storage' COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DEFAULT; 

Then run:

 CREATE TABLE `core_file_storage` ( `file_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `content` LONGBLOB NOT NULL, `upload_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `filename` VARCHAR(255) NOT NULL DEFAULT '', `directory_id` INT(10) UNSIGNED NULL DEFAULT NULL, `directory` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`file_id`), UNIQUE INDEX `IDX_FILENAME` (`filename`, `directory`), INDEX `directory_id` (`directory_id`), CONSTRAINT `FK_FILE_DIRECTORY` FOREIGN KEY (`directory_id`) REFERENCES `core_directory_storage` (`directory_id`) ON UPDATE CASCADE ON DELETE CASCADE ) COMMENT='File storage' COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DEFAULT; 
+6
source

You cannot create tables manually, just check permissions for your media folder (it should be 777 ).

+3
source

This is a problem in the Magento core, which is added to the tracker and will be fixed.

However, you should be aware that the source of this error is that you have the URL of a non-existent file. The only problem in the Magento core is that it throws a "Fatal error" instead of showing a 404 page.

To fix this problem, check why you are getting the URL of a nonexistent file. Any rights to the folder and subfolders of your media must be set correctly - for example. 777 (otherwise images are not created there) or the wrong URL.

+2
source

These tables are mainly used to store uploaded images for each product.

In addition, if your default storage location for media is installed in files, not in the database, magento will try to find every image in the file system, but if it fails, it will try to find it in the database.

Please check if your product images are in the media folder (usually media / catalog / product / {az | 0-9} / {az | 0-9} /yourimage.jpg), otherwise even after creating these tables , you will receive only 404 Not found error while requesting these files.

+1
source

This problem happened to me, and I have to provide permission 777 per media folder.

0
source

also note that if you try to use invalid characters in the product title, for example, quotation marks, this will cause magento to try to create a thumbnail with this symbol in it .., which will cause images to fail and magenta will try to call these images from Database. If you are not using the database for storage, you will see a mysql error

0
source

If you will be using file system storage, make sure your / media directory is set to 777, and also run chmod -R o+w media . If the error repeats, the cleanest way to solve the problem is:

  • Go to SYSTEM> CONFIGURATION> ADVANCED> SYSTEM and switch "Storage Configuration for Media" to "Database". Click on SYNCHRONIZE. Wait for the synchronization process or timeout to complete (probably depending on your settings). The table "core_directory_storage" was created and populated. Press SAVE CONFIG (not sure if this step is necessary, but do it anyway).
  • If the synchronization completes, you will most likely see a notification of a serious error in Magento Admin. "An error occurred while synchronizing media files." This does not matter, because in the next step we return to file-based file storage.
  • In the same setting configured in step 1, go back to “File System” and click “SYNCHRONIZATION” again. Press SAVE CONFIG (not sure if this step is necessary, but do it anyway).
  • Now go to your DB Manager (e.g. PHPMyAdmin) and delete all rows in the newly created table using DELETE FROM core_directory_storage .

Your table error is missing.

0
source

Missing tables can be automatically created by the system, all you have to do is go to:

 System > Configuration System (Advanced menu) > "Storage Configuration for Media" tab 

and the choice to store media files in the database, and then turn it off after synchronization is complete. This will create the missing tables.

0
source