Hello

I am trying to configure Apache Solr on a Drupal 7 installation, and am receiving the following error message when trying to access the configuration for the first time:

Uncaught exception thrown in session handler.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: UPDATE {sessions} SET uid=:db_update_placeholder_0, cache=:db_update_placeholder_1, hostname=:db_update_placeholder_2, session=:db_update_placeholder_3, timestamp=:db_update_placeholder_4 WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => 0 [:db_update_placeholder_2] => 128.144.156.30 [:db_update_placeholder_3] => batches|a:3:{i:17;b:1;i:18;b:1;i:19;b:1;}updates_remaining|a:0:{} [:db_update_placeholder_4] => 1318892708 [:db_condition_placeholder_0] => oAkCaGothqaLImLAxC908UV__tFPF_GSYwK3IHqjfB0 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 203 of D:\websites\drupal7\includes\session.inc).

I am using Drupal 7.8, PHP 5.2.17 provided by the Zend Community Edition server, MySQL 5.1.50 (also community). The whole shebang is running on Windows Server 2003 x86.

I have Solr running successfully for 3 other sites on the same server. I have applied all the configurations as documented in the README.TXT file, however I am unable to change the configuration in Drupal to use the Solr server as I get the PDOException before the admin page loads - so I'm not convinced that this is a Solr issue, but a PHP/Host issue.

Any suggestions would be great!

Thanks,

Tim

CommentFileSizeAuthor
#9 1312718-9.patch3.33 KBpwolanin

Comments

nick_vh’s picture

Status: Active » Postponed

It seems that your uid is null? Are you working with a clean install of drupal 7 or some export/import database? I don't think this is the right issue queue for that...

Column 'uid' cannot be null:
timatlee’s picture

I'm not sure why UID would be null - the rest of the site operates without any issue.

It is a clean install, but Solr has been the last thing to implement.

I imagine this isn't the right queue, however it seems weird that this error only crops up when accessing the Solr admin page, so I thought it was a good starting place.

timatlee’s picture

Just an update.. I tried adding the Acquia search-as-a-service module (with the 30-day trial), and I can now edit the Solr configuration settings.

Go figure.

nick_vh’s picture

Weird... I hope you can pinpoint the problem a bit more so we an maybe fix this little/big bug if the problem is in the code

timatlee’s picture

The closest I can get to is that there's nothing in apachesolr_environment_variable. If I apply this change to apachesolr.install (line 66): (note, also changing it to reflect my own environment..)

  db_insert('apachesolr_environment')->fields(array('env_id' => 'solr', 'name' => 'localhost server', 'url' => 'http://localhost:8080/solr-pcprli'))->execute();
  db_insert('apachesolr_environment_variable')->fields(array('env_id' => 'solr', 'name' => 'apachesolr_read_only', 'value' => 's:1:\"0\";'))->execute();

During installation, I get:

    Notice: Trying to get property of non-object in apachesolr_search_search_info() (line 230 of D:\websites\drupal7-dev\sites\all\modules\apachesolr\apachesolr_search.module).
    Notice: Trying to get property of non-object in apachesolr_search_search_info() (line 231 of D:\websites\drupal7-dev\sites\all\modules\apachesolr\apachesolr_search.module).

Then, in the admin/config overlay:
Notice: unserialize() [function.unserialize]: Error at offset 0 of 10 bytes in apachesolr_load_all_environments() (line 1223 of D:\websites\drupal7-dev\sites\all\modules\apachesolr\apachesolr.module).

So, ok, my text version of blob data. Noticed that the Configure Apache Solr link doesn't show up in the overlay, so I clear caches through the Performance page.

Once cleared, I now edit the server configuration (noting that the read-write mode toggle wasn't set at all) - once set, all the errors clear.

So.. not sure how to apply a fix for it - but this is how I've worked around it.

Hope it helps someone else!

nick_vh’s picture

Can you try this with the latest development build? I think some other things have been changed since then (mainly in that hook_search_info).

timatlee’s picture

Hello

I tried the 7.x-1.x dev module (dated 10/19/11) this morning. On installation:

    Notice: Trying to get property of non-object in apachesolr_search_search_info() (line 231 of D:\websites\drupal7-dev\sites\all\modules\apachesolr\apachesolr_search.module).
    Notice: Trying to get property of non-object in apachesolr_search_search_info() (line 232 of D:\websites\drupal7-dev\sites\all\modules\apachesolr\apachesolr_search.module).

Again, Apache Solr search settings page wasn't there - it came back after cache clearing.

As with the non-dev (beta?) version, I saw the same PDOException when trying to load admin/config/search/apachesolr.

pwolanin’s picture

Looks liek we need some better handling of the case where the core_search page is missing.

For now can you try uninstalling the apachesolr modules and re-installing?

pwolanin’s picture

Title: PDOException when accessing admin/config/search/apachesolr » Menu rebuild problems when installing apachesolr_search
Status: Postponed » Needs review
StatusFileSize
new3.33 KB

I have been seeing the error in #7 when enabling/installing the module, and then I get an infinite redirect when searching.

This little patch seems to mitigate it (though a bit ugly). Also reorganizes hook_enable and hook_install.

pwolanin’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev
Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

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