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

Connection to Firebird throws NullReferenceException on mono [DNET716] #665

Closed
firebird-automations opened this issue Nov 11, 2016 · 2 comments

Comments

@firebird-automations
Copy link

Submitted by: Anton Kasyanov (phrynohyas)

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 cincuranet/FirebirdSql.Data.FirebirdClient@7e1e4a1

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

Commits: 722e3d8

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: vNext [ 10790 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants