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

Batch operation results in 'Error parsing HTTP message header byte 101 of message System.Byte[].' #19

Closed
troygNZ opened this issue Nov 23, 2020 · 8 comments

Comments

@troygNZ
Copy link

troygNZ commented Nov 23, 2020

When calling an endpoint that contains a non 200 response for one of the calls, I get back
Error parsing HTTP message header byte 101 of message System.Byte[].

Note, not for all calls.

at System.Net.Http.HttpContentMessageExtensions.<ReadAsHttpResponseMessageAsyncCore>d__19.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at ODataHttpClient.ODataClient.<ParseMultiAsync>d__18.MoveNext()

Quite possibly similar to the problem seen here
https://forums.asp.net/t/2037342.aspx?Max+header+size+when+serializing+HttpMessageContent

Note, this is for an OData 2.0 endpoint.

@iwate iwate self-assigned this Mar 23, 2021
@iwate
Copy link
Owner

iwate commented Mar 23, 2021

@troygNZ Thankyou for your bug report.
But I cannot figure it out the cause. I need more detail.
Would you paste the response full body?

@troygNZ
Copy link
Author

troygNZ commented Mar 23, 2021

Thanks @iwate

Response example

Content-Type: application/json
Content-Length: 118
location: 
dataserviceversion: 2.0

{"error":{"code":"","message":{"lang":"en","value":"E-mail address blah;;blah.coom isn't valid. Please check."}}}

Request example, with some sensitive data etc removed or adjusted

accept: multipart/mixed, application/json
authorization:                                   
request-context: appId=
request-id: 
traceparent: 
cookie: 
content-type: multipart/mixed; boundary="batcha5fc0546-bfb4-4f27-8d02-b7f3cb942604"
content-length: 1454
x-akamai-config-log-detail: true
te: chunked;q=1.0
connection: TE
accept-encoding: gzip
akamai-origin-hop: 1
via: 1.1 akamai.net(ghost) (AkamaiGHost)
x-forwarded-for: 
true-client-ip: 
host: 
pragma: no-cache
cache-control: no-cache, max-age=0
connection: keep-alive
debug-edgeserver-ip: 
x-sap-webdisp-target-group-no-redispatch: ODATA_LOAD
sap-web-dispatcher: version=7.81.0
clientprotocol: https
ssl_cipher_usekeysize: 
ssl_cipher_suite: 

--batcha5fc0546-bfb4-4f27-8d02-b7f3cb942604
content-type: multipart/mixed; boundary="changeset55e5e03c-c544-4952-9402-03e3f2fcc1f5"

--changeset55e5e03c-c544-4952-9402-03e3f2fcc1f5
content-type: application/http
content-transfer-encoding: binary

PATCH /sap/c4c/odata/v1/c4codataapi/ContactCollection('XXXXXXXXXXXXXXXXXXX') HTTP/1.1
Host: 
Accept: application/json, application/octet-stream, text/plain
Content-ID: 1
Content-Type: application/json; charset=utf-8

{"AccountID":"111111","LastName":"Aaaaa","FirstName":"CP1","TitleCode":null,"NickName":"","BirthName":"","Email":"blah;;blah.coom","ZCH_WebSite_KUT":null,"Mobile":"(0064) 211-123456","Phone":null,"ZCH_AfterHoursContact_KUT":null,"Fax":null}
--changeset55e5e03c-c544-4952-9402-03e3f2fcc1f5
content-type: application/http
content-transfer-encoding: binary

POST /sap/c4c/odata/v1/c4codataapi/ContactCollection HTTP/1.1
Host:
Accept: application/json, application/octet-stream, text/plain
Content-ID: 2
Content-Type: application/json; charset=utf-8

{"AccountID":"1321643","LastName":"Aaaaa","FirstName":"CP2","TitleCode":null,"NickName":"","BirthName":"","Email":"hello@world.com","ZCH_WebSite_KUT":null,"Mobile":null,"Phone":null,"ZCH_AfterHoursContact_KUT":null,"Fax":null}
--changeset55e5e03c-c544-4952-9402-03e3f2fcc1f5--

--batcha5fc0546-bfb4-4f27-8d02-b7f3cb942604--

@iwate
Copy link
Owner

iwate commented Mar 24, 2021

@troygNZ thanks! I check it out.

@iwate
Copy link
Owner

iwate commented Mar 24, 2021

memo:
dotnet/runtime#27218

@iwate
Copy link
Owner

iwate commented Mar 24, 2021

@troygNZ Could you check line break code of the response? It need to be CRLF(0x0d0x0a)

@troygNZ
Copy link
Author

troygNZ commented Mar 24, 2021

Thanks @iwate - I'll check this in the morning. The payload and response I obtained for you was from the OData monitoring tool within SAP C4C, so may not preserve it within the browser monitoring tool. I'll debug and reproduce in the IDE to ensure no tampering of response.

@iwate iwate removed their assignment Feb 17, 2022
@iwate iwate closed this as completed Dec 6, 2022
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

2 participants