简体   繁体   English

IBM Watson Relationship Extraction“转发错误”(status_code 500)

[英]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: 我正在向IBM / Watson的关系提取服务发布一段文本,但在大约90秒后得到以下响应:

{"status": {"message": "Forwarding error", "status_code": 500}} {“status”:{“message”:“转发错误”,“status_code”:500}}

Most small files work fine and the results are as expected. 大多数小文件工作正常,结果如预期。 However, this file is large (200k) in size. 但是,此文件的大小(200k)。

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. 我尝试使用set_time_limit()CURLOPT_CONNECTTIMEOUTCURLOPT_TIMEOUT来增加超时值,但这没有任何区别。

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. 当无法找到服务(在本例中为Visual Recognition)时,这是一个内部错误,因此负载均衡器返回http状态500转发错误。
It was probably a glitch in the network, the service is working fine now. 这可能是网络上的一个小故障,现在服务工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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