Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Errors in Batch Responses leads to OutOfBounds indexing of batchResps #25

Open
tslilyai opened this issue May 3, 2018 · 3 comments

Comments

@tslilyai
Copy link
Contributor

tslilyai commented May 3, 2018

After issuing a batch that succeeds (issueBatch() returns a successful response), the response fails to be parsed (batchResps.size() == 0 after processBatchResponse() is invoked). This means that requesting threads will index into batchResps and get an OutOfBounds exception. I believe the response indicates a server-side bug, and the EmbeddedSocialBatchClientImpl may want to handle 500 errors (it cannot parse them at the moment). Included below is an example of a batch request and response that causes the error.

The body of the batch request was:

 --batch_b5280df9-a519-446b-91f8-ac6631cea626
 Content-Type: application/http; msgtype=request
 
 POST /v0.7/topics/3%00j%00e%00E%00a%00_%002%00P%00o%00B%00B%00/comments?null HTTP/1.1
 Host: ppe.embeddedsocial.microsoft.com
 Authorization: SocialPlus TK=....
 Content-Type: application/json
 Accept: application/json
 
 {"text":"xlMWN0tyZ0kz1KuOlw3NpcaelNgEztsWei0ZCYHEQS+DViAAWEfbX+qPYH+yuonZ"}
 
 --batch_b5280df9-a519-446b-91f8-ac6631cea626
 Content-Type: application/http; msgtype=request
 
 POST /v0.7/topics/3%00j%00e%00E%00a%00Y%002%00e%00z%00Y%00w%00/comments?null HTTP/1.1
 Host: ppe.embeddedsocial.microsoft.com
 Authorization: SocialPlus TK=....
 Content-Type: application/json
 Accept: application/json
 
 {"text":"a0faLxW3DTBFYFtc/iTb6AmrnVVadSTiyTCUNJDH8oj5TKAza7Bf88SGEWh562F7"}
 
 --batch_b5280df9-a519-446b-91f8-ac6631cea626--

The body of the batch response was:

 --15f52026-8dc0-4966-8ce7-cdc5f1fdf385
 Content-Type: application/http; msgtype=response
 
 HTTP/1.1 500 Internal Server Error
 Content-Type: application/json; charset=utf-8
 
 {
   "message": "An error has occurred.",
   "exceptionMessage": "'~/v0.7/topics/3\u0000j\u0000e\u0000E\u0000a\u0000_\u00002\u0000P\u0000o\u0000B\u0000B\u0000/comments' is not a valid virtual path.",
   "exceptionType": "System.Web.HttpException",
   "stackTrace": "   at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)\r\n   at System.Web.Hosting.MapPathBasedVirtualPathProvider.CacheLookupOrInsert(String virtualPath, Boolean isFile)\r\n   at System.Web.Routing.RouteCollection.IsRouteToExistingFile(HttpContextBase httpContext)\r\n   at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)\r\n   at System.Web.Http.WebHost.Routing.HostedHttpRouteCollection.GetRouteData(HttpRequestMessage request)\r\n   at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at WebApiThrottle.ThrottlingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at SocialPlus.Server.WebRoleCommon.App_Start.PerformanceLoggingMessageHandler.<>n__0(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at SocialPlus.Server.WebRoleCommon.App_Start.PerformanceLoggingMessageHandler.<SendAsync>d__3.MoveNext() in c:\\dev\\sp3\\code\\Server\\WebRoleCommon\\App_Start\\PerformanceLoggingMessageHandler.cs:line 99\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"
 }
 --15f52026-8dc0-4966-8ce7-cdc5f1fdf385
 Content-Type: application/http; msgtype=response
 
 HTTP/1.1 500 Internal Server Error
 Content-Type: application/json; charset=utf-8
 
 {
   "message": "An error has occurred.",
   "exceptionMessage": "'~/v0.7/topics/3\u0000j\u0000e\u0000E\u0000a\u0000Y\u00002\u0000e\u0000z\u0000Y\u0000w\u0000/comments' is not a valid virtual path.",
   "exceptionType": "System.Web.HttpException",
   "stackTrace": "   at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)\r\n   at System.Web.Hosting.MapPathBasedVirtualPathProvider.CacheLookupOrInsert(String virtualPath, Boolean isFile)\r\n   at System.Web.Routing.RouteCollection.IsRouteToExistingFile(HttpContextBase httpContext)\r\n   at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)\r\n   at System.Web.Http.WebHost.Routing.HostedHttpRouteCollection.GetRouteData(HttpRequestMessage request)\r\n   at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at WebApiThrottle.ThrottlingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at SocialPlus.Server.WebRoleCommon.App_Start.PerformanceLoggingMessageHandler.<>n__0(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at SocialPlus.Server.WebRoleCommon.App_Start.PerformanceLoggingMessageHandler.<SendAsync>d__3.MoveNext() in c:\\dev\\sp3\\code\\Server\\WebRoleCommon\\App_Start\\PerformanceLoggingMessageHandler.cs:line 99\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"
 }
 --15f52026-8dc0-4966-8ce7-cdc5f1fdf385--
@ssaroiu
Copy link
Member

ssaroiu commented May 8, 2018

Thank you Lily. We'll investigate.

@acrown-msft
Copy link
Member

Thanks for opening this issue. It led us to file 2 new bugs: #26 and #27. Once we address those, this issue should be resolved.

@tslilyai
Copy link
Contributor Author

tslilyai commented May 14, 2018

To reliably reproduce the 500 error, please issue the following curl request with the attached multipart.txt file:

curl -X POST --header 'Content-Type: multipart/mixed; boundary=batch_ebc' --data-binary @multipart.txt 'https://ppe.embeddedsocial.microsoft.com/batch'

multipart.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants