When I try to activate the Debut Media module I consistently receive the following error message:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => view file [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3030 of /site/public_html/sitename/modules/user/user.module).

Comments

nedjo’s picture

IIRC this type of error arises when a feature attempts to add a permission that is not defined by any currently enabled module. In this case, the 'view file' permission is defined in the file_entity module, so apparently that module is not enabled.

Is the file_entity module present? What version?

mocolvin’s picture

I installed File Entity v 7.2devunstable. The previous installed version was 7.1. Received same PDOException. A copy of complete list of errors is below:
Notice: Undefined index: label in field_ui_menu() (line 184 of /home/colvini1/public_html/neighborhoodassemblies.org/modules/field_ui/field_ui.module).
Notice: Undefined index: label in field_ui_menu() (line 184 of /home/colvini1/public_html/neighborhoodassemblies.org/modules/field_ui/field_ui.module).
Notice: Undefined index: label in field_ui_menu() (line 184 of /home/colvini1/public_html/neighborhoodassemblies.org/modules/field_ui/field_ui.module).
Notice: Undefined index: label in field_ui_menu() (line 184 of /home/colvini1/public_html/neighborhoodassemblies.org/modules/field_ui/field_ui.module).
Notice: Undefined index: label in file_entity_menu() (line 77 of /home/colvini1/public_html/neighborhoodassemblies.org/sites/all/modules/media/file_entity/file_entity.module).
Notice: Undefined index: label in file_entity_menu() (line 77 of /home/colvini1/public_html/neighborhoodassemblies.org/sites/all/modules/media/file_entity/file_entity.module).
Notice: Undefined index: label in file_entity_menu() (line 77 of /home/colvini1/public_html/neighborhoodassemblies.org/sites/all/modules/media/file_entity/file_entity.module).
Notice: Undefined index: label in file_entity_menu() (line 77 of /home/colvini1/public_html/neighborhoodassemblies.org/sites/all/modules/media/file_entity/file_entity.module).
Notice: Undefined index: view file in user_role_grant_permissions() (line 3028 of /home/colvini1/public_html/neighborhoodassemblies.org/modules/user/user.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => view file [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3030 of /home/colvini1/public_html/neighborhoodassemblies.org/modules/user/user.module).

andezo’s picture

Getting the same error, as soon as I attempt to enable Debut_media (with site name taken out and replaced with "sitename" here:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => view file [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3030 of /home/sitename/public_html/sitename.org/modules/user/user.module).

Any attempt to use the site once this error comes up is useless, as it then gives the:
The website encountered an unexpected error. Please try again later.

Thanks for any help you can provide. We're trying to use OpenOutreach, which is dependent on Debut_media to run.

Note that we tried this with both the beta version and the slightly-newer dev version, and got the same results both times.

andezo’s picture

Mocolvin: were you attempting to install debut_media without enabling "Forums" or "Testing"?

I enabled both forums and testing, and now I have been able to enable debut_media AND OpenOutreach with no errors whatsoever.

This is great - except that we don't want to enable forums on our end result....

ETA: Went back in and disabled "forums" and "testing" one at a time to see if I could figure out which one was triggering the error. Both have been disabled and I am still seeing no errors. This is quite strange. :)

Starminder’s picture

same experience as #2 & #3. Enabled Debut Media, Debut Forum, and Testing on a brand new site using 7.12 and latest dev's of all modules.

max_d’s picture

I have the same problem has not yet been updated to media 7.2*

nedjo’s picture

The feature will not work with media 1.x.

Taxoman’s picture

@nedjo: is it possible to enable this module if media 2.x is missing?
(if media 1.x is present - or media 2.x is absent, should it not simply be impossible to install it..?)

ao2’s picture

BTW I got this kind of error also when some dependency was not met, in my case I was missing media_vimeo which looks like it is needed in recent debut_media versions.

I don't know if that could help someone else too.

nedjo’s picture

Title: PDOException: SQLSTATE[23000]: Integrity constraint violation » PDOException: SQLSTATE[23000]: Integrity constraint violation when used with Media 1.x
Status: Active » Closed (works as designed)

@Taxoman: yes, it would be better to add a version to the media dependency in debut_media.info. However, features doesn't handle that automatically and it might necessitate manual edits each time the feature is regenerated.

@ao2: thanks for the note. media_vimeo is now a dependency so that issue shouldn't recur.

2.x requirement is documented on the project page and is in both the debut apps server and this feature's .make file.