Enabling the module caused the following error:

"PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.type' in 'field list': SELECT base.fid AS fid, base.uid AS uid, base.filename AS filename, base.uri AS uri, base.filemime AS filemime, base.filesize AS filesize, base.status AS status, base.timestamp AS timestamp, base.type AS type FROM {file_managed} base WHERE (base.fid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 0 ) in DrupalDefaultEntityController->load() (line 196 of /etc/drupal/7/includes/entity.inc)."

Causes complete lockout of site. Only way to fix this is to move or rename the module folder and flush the cache. Since the error won't allow the user to browse to any regular pages (goes to the maintenance page), your best bet is to visit http:your-site-domain-name/devel/cache/clear (works only if you have the Devel module installed). Then restore or rename the module back to "media", visit the module list, disable & uninstall.

Anyone who knows an alternate method to flush the cache, for those unfortunate enough not to have the Devel module, please post your solution here or start a thread in the forums.

Comments

JacobSingh’s picture

Category: bug » support
Priority: Critical » Normal

Can you specify the versions of core and styles you are using? It sounds like media didn't install cleanly for you since you're missing a field which is added during install. Does this happen on a fresh install?

downgrading since this doesn't seem to be happening for anyone else.

Anonymous’s picture

This was a new installation. At the time I enabled it, I didn't have any styles defined.

JacobSingh’s picture

What version of styles were you using, any more information to go on? I know it seems like a pain, but I can't diagnose the problem unless I can get a reproducible case. Perhaps doing a fresh install now might give you something different?

Anonymous’s picture

I just tried re-enabling & I got this:

"PDOException: SQLSTATE[42000]: Syntax error or access violation: 1142 ALTER command denied to user 'username'@'localhost' for table 'file_managed': ALTER TABLE {file_managed} ADD `type` VARCHAR(50) NULL DEFAULT NULL COMMENT 'Type of file for use in Media Bundles'; Array ( ) in db_add_field() (line 2712 of /etc/drupal/7/includes/database/database.inc)."

I'm using v.7.x-2.0-alpha5 of Styles.

JacobSingh’s picture

Status: Active » Closed (won't fix)

Youre Mysql user does not have permissions to ALTER the table.

I recommend you google the error and read the mysql docs.

Anonymous’s picture

OK, I added the 'alter' permission for this user & the error goes away. Closing case. Thanks for the help.

saltednut’s picture

Status: Closed (won't fix) » Needs work

Seeing this:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.type' in 'field list': SELECT base.fid AS fid, base.uid AS uid, base.filename AS filename, base.uri AS uri, base.filemime AS filemime, base.filesize AS filesize, base.status AS status, base.timestamp AS timestamp, base.type AS type FROM {file_managed} base WHERE (base.fid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => 1669 ) in DrupalDefaultEntityController->load() (line 196 of /var/www/sites/sitename/includes/entity.inc).

Drupal's mysql user has all privileges. Is there something we're missing?

mpgeek’s picture

Assigned: Unassigned » mpgeek
Status: Needs work » Postponed (maintainer needs more info)

@brantwyn, are you really using version 7.x-1.0-beta3? If so, I'd recommend using the latest releases. If you still encounter this error, can clarify what steps caused you to see the error?

Devin Carlson’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I'm not able to duplicate this. If you're still having this issue, I'd suggest following the steps that seezee took, namely:

  • Uninstall Media and File entity
  • Ensure that your database user has adequate permissions
  • Enable Media and File entity