I got the following error when running drush cc all after adding a new bean type and it's associated permissions to an existing, enabled feature module:

$ drush @test cc all
WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: UPDATE {role_permission} SET module=:db_update_placeholder_0           [error]
WHERE ( (rid = :db_condition_placeholder_0) AND (permission = :db_condition_placeholder_1) ); Array
(
    [:db_update_placeholder_0] => 
    [:db_condition_placeholder_0] => 1
    [:db_condition_placeholder_1] => view any video_playlist bean
)
 in user_role_grant_permissions() (line 3043 of /modules/user/user.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: UPDATE {role_permission} SET module=:db_update_placeholder_0
WHERE ( (rid = :db_condition_placeholder_0) AND (permission = :db_condition_placeholder_1) ); Array
(
    [:db_update_placeholder_0] => 
    [:db_condition_placeholder_0] => 1
    [:db_condition_placeholder_1] => view any video_playlist bean
)
 in user_role_grant_permissions() (line 3043 of /modules/user/user.module).
Drush command terminated abnormally due to an unrecoverable error.

It seems that the problem was caused by the fact that the cache of bean types had not been cleared, and the new bean type was not being returned from bean_get_types(). Subsequently, the new bean type's permissions were not being returned form bean_permission(), so during the features rebuild it couldn't find the permission that it expected to be coming from the bean module. Calling drush eval 'bean_reset();'resolved the issue for me.

I propose that bean_reset() should be called in an implementation of hook_flush_caches() so that the bean cache gets properly cleared during cache flushes. I will attach a patch to this effect shortly.

CommentFileSizeAuthor
#1 flush-caches-bean-reset-1838088-1.patch691 bytesjamesharv

Comments

jamesharv’s picture

Status: Needs work » Needs review
StatusFileSize
new691 bytes

Here is the patch mentioned above.

jamesharv’s picture

Issue summary: View changes

Clarified description

indytechcook’s picture

xxm’s picture

Maybe there is an realation between this error and that
http://drupal.org/node/1848530
Both errors arises after cache clear

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Further clarification