Answers.Body: <p>I had a field called <code>files</code>, it did not belong to matrix. After deleting it (tried also simply renaming), the problem disappeared.</p>
  
  <p>After that I created a field with the same name and that did not cause any problems.</p>
  
  <p>Still do not know the exact reason, but later will have time dig a bit deeper, so if get some results will post them.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-28T21:54:47.710Z
Answers.LastActivityDate: 2017-09-28T21:54:47.710Z
Answers.UserDisplayName: anvar
Body: <p>I've got an error message from my craft (2.6.2990) after adding a German locale: </p>
  
  <blockquote>
    <p>Resaving all localizable elements: Failed</p>
    
    <p>Resaving matrix blocks: Failed </p>
  </blockquote>
  
  <p>in the sidebar and here is what I found in craft logs:</p>
  
  <p><code>2017/09/20 14:52:13 [error] [system.db.CDbCommand] CDbCommand::fetchAll() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zg_blike.craft_matrixcontent_files' doesn't exist. The SQL statement executed was: SELECT `elements`.`id`, `elements`.`type`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_i18n`.`slug`, `elements_i18n`.`uri`, `elements_i18n`.`enabled` AS `localeEnabled`, `content`.`id` AS `contentId`, `matrixblocks`.`fieldId`, `matrixblocks`.`ownerId`, `matrixblocks`.`ownerLocale`, `matrixblocks`.`typeId`, `matrixblocks`.`sortOrder`
  </code></p>
  
  <p>I checked the DB and of course did not find table called <code>craft_matrixcontent_files</code>, instead only <code>craft_matrixcontent_file</code></p>
  
  <p>Any ideas?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-20T15:34:38.930Z
Comments.Text: Forgot to mention: I'm using Craft Pro with Commerce installed
Comments.UserDisplayName: anvar
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-20T18:46:34.247Z
Comments.Text: Sounds like there are some consistency problem in your database.  Are all of Craft's foreign keys in place between tables? We've seen it happen semi-frequently where someone restores a database backup to a MySQL box that only supports the MyISAM storage engine and it will silently drop all foreign keys causing data to get really out of sync.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-20T20:19:17.887Z
Comments.Text: It's very hard to say for me if ALL of the keys are there, but they _seem_ to be fine: phpmyadmin's designer shows connections between tables, InnoDB is supported (all tables except `searchindex`).
Comments.UserDisplayName: anvar
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-20T20:42:28.763Z
Comments.Text: Someone manually edited the database maybe? Does the `craft_fields` table have a row with a "files" that's of type "Matrix"?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-27T16:44:29.100Z
Comments.Text: Thank you all for suggestions. At the end I have no idea what the problem exactly was, but I could solve it by renaming a table called `matrxicontent_file` to `matrixcontent_files`. For sure nobody edited the database, since I'm the only one who worked on it (except I do some things unconsciously). I also found something that can be related: There is an entry with a handle `files` which belongs to `global` context and another one with a handle `file` which belongs to `matrixBlockType`. I also tried to delete all the matrix fields from the CP and these strange ones manually. Did not help.
Comments.UserDisplayName: anvar
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-27T18:39:46.563Z
Comments.Text: Super weird... would you mind adding that as an official answer?  There's a small chance it might help someone in the future. :)
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-28T15:03:16.917Z
Comments.Text: Ups, sorry. It broke at the end. It does not work. Still looking for a solution.
Comments.UserDisplayName: anvar
Tags: <localization><error>
Title: Problem adding new locale / Resaving matrix blocks Failed / Table 'matrixcontent_files' doesn't exist
ThreadText: # Problem adding new locale / Resaving matrix blocks Failed / Table 'matrixcontent_files' doesn't exist
  
  (Asked by: username_0 on 2017-09-20)
  
  I've got an error message from my craft (2.6.2990) after adding a German locale:
  
  > Resaving all localizable elements: Failed
  >
  > Resaving matrix blocks: Failed
  
  in the sidebar and here is what I found in craft logs:
  
  `2017/09/20 14:52:13 [error] [system.db.CDbCommand] CDbCommand::fetchAll() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zg_blike.craft_matrixcontent_files' doesn't exist. The SQL statement executed was: SELECT `elements`.`id`, `elements`.`type`, `elements`.`enabled`, `elements`.`archived`, `elements`.`dateCreated`, `elements`.`dateUpdated`, `elements_i18n`.`slug`, `elements_i18n`.`uri`, `elements_i18n`.`enabled` AS `localeEnabled`, `content`.`id` AS `contentId`, `matrixblocks`.`fieldId`, `matrixblocks`.`ownerId`, `matrixblocks`.`ownerLocale`, `matrixblocks`.`typeId`, `matrixblocks`.`sortOrder``
  
  I checked the DB and of course did not find table called `craft_matrixcontent_files`, instead only `craft_matrixcontent_file`
  
  Any ideas?
  
  **Tags:** localization, error
  
  > **Comments:**
  > **username_0**: Forgot to mention: I'm using Craft Pro with Commerce installed  
  > **username_1**: Sounds like there are some consistency problem in your database.  Are all of Craft's foreign keys in place between tables? We've seen it happen semi-frequently where someone restores a database backup to a MySQL box that only supports the MyISAM storage engine and it will silently drop all foreign keys causing data to get really out of sync.  
  > **username_0**: It's very hard to say for me if ALL of the keys are there, but they _seem_ to be fine: phpmyadmin's designer shows connections between tables, InnoDB is supported (all tables except `searchindex`).  
  > **username_1**: Someone manually edited the database maybe? Does the `craft_fields` table have a row with a "files" that's of type "Matrix"?  
  > **username_0**: Thank you all for suggestions. At the end I have no idea what the problem exactly was, but I could solve it by renaming a table called `matrxicontent_file` to `matrixcontent_files`. For sure nobody edited the database, since I'm the only one who worked on it (except I do some things unconsciously). I also found something that can be related: There is an entry with a handle `files` which belongs to `global` context and another one with a handle `file` which belongs to `matrixBlockType`. I also tried to delete all the matrix fields from the CP and these strange ones manually. Did not help.  
  > **username_1**: Super weird... would you mind adding that as an official answer?  There's a small chance it might help someone in the future. :)  
  > **username_0**: Ups, sorry. It broke at the end. It does not work. Still looking for a solution.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-09-28. Score: 1 | Accepted answer
  
  I had a field called `files`, it did not belong to matrix. After deleting it (tried also simply renaming), the problem disappeared.
  
  After that I created a field with the same name and that did not cause any problems.
  
  Still do not know the exact reason, but later will have time dig a bit deeper, so if get some results will post them.
  
  
  ---
  
  