Value cannot be null. Parameter name: hostNameOrAddress

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
SebastianTusk
Posts: 4
Joined: Fri 23 Oct 2020 15:08

Value cannot be null. Parameter name: hostNameOrAddress

Post by SebastianTusk » Fri 23 Oct 2020 15:22

Can't solve this issue with a simple DB connection. Exception and Code below.
It is not the same issue as in the "Possible regression: Value cannot be null. (Parameter 'hostname')" topic. My problem occurs with older versions like 9.11.980 and with 9.13.1107 and also with SID instead of ServiceName.
Any Ideas?

Code: Select all

Exception thrown: 'System.ArgumentNullException' in Devart.Data.Oracle.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>ServerManagement.exe</AppDomain><Exception><ExceptionType>System.ArgumentNullException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Value cannot be null.
Parameter name: hostNameOrAddress</Message><StackTrace>   at Devart.Data.Oracle.bw.a(List`1 A_0, SshOptions A_1, SslOptions A_2, Boolean A_3)
   at Devart.Data.Oracle.cr.a(d4 A_0, Boolean A_1)
   at Devart.Data.Oracle.cr.a(d4 A_0, b0 A_1)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(d4 connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.ef.a(aa A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, aa A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at ServerManagement.SnpData.BuildSnpTexData() in C:\Users\tusk\Documents\dev\AVATARS\ServerManagement\SnpData.cs:line 25
   at ServerManagement.Program.Main(String[] args) in C:\Users\tusk\Documents\dev\AVATARS\ServerManagement\Program.cs:line 23</StackTrace><ExceptionString>System.ArgumentNullException: Value cannot be null.

Code: Select all

OracleConnectionStringBuilder oraCSB = new OracleConnectionStringBuilder();
oraCSB.Direct = true;
oraCSB.Server = "<hostname>";
oraCSB.Port = 1521;
oraCSB.ServiceName = "<service name>";
oraCSB.UserId = "<user>";
oraCSB.Password = "<password>";
oraCSB.Pooling = true;
OracleConnection myConnection = new OracleConnection(oraCSB.ConnectionString);
myConnection.Open();

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Value cannot be null. Parameter name: hostNameOrAddress

Post by Shalex » Sat 24 Oct 2020 15:33

1. Does the issue persist with https://download.devart.com/nuget_oracle_9_13_1112.zip?

2. Are you connecting to RAC or a single Oracle instance?

SebastianTusk
Posts: 4
Joined: Fri 23 Oct 2020 15:08

Re: Value cannot be null. Parameter name: hostNameOrAddress

Post by SebastianTusk » Mon 26 Oct 2020 17:03

Hi,
I didn't try nuget_oracle_9_13_1112.zip because we found another solution. With an installed Dotconnect this problem occurs. After deinstallation the issue vanishes. As validation we reinstalled Dotconnect and the problem reappears.

For now we can use this workaround.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Value cannot be null. Parameter name: hostNameOrAddress

Post by Shalex » Fri 30 Oct 2020 16:09

1. The bug with connecting to Oracle Real Application Clusters (RAC) in the Direct mode is fixed in the new public build v9.13.1127. Does it fix the issue you have encountered?

2. Are you connecting to RAC or a single Oracle instance?

Post Reply