I get this error a lot in the drupal logs. Several times an hour. Anyone know why, what the impact is, and how to fix it?

My config:

  • Acquia Drupal 7.36
  • Running in IIS 7.5 / Windows Server 2008
  • Solr 4.6
  • PHP 5.3


PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'env_id' in 'field list': INSERT INTO {apachesolr_stats} (timestamp, uid, sid, numfound, showed_suggestions, total_time, prepare_time, process_time, page, keywords, filters, sort, env_id, page_id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array ( [:db_insert_placeholder_0] => 1423845337 [:db_insert_placeholder_1] => 697523 [:db_insert_placeholder_2] => XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [:db_insert_placeholder_3] => 35 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 15 [:db_insert_placeholder_6] => 15 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => question about bill [:db_insert_placeholder_10] => a:0:{} [:db_insert_placeholder_11] => a:2:{s:5:"#name";s:5:"score";s:10:"#direction";s:4:"desc";} [:db_insert_placeholder_12] => solr [:db_insert_placeholder_13] => core_search ) in apachesolr_stats_exit() (line 191 of D:\Inetpub\wwwroot\sites\all\modules\apachesolr_stats\apachesolr_stats.module).


I am running apachesolr_stats v. 7.x-1.0-beta1

Running update.php produces this error:

Warning: Invalid argument supplied for foreach() in apachesolr_stats_block_info() (line 961 of D:\inetpub\wwwroot\sites\all\modules\apachesolr_stats\apachesolr_stats.module)

1 Answer 1


Check your drupal database, table apachesolr_stats if it has a field env_id.

If not check installation of module apachesolr_stats, maybe uninstall and reinstall. It should create that table apachesolr_stats with the field env_id.

  • check your version of apachesolr_stats, field env_id got added in beta1. Maybe you missed update.php once in a while. Feb 13, 2015 at 17:58
  • Accepting this answer because it is definitely the source of the problem. However the update.php solution didn't fix it (see update) I don't have access to the DB so I can't check the table, unfortunately. Feb 24, 2015 at 19:38
  • Maybe you could try to uninstall and reinstall the module and see if that fixes the problem. You will probably lose the entries in the table apachesolr_stats when you do that. If you have no DB access and backup possibility for DB this could be risky. Feb 25, 2015 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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