I implemented a reindex API call. For an category index, it works as expected. For a product index (which takes about 3 min. to process), a process is started, but after approx. 45 seconds, I get a response “Invalid XML”.
As it looks like, there is a problem of execution time. I did change a parameter max_execution_time to 600 (seconds). I enabled logging, but get no exception or error. In index management GUI, I see that reindex process started and is finished successfully 2 minutes after a response (Invalid XML) is returned (total reindex time is approx. 3 min).
A code of an API looks ok, because I can update all indexes, except product price and product flat data.
Any idea?
using wireshark:
Request:
POST /index.php/api/v2_soap/index/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3053)
VsDebuggerCausalityData: uIDPo6o2uSDL0oVKpqKJjDrFPsEAAAAAJt2oK8A51UOeAJsKkziyy/q2t81fNIxMnAvF+VaT7jIACQAA
Content-Type: text/xml; charset=utf-8
SOAPAction: “urn:Mage_Api_Model_Server_V2_HandlerAction”
Host: XXXXXXXXXXX(hidden for a security reason
Content-Length: 609
Expect: 100-continue
HTTP/1.1 100 Continue
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:Magento" xmlns:types="urn:Magento/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:iwCoreIndexingReindexById>
<sessionId xsi:type="xsd:string">835cfa019572c1a893b3799eecbc6903</sessionId>
<indexId xsi:type="xsd:int">4</indexId>
</tns:iwCoreIndexingReindexById>
</soap:Body>
</soap:Envelope>
Response(after 39 seconds!)
HTTP/1.1 500 Internal Service Error
Date: Fri, 18 May 2012 20:50:22 GMT
Server: Apache
X-Powered-By: PHP/5.2.17
Content-Length: 269
Connection: close
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>Sender</faultcode>
<faultstring>Invalid XML</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
State of index is processing. So a call is invoked and an action is also in a progress. Api.php looks like(this code is execuded and no exception is logged):
public function indexingReindexById( $indexId ){
$process = Mage::getModel('index/process')->load($indexId);
try{
$process->reindexAll();
} catch(exception $e){
Mage::Log($e->getMessage());
return false;
}
return true;
}
Changing a provider did a job. So it was a server issue.