I am using drupal 4.6.5. After I enabled cache support, I couldn't connect to the site using Mac Safari or IE.

I found that the server had some problem with handling compressed data. Here is the analysis of the connection.

Is this drupal's problem or bug in php?

> GET / HTTP/1.1
> Host: xxx.xxx.xxx
> Connection: close
> 
> HTTP/1.1 200 OK
> Date: Wed, 25 Jan 2006 00:07:36 GMT
> Server: Apache
> P3P: CP='CAD PSA CONi OTR OUR DEM ONL'
> X-Powered-By: PHP/5.0.5AnNyung
> Set-Cookie: PHPSESSID=d3995232ab438424752e184c0c0e6af2; expires=Fri, 17 Feb 2006
>  03:41:06 GMT; path=/
> Last-Modified: Tue, 24 Jan 2006 13:27:31 GMT
> ETag: "83daaa1e47e409e2c842aab93cc4b514"
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/html
> 
> 1b5
> <br />
> <b>Warning</b>:  gzinflate() [<a href='function.gzinflate'>function.gzinflate</a
> >]: buffer error in <b>/home/httpd/kldp/junseo/site/includes/bootstrap.inc</b> o
> n line <b>454</b><br />
> <br />
> <b>Warning</b>:  Cannot modify header information - headers already sent by (out
> put started at /home/httpd/kldp/junseo/site/includes/bootstrap.inc:454) in <b>/h
> ome/httpd/kldp/junseo/site/includes/bootstrap.inc</b> on line <b>465</b><br />

Comments

ksoonson’s picture

We found that this happens on mysql only.

When handling cache, gzencode() compresses data and tries to store this to 'data' field(longtext type) in cache table. But as mysql is unable to store this binary data to longtext type (different type), NULL is stored instead of the compressed data and here the problem happens.

Please change the type of 'data' field in cache table to mediumblob instead of longtext.

In .../database/database.mysql, please apply the following patch.

 CREATE TABLE cache (
  cid varchar(255) NOT NULL default '',
-  data longtext,
+  data mediumblob,
  expire int(11) NOT NULL default '0',
  created int(11) NOT NULL default '0',
  headers text,

This issue was resolved by JoungKyun.Kim

If you have more question, please send an email to me first through the contact form because he is quite busy. :-)

mh’s picture

I was having a similar problem:

Warning: gzinflate(): data error in /www/includes/bootstrap.inc on line 454

Warning: Cannot modify header information - headers already sent by (output started at /www/includes/bootstrap.inc:454) in /www/includes/bootstrap.inc on line 465

Browsing the cache table, it appeared as if the data for cached pages was being stored in an encoded format. The data for filters, menus, and variables was in clear text, however. Mysql collation was utf8_general_ci.

Changing cache.data from longtext to mediumblob worked for me also. I have not noticed any adverse effects after light browsing of the site...

Thanks for your help!

Zen’s picture

Priority: Critical » Normal

Can you guys please confirm this with the 4.7 betas or HEAD?

-K

deeptii’s picture

i still get the same problem on 4.6.5 after applying this update. i had to turn cache off to fix it.

pfaocle’s picture

magico’s picture

Version: 4.6.5 » 4.6.9

We must chase down this problem.
I had the same problem and deactivated all cache from my sites. I'll take a look at it later.

Przemek-1’s picture

Version: 4.6.9 » 4.7.4

I had the same error appearing in the Drupal 4.7 and finally found the problem. I use lighttpd web server and after I disabled compress module which creates compress content on fly and after clearing cache:

delete from cache;

it finally started to work. I assume that in Apache it can be caused by compression modules too: mod_deflate (in Apache 2.x) and mod_gzip (in Apache 1.x).

The data can be compressed directly by php. Just enter into php.ini:

zlib.output_compression = On                                                    
zlib.output_compression_level = 7

it works without breaking drupal's cache.

ksoonson’s picture

I checked that this field was set to 'longblog' at 5.1. So this issue can be closed for 5.1.

Thanks

pasqualle’s picture

Status: Active » Closed (won't fix)

This version is not supported. Reopen or create a new issue if the problem exists in any recent version (version equal or above Drupal 5)