Intermittently get this in my log:

PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'hostname' at row 1: INSERT INTO {httpbl} (hostname, status, expire) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => XX.XXX.XX.XXX;CLIENT-IP:YY.YYY.YYY.YYY;User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.2) Gecko/2008070208 Firefox/3.0.1Mozilla/5.0 (Windows; U; Windows NT 5.2) AppleWebKit/525.13 (KHTML [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 1402690027 ) in _httpbl_cache_set() (line 607 of /srv/bindings/c6ba3a2220b94bc8be7406449b7ec6c8/code/sites/all/modules/httpbl/httpbl.module).

Seems similar to this fast_dblog issue where hostname is exceeding the 128 character limit:

https://drupal.org/node/2268541

I'm swapped in place of $ip in httpbl.module's merge and insert's for now "substr($ip, 0, 128)" just to see if it mitigates the error, but not sure how this could potentially negatively impact the module's functionality.

Any input appreciated. Thanks.

Comments

bryrock’s picture

This is an odd error, here, and I can't account for it. Something else must have failed, because the value of $ip (the value being stored in the cache table) should not ever be larger than an ip address.

capogeannis’s picture

Yea, pretty odd. It seems to be storing a full array of info in these cases instead of the IP only. Sample entry programmatically truncated to 128 characters:

xx.xxx.xxx.xxx;CLIENT-IP:yy.yyy.yy.yyy;User-Agent:Mozilla/5.0 (X11; U; FreeBSD; i386; en-US; rv:1.7) Gecko;

Not specific to any browser or OS, according to the entries. I suppose instead of truncating, I could do a check and see if it needs to be split again to grab the IP only from that array.

bryrock’s picture

Status: Needs review » Closed (cannot reproduce)