本文介绍了瞬态400错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行100多批面部检测时出现问题。它会因400个错误请求而失败,但并非总是如此(同时重新尝试单个检测以及整个批次)。我已经运行了429个错误并实施了速率限制,所以
我希望这是一个明显的问题。我附上相关http事务的细节。首先,最后一个成功,然后是失败,然后尝试复制错误(没有复制)。哈希被混淆了。为了调试
方便,我删除了所有三个事务共有的所有行,并且我也附加了该分析。将这三个电话分开很少。欢迎任何建议。谢谢

I am having some problem when running a 100-long batch of face detections. It will fail with 400 bad request, but not always (both re-attempting single detections as well the whole batch). I have already run in 429 errors and implemented rate limits, so I expect this to be a distinct problem. I attach the detail of related http transactions. First, the last successful one, followed by the failed on, followed by an attempt to replicate the error (did not replicate). Hashes have been obfuscated. For debugging convenience, I eliminated all lines common to all three transaction, and I attach also that analysis. There is very little to separate the three calls. Any suggestion welcome. Thanks

上次成功请求:



- > POST / face / v0 /检测?analyzeFaceLandmarks = false& analyzeAge = true& analyzeGender = true& analyzeHeadPose = true HTTP / 1.1

- > User-Agent:curl / 7.37.1 Rcurl / 1.95.4.6 httr / 0.6.1

- >主持人:api.projectoxford.ai

- > Accept-Encoding:gzip

- > Cookie:ai_session = XXXXX | 2015-07-13T18:48:48.4404703 + 00:00 | 2015-07-13T18:55:07.1352818 + 00:00; ai_user = XXXXX | 2015-07-13T18:48:53.1143873 + 00:00

- >接受:application / json,text / xml,application / xml,* / *

- >内容类型:application / json

- > Ocp-Apim-Subscription-Key:XXXXX

- >内容长度:72

- > 

>> {" url":" https://farm4.staticflickr.com/3688/19045983213_a3d3be539e.jpg"}
$


< - HTTP / 1.1 200 OK

< - 缓存控制:无缓存

< - Pragma:no-cache

< - Content-Length:205

< - Content-Type:application / json; charset = utf-8

< - Expires:-1

< - X-AspNet-Version:4.0.30319

< - X-Powered-By:ASP.NET

< - 日期:星期一,2015年7月13日18:58:13 GMT

< -  



申请失败:



- > POST / face / v0 /检测?analyzeFaceLandmarks = false& analyzeAge = true& analyzeGender = true& analyzeHeadPose = true HTTP / 1.1

- > User-Agent:curl / 7.37.1 Rcurl / 1.95.4.6 httr / 0.6.1

- >主持人:api.projectoxford.ai

- > Accept-Encoding:gzip

- > Cookie:ai_session = XXXXX | 2015-07-13T18:48:48.4404703 + 00:00 | 2015-07-13T18:55:07.1352818 + 00:00; ai_user = XXXXX | 2015-07-13T18:48:53.1143873 + 00:00

- >接受:application / json,text / xml,application / xml,* / *

- >内容类型:application / json

- > Ocp-Apim-Subscription-Key:XXXXX

- >内容长度:71

- > 

>> {" url":" https://farm1.staticflickr.com/426/19480236369_88ab731197.jpg"}
$


< - HTTP / 1.1 400错误请求

< - Cache-Control:no-cache

< - Pragma:no-cache

< - Content-Length:204

< - Content-Type:application / json; charset = utf-8

< - Expires:-1

< - X-AspNet-Version:4.0.30319

< - X-Powered-By:ASP.NET

< - 日期:星期一,2015年7月13日18:58:17 GMT

< -  



重复请求:



- > POST / face / v0 /检测?analyzeFaceLandmarks = false& analyzeAge = true& analyzeGender = true& analyzeHeadPose = true HTTP / 1.1

- > User-Agent:curl / 7.37.1 Rcurl / 1.95.4.6 httr / 0.6.1

- >主持人:api.projectoxford.ai

- > Accept-Encoding:gzip

- > Cookie:ai_session = XXXXX | 2015-07-13T18:48:48.4404703 + 00:00 | 2015-07-13T18:55:07.1352818 + 00:00; ai_user = XXXXX | 2015-07-13T18:48:53.1143873 + 00:00

- >接受:application / json,text / xml,application / xml,* / *

- >内容类型:application / json

- > Ocp-Apim-Subscription-Key:XXXXX

- >内容长度:71

- > 

>> {" url":" https://farm1.staticflickr.com/426/19480236369_88ab731197.jpg"}
$


< - HTTP / 1.1 200 OK

< - 缓存控制:无缓存

