Hello, My drupal 7.23 update page suggested I upgrade the media module 1.x. I clicked to have drupal do the upgrade internally. But it returned a lot of errors (apparently due to lack of write access) and I began getting following error on every reload:

Fatal error: require_once() [function.require]: Failed opening required '/home//public_html/sites/all/modules/media/includes/MediaReadOnlyStreamWrapper.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/includes/bootstrap.inc on line 3100

I dumped the db and installed a backup. I also made sure the files are there. I know for sure MediaReadOnlyStreamWrapper.inc is NOT missing and has 755 access.

But I still get the same error.

Please suggest anything else I can do to get out of this jam. The site has been down for a week and I didn't get any respones when I posted in the general forum.

Comments

Aleet’s picture

I solved the problem by reverting back to media 1.3. The Available Updates page keeps recommending to version 1.4. However, then I do, the entire site comes down with a PDO Exception error related to the File Entity module that comes with Media.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table ...

So I am stuck with version 1.3 and unable to upgrade. Any suggestions would be much appreciated.

knretaleato’s picture

Updating from 1.3 to 1.4 also gave me the following error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Drupal.image_dimensions' doesn't exist: SELECT * FROM {image_dimensions} id WHERE id.fid IN (:fids_0, :fids_1, :fids_2, :fids_3, :fids_4); Array ( [:fids_0] => 6563 [:fids_1] => 8922 [:fids_2] => 9463 [:fids_3] => 9477 [:fids_4] => 13727 ) in file_entity_file_load() (line 225 of /var/www/staging/sites/all/modules/Contributed_modules/media/file_entity/file_entity.module).

I found this blog post which seems to reference the issue but I have not tried the solution yet: http://www.vincentliefooghe.net/content/fileentity-imagedimensions-does-...

knretaleato’s picture

I went into sites/all/modules/Contributed_modules/media and deleted the file entity directory completely, and my site is back up with Media at version 1.4.

Aleet’s picture

knretaleato: are you saying you deleted this folder: sites/all/modules/media/file_entity ?

Then how does Media run without file_entity? My understanding is that Media 1.x uses it's own file_entity in that folder. Media 2.x requires installation of file_entity as a separate module.

Please explain how you did it. thanks.

illuminatico’s picture

I had this happen when updating to 2.x
I reverted back to my backup, then tried again without automation. Here's what I did.

1) disabled (did not uninstall) media and all related modules
2) deleted media from sites/all/modules
3) installed file_entity
4) uploaded media 7.2.x
5) updated database.

No broken site.

pat_trick’s picture

I am likewise encountering an issue when attempting to update from Media 7.x-1.2 to Media 7.x-1.4

The following error occurs when using Drush:

Project media was updated successfully. Installed version is now 7.x-1.4.
Backups were saved into the directory /home/ubuntu/drush-backups/drupal7/20140228195140/modules/media.                                          [ok]
WD php: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7.image_dimensions' doesn't exist: SELECT * FROM         [error]
{image_dimensions} id WHERE id.fid IN (:fids_0); Array
(
    [:fids_0] => 825
)
 in file_entity_file_load() (line 225 of /var/www/sites/all/modules/media/file_entity/file_entity.module).
Drush command terminated abnormally due to an unrecoverable error.                                                                              [error]
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7.image_dimensions' doesn't exist: SELECT * FROM {image_dimensions} id WHERE id.fid IN (:fids_0); Array
(
    [:fids_0] => 825
)
 in file_entity_file_load() (line 225 of /var/www/sites/all/modules/media/file_entity/file_entity.module).
Backups were restored successfully.

I read the blog link posted by knretaleato and it looks like it's a DB issue. So I ran the following:

$ sudo -u www-data drush updatedb
No database updates required                                                                                                                    [success]
'all' cache was cleared in /var/www#default                                                                                                     [success]
Finished performing updates.

I then attempted to run drush up media again, and got the following:

Project media was updated successfully. Installed version is now 7.x-1.4.
Backups were saved into the directory /home/ubuntu/drush-backups/drupal7/20140228203905/modules/media.                                          [ok]
'all' cache was cleared in /var/www#default                                                                                                     [success]
You have pending database updates. Run `drush updatedb` or visit update.php in your browser.                                                    [warning]
The following updates are pending:

file_entity module :
  7101 -   Create the {image_dimensions} database table.

Do you wish to run all pending updates? (y/n): y
Performed update: file_entity_update_7101                                                                                                       [ok]
'all' cache was cleared in /var/www#default                                                                                                     [success]
Finished performing updates.                                                                                                                    [ok]

So it looks like this is directly related to the file_entity module included in Media 7.x-1.x not being able to properly update by itself.

Devin Carlson’s picture

Status: Active » Closed (duplicate)
Related issues: +#2170231: Table 'image_dimensions' not created on update