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

System.UriFormatException: Invalid URI: The Uri string is too long #5

Open
santhosh250595 opened this issue Sep 8, 2020 · 3 comments

Comments

@santhosh250595
Copy link

Hi,
Hope you are doing good.

I'm getting the below exception when my query has json data with length of 338525. Is there any alternate way to execute this.

something wrong during query Execution
errorType: 0 / reason: Invalid URI: The Uri string is too long. / httpStatusCode: OK / exception: System.UriFormatException: Invalid URI: The Uri string is too long.
at System.UriHelper.EscapeString(String input, Int32 start, Int32 end, Char[] dest, Int32& destPos, Boolean isUriString, Char force1, Char force2, Char rsvd)
at System.Uri.EscapeDataString(String stringToEscape)
at System.Net.Http.FormUrlEncodedContent.Encode(String data)
at System.Net.Http.FormUrlEncodedContent.GetContentByteArray(IEnumerable1 nameValueCollection) at System.Net.Http.FormUrlEncodedContent..ctor(IEnumerable1 nameValueCollection)
at AceQL.Client.Src.Api.Http.HttpManager.d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at AceQL.Client.Api.Http.AceQLHttpApi.<ExecuteQueryAsync>d__48.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at AceQL.Client.Api.AceQLCommand.d__17.MoveNext()

@ndepomereu
Copy link
Member

ndepomereu commented Sep 8, 2020

Hi Santosh,

First reaction would be to say "Why would you need such a huge input query?", but I know this is not a very fertile answer. ;-)

Can you please explain what is your query content (insert, update, select) so that I understand the need? And why it is so huge?
A concrete sample/example would be appreciated.
Then I can evaluate what to do do.
(For now input query is buffer, which per nature is limited by the HTTP stack in use and that we don't control very much. Maybe we can change the buffer to a file...)

@santhosh250595
Copy link
Author

santhosh250595 commented Sep 9, 2020

Hi,
So my query is in the below format "select * from dbo.functionname(parameter1, parmeter2,..parameter10);". In that one of the parameter is a text containing html content of length 338525.

insert into dbo.tablename values(param1, jsonparam2) -> json param2 is of type text length 338525 also gives same Uri exception.

@ndepomereu
Copy link
Member

Hi,
I have no immediate solution.
This would be a new development with a multipart request (file upload) and would impact both server and client SDK side.
Please let me think about it.

@ndepomereu ndepomereu transferred this issue from kawansoft/AceQL.Client Nov 14, 2020
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