After updating the code to this version, there were no database updates that needed running, but I got an error like this one:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'image_dimensions' doesn't exist: SELECT * FROM {image_dimensions} id WHERE id.fid IN (:fids_0, :fids_1); Array ( [:fids_0] => 3 [:fids_1] => 87 ) in file_entity_file_load() (Zeile 142 von /var/www/project/sites/all/modules/file_entity/file_entity.file.inc).

I switched to 7.x-2.x-dev version and this problem went away. I did not try re-installing the module, perhaps that would have corrected the problem, but that should not be necessary. If this new version requires this new table it should come with a DB update that creates it.

Comments

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

Updating Media requires you to also keep File entity updated to the same version as well. I'm guessing you didn't install File entity 7.x-2.0-unstable7 as well?

Dave Reid’s picture

Also, what version did you have installed before you updated to 7.x-2.0-unstable7?

Homotechsual’s picture

Status: Postponed (maintainer needs more info) » Active

I'm seeing the same issue with Media 7.x-2.0-unstable7, File Entity 7.x-2.0-unstable7. After an update from the previous unstable builds.

Any help would be appreciated.

Homotechsual’s picture

Confirming that updating File Entity THEN Media Module to DEV versions fixes this problem (DO NOT UPGRADE SIMULTANEOUSLY)

Upgrading the two at the same time caused my Drupal site to start using all 128MB of the PHP Memory Limit and continuing to escalate to 1024MB when the limit was increased.

Homotechsual’s picture

Spoke to soon - new dev versions produce same issue - something is not right.

legolasbo’s picture

Marked #2051761: PDOException: SQLSTATE[42S02]: as duplicate of this issue.

mastoll’s picture

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'xxxxxx.file_type_streams' doesn't exist: SELECT stream FROM {file_type_streams} WHERE type = :type; Array ( [:type] => image ) in file_type_load_subrecords() (line 455 of xxxxxxx/modules/contrib/file_entity/file_entity.file_api.inc).

I'm running Media 7.x-2.0-unstable7, File Entity 7.x-2.0-unstable7.

Interestingly, I don't always get the error.

Any ideas?

Dave Reid’s picture

Did you run update.php or recently change to an *earlier* version of the module?

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)
OriginalSauce’s picture

I was running the same versions as pointed out in #7

I upgraded to the latest versions and received the PDOException error.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabase.file_metadata' doesn't exist: SELECT * FROM {file_metadata} WHERE fid IN (:fids_0); Array ( [:fids_0] => 75 ) in file_entity_file_load() (line 214 of /home/myusername/public_html/sites/all/modules/file_entity/file_entity.file.inc).

I received the error when I refreshed a page on my website but before running update.php.

Update went fine with no errors.

After update, none of my image fields on all nodes show the alt or title information. The edit view of the nodes show them as blank fields. The data is present in the database. When I try to update the blank fields via the node edit page and save, the table is updated but the node edit view goes back to blank.

I had similar problems some weeks ago when ALL data in the nodes went blank but were all present in the database. After spending quite a bit of time digging around the internet the majority of posts mentioned a locale problem. At first didn't think this was related to my problem as not touched anything to do with languages and locales, however decided to give it a shot anyways as was at a complete loss. The solution was to update the language of all nodes from en(im my case) to und. After I did this that solved the problem.

In both cases the one now and the previous one, I had done an upgrade of the file entity/ media modules. I believe in the previous case it was upgrading to the one in #7 but I cannot be certain.

Any subsequent new images I add suffer from the same problem.

OriginalSauce’s picture

Apologies for above thread in this bug report. I should have raised a separate thread.

After reading https://drupal.org/node/2044185

I realised the image_dimensions table was migrated to the new file_metadata table. Which explains the error I was getting due to the new table not existing until I did an update.

Still doesn't explain the blank fields, hence the need for a separate bug report.

cboling’s picture

After upgrading media and media_gallery to 2.0 versions, I received the same error. Pretty sure file_entity was previously installed and received the same error as #10.

Since I had the developer module install, I selected the 'reinstall modules' menu and selected 'file_entity'. After reinstall, the table appeared in my mySQL database.

While not a fix, hope this helps others with the same problem (file_metadata table does not exist).

Abhinesh Sharma’s picture

Hi All,

It's File Entity version problem. If we are using File Entity 7.x-2.0-alpha2 with Media Module version 7.x-2.0-alpha2 . After install both module it's throw same error.

