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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | flush-caches-bean-reset-1838088-1.patch | 691 bytes | jamesharv |
Comments
Comment #1
jamesharv commentedHere is the patch mentioned above.
Comment #1.0
jamesharv commentedClarified description
Comment #2
indytechcook commentedThanks! http://drupal.org/commitlog/commit/22232/3f24ae5131ec83b92b6eb28bc8b1530...
Comment #3
xxm commentedMaybe there is an realation between this error and that
http://drupal.org/node/1848530
Both errors arises after cache clear
Comment #4.0
(not verified) commentedFurther clarification