We are encountering this error:


The website encountered an unexpected error. Please try again later.

On frontpage only and if the user is anonymous. If logged in, we can view the front page but if not, we see this error.

This is the error message from the error log.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node.entity_id' in 'where clause': SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} node WHERE (node.nid = :db_condition_placeholder_0) AND (node.type IN (:db_condition_placeholder_1)) AND(( ( EXISTS (SELECT na.nid AS nid FROM {node_access} na WHERE (( (na.gid = :db_condition_placeholder_2) AND (na.realm = :db_condition_placeholder_3) )OR( (na.gid = :db_condition_placeholder_4) AND (na.realm = :db_condition_placeholder_5) ))AND (na.grant_view >= :db_condition_placeholder_6) AND (node.entity_id = na.nid) )) AND (node.entity_type = :db_condition_placeholder_7) )OR (node.entity_type <> :db_condition_placeholder_8) )) subquery; Array ( [:db_condition_placeholder_0] => -1 [:db_condition_placeholder_1] => evite [:db_condition_placeholder_2] => 0 [:db_condition_placeholder_3] => all [:db_condition_placeholder_4] => 0 [:db_condition_placeholder_5] => flag_friend [:db_condition_placeholder_6] => 1 [:db_condition_placeholder_7] => node [:db_condition_placeholder_8] => node ) in EntityFieldQuery->execute() (line 1154 of /var/www/vanille/includes/entity.inc).


Your subquery is returning null, that's why the main query is unable to find entity_id from it. I think you have a wrong query somewhere in your some function, with wrong condition.. Look at this line - WHERE (node.nid = :db_condition_placeholder_0) and actual placeholder - [:db_condition_placeholder_0] => -1 - entity id can not receive negative value. You can install Devel module, enable query log from devel settings page, log in as authenticated user and see what function calls this query..

| improve this answer | |
  • It seems that OG group module caused the error. I disabled it for now. It's really weird because last time I checked it did not have that kind of error. – Danz Oct 14 '14 at 9:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.