The Main Region is file Entity module some Time don't create file_metadata filed in Database. After you want to update the file entity version but you can't because file entity module don't provide uninstall option in back-end.

So If you have found any error like PDO table{file_managed} or Table {file_metadata} then Check Database table Structure.

Search 2 Tables in Database are exist or not

1) file_managed
2) file_metadata

and Please verify In file_managed table field "type" is exist or not. if not then create Field

type varchar(50) utf8_general_ci No undefined

And for file_metadata Please Run Below Query in Sql:-

--
-- Table structure for table `file_metadata`
--

CREATE TABLE IF NOT EXISTS `file_metadata` (
`fid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The file_managed.fid of the metadata.',
`name` varchar(255) NOT NULL COMMENT 'The name of the metadata (e.g. ’width’).',
`value` longblob COMMENT 'The value of the metadata (e.g. ’200px’).',
PRIMARY KEY (`fid`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cache images dimensions.';

May this Post will help for use any version of File Entity and Media Module.

Thanks
Abhinesh

pauavellan’s picture

My error
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bbdd.image_dimensions' doesn't exist: SELECT * FROM {image_dimensions} id WHERE id.fid IN (:fids_0); Array ( [:fids_0] => 79 ) a file_entity_file_load() (línia 225 de /var/www/blocjaume/sites/all/modules/media/file_entity/file_entity.module)

- Reinstalled module
- update.php
- I have created file_metadata(before post)

What can I do?

Thanks
Pau Avellan

kathyq’s picture

I encountered the same issue. The problem only occurs when media 1.x has been installed. It looks like the cause was Media and File Entity 2.x version does not compatible with 1.x.

Here is how I solved the problem:
- Disable media 7.x-1.0 module
- Completely uninstall media 7.x-1.0
- Install File entity 7.x-2.0 and enable it
- Install Media 7.x-2.0

Hope this would be helpful for someone encounter in the same troubles.

Dave Reid’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (works as designed)

The path /var/www/blocjaume/sites/all/modules/media/file_entity/file_entity.module indicates you didn't remove the Media directory before upgrading to the 2.x version. To update modules, you must always remember to remove all the existing module files, then copy over the new files.

djouuuuh’s picture

kathyq's post solved my issue. Many thanks!

jghyde’s picture

Here's what I did to fix:

1. Uninstall Media Module (disable, then uninstall, under "Modules". Two steps. This cleans out the DB of old tables)
2. Uninstall File Entity Module (same 2-step process as above)
3. Remove all traces of Media and File Entity from the sites/*/modules directory.
4. Download the latest *.dev version of File Entity
5. Download the latest *.dev of Media 2.0 module
6. Enable File Entity
7. Enable Media 2.0

All fixed!

Joe

sterndata’s picture

Thank you. That solved my problem.

marcoka’s picture

hmm. if you do like #18, dont you lose all data?

wuxiaogu’s picture

I found a good way to update the media module from 1.X to 2.x,you should update file_entity module first , then update media module.Hope it is helpful.

marcoka’s picture

yes exactly. and if oyu have already both new modules downloaded just comment out the media updates run the updates of entity_file and then uncomment the media updates again and run updates again. i did that, worked great.

RAWDESK’s picture

#21 worked for me.
I also had to apply this patch in our custom theme module to get around the remove media_include_browser_js() module in Media 7.x-2.x
https://www.drupal.org/node/2458471#comment-10320251

lluisma’s picture

I've tried to update to 7.x-2,x-dev and then return to 7.x-2.1 version and it works.

PeterLrt’s picture

#13 worked for me. I updated file_entity to 7.x-2.3. Then updated media module to 7.x-2.9, updated the database and ran the create table query from #13

spidersilk’s picture

Those of you who are recommending completely uninstalling Media and File Entity before installing the new version - what happened to all your images and files? Wouldn't uninstalling those modules mean you'd lose anything that had been uploaded with them and any data entered about those files and images?

Does anyone know what you would have to do to migrate all your data back in after installing the new versions?

Ashendra Singh’s picture

Issue tags: +I have created database at backend. When I am uploading file then an error message is displaying 'no database selected'. But from another link when I am uploading files, +uploading is successfully done. please tell me if there is any idea.

I have created database at backend. When I am uploading file then an error message is displaying 'no database selected'. But from another link when I am uploading files,uploading is successfully done. please tell me if there is any idea.