简体   繁体   中英

IBM Watson Relationship Extraction “Forwarding error” (status_code 500)

I am POSTing a piece of text to IBM/Watson's Relationship Extraction service but get the following response after about 90 seconds:

{"status": {"message": "Forwarding error", "status_code": 500}}

Most small files work fine and the results are as expected. However, this file is large (200k) in size.

Here's my code:

set_time_limit(0);

$curl = curl_init();
$post_args = array(
'txt' => $data,
'sid' => 'ie-en-news',
'rt' => 'json' 
);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_args);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_URL, "https://gateway.watsonplatform.net/relationship-extraction-beta/api/v1/sire/0");
curl_setopt($curl, CURLOPT_USERPWD, "XXXXXXXXXXXXX:XXXXXXXXXXXXX");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT ,0);
curl_setopt($curl, CURLOPT_TIMEOUT, 600); 

$result = curl_exec($curl);
curl_close($curl);

$decoded = json_decode($result, true);
echo "RESPONSE: [<Br/><pre>$result</pre><br/>]";

I tried increasing the timeout values using set_time_limit() , CURLOPT_CONNECTTIMEOUT and CURLOPT_TIMEOUT but that made no difference.

That's an internal error when the service (in this case Visual Recognition) can't be found so the load balancer returns a http status 500 forwarding error.
It was probably a glitch in the network, the service is working fine now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM