kawansoft / aceql-http

AceQL HTTP is a framework of REST like http APIs that allow to access to remote SQL databases over http from any device that supports http.
https://www.aceql.com
Other
97 stars 20 forks source link

407 Proxy Authentication Required #9

Closed santhosh250595 closed 4 years ago

santhosh250595 commented 4 years ago

Hello Team,

I'm trying to execute queries in AWS RDS instance with proxy authentication using aceql server hosted in a EC2 instance.

I'm successful in establishing connection to the database and some queries are giving responses back but sometimes i'm getting the below error. This happens only in systems where internet speed is slow. Is there a way to increase the response timeout for command execution or any suggestions to avoid this issue by changing any aceql sever properties. Please suggest.

something wrong during query Execution errorType: 0 / reason: An error occurred while sending the request. / httpStatusCode: OK / exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at AceQL.Client.Api.Http.AceQLHttpApi.d46.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 AceQL.Client.Api.Http.AceQLHttpApi.d51.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 AceQL.Client.Api.AceQLCommand.d__20.MoveNext()

ndepomereu commented 4 years ago

Hi,

This is not an error: System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.

It means the server asks for proxy Credentials, those provided were invalid.

Are you sure the user passed the correct values for the proxy Credentials.in the connection string?: "Server= https://www.acme.com:9443/aceql; Database = myDataBase; Username= myUsername; Password = myPassword; ProxyUsername=MyProxyUser; ProxyPassword=MyProxyPassword"

If you get this error low Internet speed and the proxy credentials are valid, this is weird, I don't know the reason.

But you can try to raise the default 100,000 milliseconds timeout by specifying an explicit Timeout in connection string, say 300 seconds for example:

"Server= https://www.acme.com:9443/aceql; Database = myDataBase; Username= myUsername; Password = myPassword; ProxyUsername=MyProxyUser; ProxyPassword=MyProxyPassword;Timeout=3000000"

santhosh250595 commented 4 years ago

Hi,

This is not an error: System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.

It means the server asks for proxy Credentials, those provided were invalid.

Are you sure the user passed the correct values for the proxy Credentials.in the connection string?: "Server= https://www.acme.com:9443/aceql; Database = myDataBase; Username= myUsername; Password = myPassword; ProxyUsername=MyProxyUser; ProxyPassword=MyProxyPassword"

If you get this error low Internet speed and the proxy credentials are valid, this is weird, I don't know the reason.

But you can try to raise the default 100,000 milliseconds timeout by specifying an explicit Timeout in connection string, say 300 seconds for example:

"Server= https://www.acme.com:9443/aceql; Database = myDataBase; Username= myUsername; Password = myPassword; ProxyUsername=MyProxyUser; ProxyPassword=MyProxyPassword;Timeout=3000000"

The credentials are correct and it works very fine for minimal query calls.

I have tried increasing the timeout to 1000 seconds but it didn't help. Is there anything like command.timeout option which can wait for responses

ndepomereu commented 4 years ago

I will make some tests today and come back to you later. Meanwhile, could you please gather any specific info technical on the proxy that could explain this behavior? (Reset done by the proxy on long queries, ...)

ndepomereu commented 4 years ago

We have found how to fix the Proxy Authentication Required issue. We have to update the C# code and will publish a new version This Monday, July 13. (This is a C# client-side problem, it's independent of server-side and independent of proxy in use).

ndepomereu commented 4 years ago

The Proxy Authentication Required issue is fixed in C# SDK version 5.0.1. See C# release notes for technical info, but there is nothing to change in C# applications that use the AceQL C# SDK.

santhosh250595 commented 4 years ago

thanks it works fine :)