Page 1 of 1

Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Tue 19 May 2015 14:47
by dmontalvo
Hello,

I moved from 6.2.122.0 to my last licensed version 6.8.333 and start getting connection error using the same code base, only replaced the devart components.

The code that I am trying to exceute is, which was working with previous version:

Code: Select all

    try {
        String ConnectionString="User Id=pgsqluser;Host=127.0.0.1;Port=5434;Database=\"Master Database\";Password=???????"
        PgSqlConnection SqlConnection = new PgSqlConnection(ConnectionString);
        SqlConnection.Open();
    } catch (Exception ex) {
    }
getting the following exception when invoking the Open(() method:
Devart.Data.PostgreSql.PgSqlException: "An invalid argument was supplied"

This is the StackTrace:
at Devart.Data.PostgreSql.v.y()
at Devart.Data.PostgreSql.v.b()
at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.PostgreSql.PgSqlConnection.Open()
at DataDeletion.Data.LINQConnection.OpenConnection() in
LINQConnection.cs:line 166

The underlaying System.Data.Common.DbException CallStack says the following:
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at System.Net.Sockets.TcpClient.initialize()
at System.Net.Sockets.TcpClient..ctor(AddressFamily family)
at Devart.Common.p..ctor(String A_0, Int32 A_1, Int32 A_2)
at Devart.Data.PostgreSql.x..ctor(String A_0, Int32 A_1, Encoding A_2, Int32 A_3, SslOptions A_4, ProxyOptions A_5)
at Devart.Data.PostgreSql.al.a(String A_0, Int32 A_1, Int32 A_2, String A_3, String A_4, String A_5, Boolean A_6, SslOptions A_7, ProxyOptions A_8)
at Devart.Data.PostgreSql.v.y()


I want to stress the point that this same code was working with version 6.2.122. It stop working when upgrading the Devart components

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Tue 19 May 2015 16:46
by Pinturiccio
We could not reproduce the issue. Please provide us the following for reproducing the issue:
1. PostgreSQL version;
2. Is the issue reproduced with the latest version of dotConnect for PostgreSQL? You can download the latest trial version of dotConnect for PostgreSQL from our site http://www.devart.com/dotconnect/postgr ... nload.html;
3. Have you changed your network settings? Is it the same database?
4. Have you created this database with quotes in its name?

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Tue 19 May 2015 21:42
by dmontalvo
We could not reproduce the issue. Please provide us the following for reproducing the issue:
1. PostgreSQL version;
9.1

2. Is the issue reproduced with the latest version of dotConnect for PostgreSQL? You can download the latest trial version of dotConnect for PostgreSQL from our site http://www.devart.com/dotconnect/postgr ... nload.html;
Haven't tried latest version since the one I am testing is the latest one I have a license for

3. Have you changed your network settings? Is it the same database?
Same network settings. Same database

4. Have you created this database with quotes in its name?
Yes. But I have used quotes since the previos version and in that version the connection didn't failed

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Wed 20 May 2015 14:19
by Pinturiccio
Please try connecting to other database with a name without quotes, for example database postgres. Is the connection established successfully?

We also need to find out the reason of the "An invalid argument was supplied" error. It looks like a socket error. In order to find out the reason, we need to get the internal SocketException in the debugger. We need the SocketException.ErrorCode value for more detailed analysis. Please perform the following steps in order to get this value:
1. Run a Visual Studio instance;
2. In the open Visual Studio instance on the Debug menu, click 'Options and Settings...';
3. In the Options dialog box switch to the Debugging->General page, and clear the 'Enable Just My Code (Managed only)' check box, if it is selected;
4. On the Debug menu, click Exceptions and select the 'Common Language Runtime Exceptions' check box;
5. Debug your application and get the SocketException;
6. Send us the value of the SocketException.ErrorCode property.

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Wed 20 May 2015 14:43
by dmontalvo
I tried to connect to postgres database and the same error occured.

The SocketException ErrorCode is 10022.

Thanks.

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Thu 21 May 2015 12:34
by Pinturiccio
dmontalvo wrote:Haven't tried latest version since the one I am testing is the latest one I have a license for
You can download the latest trial version of dotConnect for PostgreSQL from our site http://www.devart.com/dotconnect/postgr ... nload.html. The trial version can be used for 30 days.

1) We have studied the code differences between 6.2.122 and 6.8.333, and there is the same code in the place, where the error occurs; no changes were made to this code.
2) Which application type do you develop - a Windows Forms Application or Web Forms Application or another one?
3) Probably you don't have enough privileges. Please try running the application with administrative privileges;
4) Please execute the following code in your application:

Code: Select all

TcpClient tcpClient;
IPAddress ipAddress;
if (IPAddress.TryParse("127.0.0.1", out ipAddress))
   tcpClient = new TcpClient(ipAddress.AddressFamily);
Does this code can be executed without errors?

A similar issue is discussed here:
http://stackoverflow.com/questions/14819089
https://social.msdn.microsoft.com/Forum ... arpgeneral

Do proposed solutions help you to solve the issue?

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Tue 26 May 2015 15:52
by dmontalvo
2) Which application type do you develop - a Windows Forms Application or Web Forms Application or another one?
It is a WPF application.

3) Probably you don't have enough privileges. Please try running the application with administrative privileges;
Visual Studio is run with administrative privileges

4) Please execute the following code in your application:

Code: Select all
TcpClient tcpClient;
IPAddress ipAddress;
if (IPAddress.TryParse("127.0.0.1", out ipAddress))
tcpClient = new TcpClient(ipAddress.AddressFamily);

Does this code can be executed without errors?
No. It throws the same Exception "Invalid argument was supplied"

A similar issue is discussed here:
http://stackoverflow.com/questions/14819089
https://social.msdn.microsoft.com/Forum ... arpgeneral

Do proposed solutions help you to solve the issue?
No
I would like to add that the code is under source control in ClearCase, but that always has been the case.

If I créate a new solution, then the code runs wihout problems.
try {
String ConnectionString="User Id=pgsqluser;Host=127.0.0.1;Port=5434;Database=\"Master Database\";Password=???????"
PgSqlConnection SqlConnection = new PgSqlConnection(ConnectionString);
SqlConnection.Open();
} catch (Exception ex) {
}

So I guess it has something to do with ClearCase.

Re: Getting an Devart.Data.PostgreSql.PgSqlException after upgrading from version 6.2.122.0 to 6.8.333

Posted: Tue 26 May 2015 16:25
by Pinturiccio
dmontalvo wrote:Does this code can be executed without errors?
No. It throws the same Exception "Invalid argument was supplied"
Unfortunately we can't help you in this situation. In your environment a TcpClient can't be created and this issue is not related to dotConnect for PostgreSQL. This is an uncommon issue, and noone contacted us with a similar issue. We cannot reproduce it.