I see this in the debug output once I enabled nodejs.

Uncaught exception thrown in session handler.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'hostname' cannot be null: INSERT INTO {sessions} (sid, ssid, uid, cache, hostname, session, timestamp) 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); Array
(
[:db_insert_placeholder_0] => 1WiMEkgUizMcD-oOdaTICCi0cY_QpiCFToLspJxlZPc
[:db_insert_placeholder_1] =>
[:db_insert_placeholder_2] => 0
[:db_insert_placeholder_3] => 0
[:db_insert_placeholder_4] =>
[:db_insert_placeholder_5] => nodejs_config|a:8:{s:6:"scheme";s:4:"http";s:6:"secure";i:0;s:4:"host";s:30:"devmac.dev.socialnicheguru.com";s:4:"port";s:4:"8191";s:8:"resource";s:10:"/socket.io";s:9:"authToken";s:32:"4e01a93f48e895d287d94f77edc5cd6b";s:10:"serviceKey";s:51:"kdfu0026ampflkju0026ltfhsdfue1234343sdfnaf0dffadfj1";s:20:"websocketSwfLocation";s:130:"/sites/thirdstreetneighbors/modules/nodejs/socket_io/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMain.swf";}smart_ip|a:1:{s:8:"location";a:12:{s:7:"country";s:0:"";s:12:"country_code";s:0:"";s:6:"region";s:0:"";s:11:"region_code";s:0:"";s:4:"city";s:0:"";s:3:"zip";s:0:"";s:8:"latitude";N;s:9:"longitude";N;s:10:"ip_address";N;s:9:"timestamp";i:1367532201;s:11:"postal_code";s:0:"";s:17:"formatted_address";s:0:"";}}ip_geoloc|a:3:{s:22:"position_pending_since";d:1367532200.4760308;s:19:"last_position_check";i:1367532201;s:8:"location";a:13:{s:7:"country";s:0:"";s:12:"country_code";s:0:"";s:6:"region";s:0:"";s:11:"region_code";s:0:"";s:4:"city";s:0:"";s:3:"zip";s:0:"";s:8:"latitude";N;s:9:"longitude";N;s:10:"ip_address";N;s:9:"timestamp";i:1367532201;s:11:"postal_code";s:0:"";s:17:"formatted_address";s:0:"";s:8:"provider";s:8:"smart_ip";}}
[:db_insert_placeholder_6] => 1367532200
)
in _drupal_session_write() (line 209 of commons-7.x-3.x-dev/includes/session.inc).


Comments

SocialNicheGuru’s picture

Project: Node.js integration » Drupal core
Version: 7.x-1.x-dev » 7.22
Component: Code » other

this is a basic sessions problem

SocialNicheGuru’s picture

Project: Drupal core » IP Geolocation Views & Maps
Version: 7.22 » 7.x-1.x-dev
Component: other » Code

changing to proper queue

RdeBoer’s picture

Status: Active » Postponed (maintainer needs more info)

Hello SocialNicheGuru,

What makes you think this an issue with IP Geolocation Views and Maps?

Regardless of which module you think is to blame a stack trace and reproduceable test case would be nice, especially since this error has never before been reported against "IP Geolocation Views and Maps". Sure I can see an attempt is made to write $_SESSION data and there happens to be Smart IP and IP Geoloc info in your $_SESSiON, just like there's stuff from other modules in the $_SESSION...

At the end of the day the error doesn't occur because what is or isn't in the $_SESSION, but because an attempt is made to store the $_SESSION data against a NULL hostname (db_insert_placeholder_4). What code does that? No idea.

Rik

RdeBoer’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
SocialNicheGuru’s picture

I think you are right.

It started with nodejs, then ip_geoloc. But it is a deeper session issue (interaction among caching modules)

I am trying to debug session cache issues.

PS. This is an AWESOME module!

SocialNicheGuru’s picture

Title: Uncaught exception: hostname cannot be null: INSERT INTO {sessions} in _drupal_session_write() » FIXED: Uncaught exception: hostname cannot be null: INSERT INTO {sessions}: need to add 'localhostl to config variable
Project: IP Geolocation Views & Maps » Varnish
Status: Closed (cannot reproduce) » Fixed

I set this up on a test machine.
127.0.0.1 is the internal address but I was getting a major error (above).

I had to add 'localhost' to the reverse_proxy_addresses variable.

// Tell Drupal what addresses the proxy server(s) use
//$conf['reverse_proxy_addresses'] = array('127.0.0.1','your-ip-address-here');
// added 'localhost' because hostname would be returned incorrectly as NULL and cause a pdo exception
$conf['reverse_proxy_addresses'] = array('127.0.0.1','localhost');

SocialNicheGuru’s picture

Status: Fixed » Active

The above is not the answer.

I know it is varnish because when I either disable it or set varnish caching to false, the error goes away.

SocialNicheGuru’s picture

Title: FIXED: Uncaught exception: hostname cannot be null: INSERT INTO {sessions}: need to add 'localhostl to config variable » Uncaught exception: hostname cannot be null: INSERT INTO {sessions}: need to add 'localhostl to config variable

This is not fixed.

SocialNicheGuru’s picture

Title: Uncaught exception: hostname cannot be null: INSERT INTO {sessions}: need to add 'localhostl to config variable » Fixed: Uncaught exception: hostname cannot be null: INSERT INTO {sessions}. ip_address() fails when client request IP = proxy IP
Status: Active » Fixed

ip_address() fails when client request IP and proxy IP are the same

https://drupal.org/node/1327728#comment-6442202

The issue is that no ip address is returned from ip_address() if the reverse proxy and local ip are both 127.0.0.1.

Status: Fixed » Closed (fixed)

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

a7med.manutd’s picture

Assigned: Unassigned » a7med.manutd
Issue summary: View changes