View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011868 | mantisbt | api soap | public | 2010-04-29 17:05 | 2010-07-29 10:45 |
| Reporter | Wepl | Assigned To | rombert | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.2.0 | ||||
| Target Version | 1.2.2 | Fixed in Version | 1.2.2 | ||
| Summary | 0011868: returned compressed data corrupt | ||||
| Description | While updating from 1.2.0a3 to 1.2.0 while using the same webserver and same client (perl SOAP::Lite) a call to mc_project_get_users failed always. After a lot of debugging and browsing I discovered that it seems the SOAP message send back from mantisbt is corrupt. It cannot be decompressed on the client (zcat: out.gz: unexpected end of file). with 1.2.0a3 (working): with 1.2.0 (failing, looks as there are two gzip headers): as a work around I have disabled compression in nusoap: --- mantisbt-1.2.0/library/nusoap/nusoap.php 2010-02-24 17:43:29.000000000 +0100
with this change it works as with 1.2.0 | ||||
| Tags | No tags attached. | ||||
| Attached Files | repimpx1.pl (2,176 bytes)
#!/usr/bin/perl -w
###########################################################################
# imports
###########################################################################
use Data::Dumper;
use Date::Parse;
use Encode;
use SOAP::Lite;
#use SOAP::Lite +trace;
#print "used SOAP::Lite version is $SOAP::Lite::VERSION\n";
use strict;
###########################################################################
# define constants and globals
###########################################################################
use constant {
# soap api namespace
SOAP_URI => 'http://futureware.biz/mantisconnect',
# soap api endpoint
SOAP_PROXY => 'http://m.whdload.de/api/soap/mantisconnect.php',
# soap api login details (must have admin access)
SOAP_USER => 'administrator',
SOAP_PASS => 'xxx',
# mantis constants
ALL_PROJECTS => 0,
ACCESS_ANYBODY => 0,
ACCESS_REPORTER => 25,
ACCESS_DEVELOPER => 55,
ACCESS_MANAGER => 70,
};
# access the mantis api
my $mantis = SOAP::Lite -> uri(SOAP_URI) -> proxy(SOAP_PROXY, options => {compress_threshold => 10000});
$mantis or die "could not construct soap:$!";
# get list of all registered users from mantis
print " - getting mantis users\n";
{
my ($response,$user,$acc,$nam,$ema,$usr);
$response = $mantis -> mc_project_get_users(SOAP_USER, SOAP_PASS, ALL_PROJECTS, ACCESS_ANYBODY);
$response or die "soap: mc_project_get_users failed:$!";
#&WriteFile('out.gz',$mantis->{'_transport'}->{'_proxy'}->{'_http_response'}->{'_content'});
#use Compress::Zlib;
#$_ = Compress::Zlib::memGunzip($mantis->{'_transport'}->{'_proxy'}->{'_http_response'}->{'_content'}) or die "memGunzip:$gzerrno";
#s/>/>\n/g;
#die $_;
#delete $mantis->{'_transport'}->{'_proxy'}->{'_http_response'}->{'_content'};
#delete $mantis->{'_deserializer'}->{'_ids'};
#delete $mantis->{'_deserializer'}->{'_parser'}->{'_done'};
#die "mc_project_get_users failed:$!, dumping \$mantis\n" . &Dumper($mantis);
$response->fault and die "soap: mc_project_get_users: (".$response->faultcode.") ".$response->faultstring;
foreach $user (@{$response->result}) {
# returns: 'email' 'real_name' 'name' 'id'
#print Dumper($user); exit;
}
}
| ||||
|
Please try a recent 1.2.x build from git master-1.2.x , as I have recently updated the NuSOAP library to the latest released version ( http://git.mantisbt.org/?p=mantisbt.git;a=commit;h=c6cc770cc0fe5ff264e424a70b95764ada4186de ) and it might contain a fix for it. |
|
|
I tried mantisbt-1.2.1-2010-05-04-master-1.2.x-a56df81.zip which behaves the same. |
|
|
Will you be able to run a git bisect to find out the faulty commit? This way I can understand the root cause and supply a proper fix. |
|
|
dcf98109db64e673c8ce2f4e2ca7b53d52495aaa is first bad commit
:100644 100644 7531444a0d3703b52b1c6d7f3ff8b8b23fea69bc 5a45339efcb9d0d75af525ee31ff215e14314db0 M core.php maybe the change is causing the general compression to on, so it would be interesting if nuoap compression is working the same time php compression is enabled? |
|
|
This might be cause by double-compression, as you have indicated. Can you please post your compression-related PHP/MantisBT parameters, as well as the way you're making the SOAP requests on the client side? Perl code is fine - if you're able to share it. Thanks. |
|
|
test perl script attached php config: zlib ZLib Support enabled Directive Local Value Master Value Environment Variable Value I think a possible solution could be to set COMPRESSION_DISABLED in mantisconnect.php |
|
|
Actually it was the zlib compression kicking in - at least in my case. I've disabled both zlib compression and defined COMPRESSION_DISABLED for the SOAP calls. Please verify that it does work for you. |
|
|
it works for me, thanks. |
|
|
MantisBT: master 6daeb19d 2010-05-16 05:12 Details Diff |
Only allow NuSOAP to compress SOAP responses When NuSOAP receives a request which declares that it accepts a compressed (gzip,deflate) response, it performs its own compression. Although conceptually incorrect, since this should be handled by the web server, there is no configuration flag to disable it. Therefore we disable all forms of compression for the SOAP API and allow NuSOAP to perform the compression itself. Fixes 0011868: returned compressed data corrupt (cherry picked from commit fd65426d7c94c3f0d4afda09604d43f27024fcf6) |
Affected Issues 0011868 |
|
| mod - api/soap/mantisconnect.php | Diff File | ||
|
MantisBT: master-1.2.x 9faf487c 2010-05-16 05:12 Details Diff |
Only allow NuSOAP to compress SOAP responses When NuSOAP receives a request which declares that it accepts a compressed (gzip,deflate) response, it performs its own compression. Although conceptually incorrect, since this should be handled by the web server, there is no configuration flag to disable it. Therefore we disable all forms of compression for the SOAP API and allow NuSOAP to perform the compression itself. Fixes 0011868: returned compressed data corrupt |
Affected Issues 0011868 |
|
| mod - api/soap/mantisconnect.php | Diff File | ||