Bug #20938
closedSOAP error while uploading an updated extension
0%
Description
When trying to upload an (updated) extension to TER, the following ErrorMessage shows up:
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://typo3.org/wsdl/tx_ter_wsdl.php' : Extra content at the end of the document in /var/.../typo3_src-4.3/typo3/mod/tools/em/class.em_soap.php on line 116
Error shows on Linux Debian Lenny Server, PHP 5.3, Typo3 4.3 Rev.5830 with a Site installed new with 4.3 and with a Site updated from 4.2.8 to latest trunk.
(issue imported from #M11802)
Files
Updated by Stefan Geith about 15 years ago
NO errors when using Linux Debian Lenny Server, PHP 5.2.9-0.dotdeb.2, Typo3 4.2.8.
Updated by Christoph Koehler about 15 years ago
OSX Leopard, PHP 5.3 entropy.ch package. Works fine with the 5.2.9 entropy package. TYPO3 trunk.
Updated by Sven Weiss about 15 years ago
OSX Snow Leopard with included 5.3 package, same error. Cannot update my extension, bad.
Updated by Marcus Krause about 15 years ago
Any change that this is related to #20843?
(e.g. somewhere (in an extension) new lines after a closing "?>")
Further possibility: Did you check PHP bugreports regarding SOAP problems in PHP 5.3?
Updated by Stefan Geith about 15 years ago
Extensions exported with the backup-feature can be imported on other installations without problem - so for me it seems not to be related to #20843.
Error occurs in this line:
$this->client = new SoapClient($options['wsdl'],(array)$options['soapoptions']);
Message is
Couldn't load from 'http://typo3.org/wsdl/tx_ter_wsdl.php'
But entered as URL, this files loads properly and has no extra spaces at end of file. I have uploaded this file.
I debuged the parameters given above:
$options['wsdl'] = http://typo3.org/wsdl/tx_ter_wsdl.php
$options['soapoptions'] = Array('trace'=>1, 'exceptions'=>0)
Any ideas, where I could search to dig into this problem ?
Could it be a PHP 5.3 problem, as all user who had this problem are using PHP 5.3 ?
Updated by Stefan Geith about 15 years ago
I found 2 possibly related bugs:
http://bugs.php.net/bug.php?id=49397
http://bugs.php.net/bug.php?id=49226
in # 499226 I found:
[snip]
I guess that in php 5.3 the soap server expects the content length to be
set in the header inorder to parse the complete wsdl, but the
AutoDiscover class does not send this.
By adding header('Content-Length: '.strlen($this->_wsdl->toXML())); to
the handle function in the AutoDiscover class things are working
[/snip]
And I found a workaround:
I downloaded the file 'http://typo3.org/wsdl/tx_ter_wsdl.php' and copied it to typo3/mod/tools/em/ and added this line to class.em_soap.php:
$options['wsdl'] = 'tx_ter_wsdl.php.xml';
so the xml-file is loaded locally - and this works ...
So can anyone check, if the content length is set - and if not add this ?
Maybe this is the solution ... ?
Updated by Marcus Krause about 15 years ago
I checked the headers by directly requesting the WSDL with the browser. There's no "Content-Length" header set in the typo3.org server response, neither with HTTP/1.0 nor with HTTP/1.1.
However, the PHP bug reports show that 5.3 seems to have a (still undetected) problem and you need to search for the root cause in PHP (not in TYPO3).
Updated by Stefan Geith about 15 years ago
I think, having a "Content-Length" header cannot hurt.
So this should be implemented (should be easy for the author - right?) and maybe this solves the problem - even if the real bug is in PHP5.3 and not in Typo3.
Updated by Stefan Geith about 15 years ago
Nothing new here ?
Isn't someone out there, who could check this tiny little patch ?
Updated by Sven Weiss about 15 years ago
Hi,
found a discussion on bugs.php.net:
http://bugs.php.net/bug.php?id=48216
Can nobody try this?
Thanks!
Updated by Stefan Geith about 15 years ago
Reading this, it looks to me like adding "Content-Length" fixes this bug.
Updated by Oliver Hader about 15 years ago
Stefan, do you have compression enabled in the install tool?
Besides that, could you please give an debug output of the delivered content?
Maybe a warning appeared and was added to $WSDLSource...
Updated by Stefan Geith about 15 years ago
Latest trunk: Rev 6144
[BE][compressionLevel] = 0
[FE][compressionLevel] = 0
Error:
Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://typo3.org/wsdl/tx_ter_wsdl.php' : Extra content at the end of the document in /var/[...]/typo3/mod/tools/em/class.em_soap.php on line 116
Debugging the parameters in Line 116:
$this->client = new SoapClient($options['wsdl'],(array)$options['soapoptions']);
gives
$options['wsdl'] = 'http://typo3.org/wsdl/tx_ter_wsdl.php'
$options['soapoptions']) = Array('trace'=>1, 'exceptions'=>0)
I entered this URL in the Browser to see, if there is anything wrong with this file, but all seems OK (Attached).
When I place the loaded XML file locally in my fileadmin -dir and change $options['wsdl'] to hold the path to the local copy, then all works !
wget http://typo3.org/wsdl/tx_ter_wsdl.php
Updated by Steffen Kamper about 15 years ago
I will add the content length to tx_ter_wsdl.php. It doesn't change anything and maybe it helps.
Updated by Thorsten Kahler about 15 years ago
Changing tx_ter_wsdl.php probably won't help because with "Transfer-Encoding: chunked" a Content-Length header isn't necessary. According to the above mentionend PHP bug report (http://bugs.php.net/bug.php?id=48216) the issue seems to be fixed in PHP 5.3-HEAD so we can't do anything about it but wait for a fixed PHP 5.3 version.
Updated by Stefan Geith about 15 years ago
"isn't necessary" :
- does not mean that it doesn't help in this case ...
- does not say, that it must be omitted
So I think, we should try adding the content length to tx_ter_wsdl.php
Updated by Sven Weiss about 15 years ago
Also think the same. Why not try it?
You can also place a second tx_ter_wsdl.php with Content-Length somewhere else on the server and we change the URL in the Installation Tool to try it.
I will also test it ASAP if you can add a second file there.
Thanks!
Updated by Sven Weiss about 15 years ago
Simply tested it on my own.
Created a PHP-File with the following Content on my Webspace:
$content = file_get_contents('http://typo3.org/wsdl/tx_ter_wsdl.php');
header("Content-Type: text/xml");
header("Content-Length: " . strlen($content));
echo $content;
Then changed the URL in Install Tool.
Upload worked!
Updated by Marcus Krause over 14 years ago
The TYPO3.org TER now sends an additional content-length header which should fix the problem without the need to patch TYPO3 core (see above note).
So, whoever had problems, please test again, if it's working for you now.
Thanks.
Updated by Sylvia-Kathrin Tanneberger over 14 years ago
This issue I have got, while I have uploaded a new extension to TER.
Fatal error: SOAP-ERROR: Encoding: object hasn't 'name' property in C:\Users\Sylvia\Documents\Zend Space Hubmann\Eventoni Typo3\typo3\typo3\mod\tools\em\class.em_soap.php on line 230
Updated by Marcus Krause over 14 years ago
@Sylvia-Kathrin:
Your problem is a duplicate of #0013637 and #0013644. These issues are already resolved in 4-2, 4-3 and trunk. So far, there aren't any TYPO3 packages out that contain the according patch. You might want to grab the patch from #0013637 as a temporary solution.
Updated by Peter Klein over 14 years ago
Problem still exists in TYPO3 v4.3.2..
Updated by Sven Weiss over 14 years ago
Test with Revision 7235 out of https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2/
Works.
Updated by Peter Klein over 14 years ago
The latest stable release v4.3.2 STILL gives me this error when uploading extensions to TER.
Fatal error: SOAP-ERROR: Encoding: object hasn't 'name' property in /var/www/web23/web/typo3_src-4.3.1/typo3/mod/tools/em/class.em_soap.php on line 230
The patch from #0013637 doesn't fix the problem, it just introduces a new error..
Updated by Marcus Krause over 14 years ago
Do you still have any upload problems with recent 4.3.3?