< - Pragma:no-cache

< - Content-Length:2

< - Content-Type:application / json; charset = utf-8

< - 到期日:-1

< - Set-Cookie:ai_session = XXXXX | 2015-07-13T18:48:48.4404703 + 00 :00 | 2015-07-13T19:04:20.0273630 + 00:00;到期=星期一,2015年7月13日19:34:20 GMT; path = /
$
< - X-AspNet-Version:4.0.30319

< - X-Powered-By:ASP.NET

< - 日期:星期一,2015年7月13日19:04:19 GMT

< -  

Last successful request:

-> POST /face/v0/detections?analyzesFaceLandmarks=false&analyzesAge=true&analyzesGender=true&analyzesHeadPose=true HTTP/1.1
-> User-Agent: curl/7.37.1 Rcurl/1.95.4.6 httr/0.6.1
-> Host: api.projectoxford.ai
-> Accept-Encoding: gzip
-> Cookie: ai_session=XXXXX|2015-07-13T18:48:48.4404703+00:00|2015-07-13T18:55:07.1352818+00:00; ai_user=XXXXX|2015-07-13T18:48:53.1143873+00:00
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
-> Ocp-Apim-Subscription-Key: XXXXX
-> Content-Length: 72
-> 
>> {"url":"https://farm4.staticflickr.com/3688/19045983213_a3d3be539e.jpg"}

<- HTTP/1.1 200 OK
<- Cache-Control: no-cache
<- Pragma: no-cache
<- Content-Length: 205
<- Content-Type: application/json; charset=utf-8
<- Expires: -1
<- X-AspNet-Version: 4.0.30319
<- X-Powered-By: ASP.NET
<- Date: Mon, 13 Jul 2015 18:58:13 GMT
<- 

Failed request:

-> POST /face/v0/detections?analyzesFaceLandmarks=false&analyzesAge=true&analyzesGender=true&analyzesHeadPose=true HTTP/1.1
-> User-Agent: curl/7.37.1 Rcurl/1.95.4.6 httr/0.6.1
-> Host: api.projectoxford.ai
-> Accept-Encoding: gzip
-> Cookie: ai_session=XXXXX|2015-07-13T18:48:48.4404703+00:00|2015-07-13T18:55:07.1352818+00:00; ai_user=XXXXX|2015-07-13T18:48:53.1143873+00:00
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
-> Ocp-Apim-Subscription-Key: XXXXX
-> Content-Length: 71
-> 
>> {"url":"https://farm1.staticflickr.com/426/19480236369_88ab731197.jpg"}

<- HTTP/1.1 400 Bad Request
<- Cache-Control: no-cache
<- Pragma: no-cache
<- Content-Length: 204
<- Content-Type: application/json; charset=utf-8
<- Expires: -1
<- X-AspNet-Version: 4.0.30319
<- X-Powered-By: ASP.NET
<- Date: Mon, 13 Jul 2015 18:58:17 GMT
<- 

Repeat request:

-> POST /face/v0/detections?analyzesFaceLandmarks=false&analyzesAge=true&analyzesGender=true&analyzesHeadPose=true HTTP/1.1
-> User-Agent: curl/7.37.1 Rcurl/1.95.4.6 httr/0.6.1
-> Host: api.projectoxford.ai
-> Accept-Encoding: gzip
-> Cookie: ai_session=XXXXX|2015-07-13T18:48:48.4404703+00:00|2015-07-13T18:55:07.1352818+00:00; ai_user=XXXXX|2015-07-13T18:48:53.1143873+00:00
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
-> Ocp-Apim-Subscription-Key: XXXXX
-> Content-Length: 71
-> 
>> {"url":"https://farm1.staticflickr.com/426/19480236369_88ab731197.jpg"}

<- HTTP/1.1 200 OK
<- Cache-Control: no-cache
<- Pragma: no-cache
<- Content-Length: 2
<- Content-Type: application/json; charset=utf-8
<- Expires: -1
<- Set-Cookie: ai_session=XXXXX|2015-07-13T18:48:48.4404703+00:00|2015-07-13T19:04:20.0273630+00:00; expires=Mon, 13-Jul-2015 19:34:20 GMT; path=/
<- X-AspNet-Version: 4.0.30319
<- X-Powered-By: ASP.NET
<- Date: Mon, 13 Jul 2015 19:04:19 GMT
<- 

简化版(所有三向公共线)已删除)

Abridged version (all three-way common lines removed)

推荐答案

您可以将图像下载到本地计算机并尝试使用'Content-type':'application / octet-stream'方法吗?

Can you download the images to your local machine and try using the 'Content-type': 'application/octet-stream' method?


这篇关于瞬态400错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 21:37