Issue Details (XML | Word | Printable)

Key: DNET-716
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Anton Kasyanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

Connection to Firebird throws NullReferenceException on mono

Created: 11/Nov/16 09:12 AM   Updated: 15/Nov/16 06:58 AM
Component/s: ADO.NET Provider
Affects Version/s: 5.6.0.0
Fix Version/s: 5.7.0.0

Environment: kubuntu 16.04 x64 + mono 4.6.1 + FirebirdSQL ADO.NET driver 5.6.0.0


 Description  « Hide
An attempt to connect to the Firebird databse results in an NullReferenceException with the following stacktrace:

  at System.Text.Encoding.GetBytes (System.String s) [0x00015] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
  at FirebirdSql.Data.Client.Managed.GdsConnection.UserIdentificationData () [0x00141] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.Client.Managed.GdsConnection.Identify (System.String database) [0x00044] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateManagedDatabase (FirebirdSql.Data.FirebirdClient.FbConnectionString options) [0x00042] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase (FirebirdSql.Data.FirebirdClient.FbConnectionString options) [0x00010] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect () [0x0001e] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager+Pool.CreateNewConnection (FirebirdSql.Data.FirebirdClient.FbConnectionString connectionString) [0x00006] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager+Pool.CreateNewConnectionIfPossibleImpl (FirebirdSql.Data.FirebirdClient.FbConnectionString connectionString) [0x00020] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager+Pool.GetConnection (FirebirdSql.Data.FirebirdClient.FbConnection owner) [0x00024] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnectionPoolManager.Get (FirebirdSql.Data.FirebirdClient.FbConnectionString connectionString, FirebirdSql.Data.FirebirdClient.FbConnection owner) [0x00035] in <1c49352b896a4a9dba73865ddab7b59e>:0
  at FirebirdSql.Data.FirebirdClient.FbConnection.Open () [0x00086] in <1c49352b896a4a9dba73865ddab7b59e>:0

The exception is thrown at the line

private byte[] UserIdentificationData()
{
...
  var user = Encoding.UTF8.GetBytes(Environment.GetEnvironmentVariable("USERNAME"));
...
}

of the class FirebirdSql.Data.Client.Managed.GdsConnection

Earlier this method used Environment.UserName in this line, however this was changed by the commit https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/commit/7e1e4a1e1eb362c2c96a141a51952b23c9970f79

The USERNAME environment variable is not set in linux bu default. Setting it hides the issue and can be considered as a workaround.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.