Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004728 [Quercus] major always 08-25-11 01:23 06-21-12 00:55
Reporter timowest View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 4.0.14
  Product Build
Summary 0004728: Cannot install theme in Wordpress using Quercus
Description I cannot install themes in Wordpress 3.2.1 when using Quercus 4.0.18.

I get the following error :

Installing Theme: Zombie Apocalypse 1.34

Downloading install package from http://wordpress.org/extend/themes/download/zombie-apocalypse.1.34.zip? [^]

Unpacking the package?

Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0005462)
timowest
08-25-11 02:07

I am using Jetty
 
(0005464)
timowest
08-25-11 05:20

I added some logging to the pclzip class and it appears that the .tmp files it processes are empty. Jetty is the owner of the used directory.
 
(0005468)
timowest
08-26-11 00:34

I was able to fix the issue locally by changing the following line in class-http.php / _get_first_available_transport :

$request_order = array( 'curl', 'streams', 'fsockopen' );

to

$request_order = array( 'fsockopen', 'curl', 'streams' );

curl didn't work and streams threw an exception. fsockopen worked.
 
(0005470)
kdecherf
08-27-11 08:19

Hi,

Can you give us the exception thrown by streams please ? Thanks.
 
(0005471)
timowest
08-28-11 23:50

When using streams I get the following error logs when trying to install a theme :

Aug 29, 2011 9:45:58 AM com.caucho.quercus.env.Env error
INFO: /var/lib/jetty/webapps/wordpress/wp-includes/class-http.php:906: Warning: java.io.IOException: Content-Length=97 but only received 0 [stream_get_contents]
Aug 29, 2011 9:46:05 AM com.caucho.quercus.env.Env error
INFO: /var/lib/jetty/webapps/wordpress/wp-includes/class-http.php:906: Warning: java.io.IOException: Content-Length=97 but only received 0 [stream_get_contents]
Aug 29, 2011 9:46:07 AM com.caucho.quercus.env.Env error
INFO: /var/lib/jetty/webapps/wordpress/wp-includes/class-http.php:906: Warning: java.io.IOException: Content-Length=153 but only received 0 [stream_get_contents]
 
(0005472)
timowest
08-29-11 01:03

I found now also the bug in the curl module. When using the options CURLOPT_RETURNTRANSFER and CURLOPT_FILE, the CurlResource class skips outputting to outputFile and returns the contents directly.

When CURLOPT_FILE is given, the output file serialization needs to be done. CURLOPT_RETURNTRANSFER needs to be handled later.

The problematic code is here :

    if (_isReturningData)
      return data;

    if (_outputHeaderFile != null) {
      FileModule.fwrite(env,
                        _outputHeaderFile,
                        _header.toInputStream(),
                        Integer.MAX_VALUE);
    }

    if (_outputFile != null) {
      FileModule.fwrite(env,
                        _outputFile,
                        data.toInputStream(),
                        Integer.MAX_VALUE);

    }
    else {
      env.print(data);
    }

Buffering to a bytearrayoutputstream or something like that might a solution here.
 
(0005474)
timowest
08-29-11 01:38

The streams bug appears in com.caucho.vfs.HttpStream getConnInputImpl() :

        // server/1963
        if (len != writeLength) {
          throw new IOException(L.l("Content-Length={0} but only received {1}",
                                    len, "" + writeLength));
        }

The usage of the variable _tempStream seems to be broken.
 
(0005909)
nam
06-21-12 00:55

Fixed for 4.0.29.

php/1v0z
 

- Issue History
Date Modified Username Field Change
08-25-11 01:23 timowest New Issue
08-25-11 02:07 timowest Note Added: 0005462
08-25-11 05:20 timowest Note Added: 0005464
08-26-11 00:34 timowest Note Added: 0005468
08-27-11 08:19 kdecherf Note Added: 0005470
08-27-11 08:20 kdecherf Issue Monitored: kdecherf
08-28-11 23:50 timowest Note Added: 0005471
08-29-11 01:03 timowest Note Added: 0005472
08-29-11 01:38 timowest Note Added: 0005474
06-21-12 00:54 nam Status new => assigned
06-21-12 00:54 nam Assigned To  => nam
06-21-12 00:55 nam Status assigned => closed
06-21-12 00:55 nam Note Added: 0005909
06-21-12 00:55 nam Resolution open => fixed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
45 total queries executed.
34 unique queries executed.
Powered by Mantis Bugtracker