Skip to main content
Question

Vertica Client Driver for ADO.Net throws System.NullReferenceException exception from OData service

  • Dec 17, 2019 1:34 PM UTC
  • 9 replies
  • 42 views

rjayabalan

I have a OData service hosted on Microsoft Azure App Service. In the service, I am using Vertica Client Driver for ADO.Net to connect to Vertica database. When the code tries to open a connection to Vertica database using type VerticaConnection, it throws the following exception. From this exception stack is is clear that the Vertica client library Vertica.Data.dll version 7.2.3.0 throws exception at method GetOSVersion.

System.NullReferenceException: Object reference not set to an instance of an object.
at Vertica.Data.Internal.IO.ProtocolStream.GetOSVersion (Vertica.Data, Version=7.2.3.0, Culture=neutral, PublicKeyToken=725728a8837b3bd5)
at Vertica.Data.Internal.IO.ProtocolStream.Startup (Vertica.Data, Version=7.2.3.0, Culture=neutral, PublicKeyToken=725728a8837b3bd5)
at Vertica.Data.Internal.IO.ProtocolStream.InitSession (Vertica.Data, Version=7.2.3.0, Culture=neutral, PublicKeyToken=725728a8837b3bd5)
at Vertica.Data.Internal.Core.VConnection.Connect (Vertica.Data, Version=7.2.3.0, Culture=neutral, PublicKeyToken=725728a8837b3bd5)

at Vertica.Data.Internal.ADO.Net.SConnection.Open (Vertica.Data, Version=7.2.3.0, Culture=neutral, PublicKeyToken=725728a8837b3bd5)

9 replies

siddyash
Forum|alt.badge.img
  • Participating Frequently
  • Dec 18, 2019 8:08 PM UTC

Question? What version of Vertica database are you trying to connect?


rjayabalan
  • Author
  • Participating Frequently
  • Dec 19, 2019 5:24 AM UTC

The Vertica database version is 9.2.1.
Note: The same code base is able to connect to Vertica database when executed locally on Windows 10 machine. The issue arises only when I deploy to Microsoft Azure App Service. May be, it is something that got to do with OS.


rjayabalan
  • Author
  • Participating Frequently
  • Dec 23, 2019 5:35 AM UTC

Hi @siddyash
I believe, I had provided the details you asked for. Do you need any further details?


rjayabalan
  • Author
  • Participating Frequently
  • Dec 24, 2019 6:30 AM UTC

Hi @siddyash

FYI. From KUDU, I extracted the following information on OS and IIS

OS version: Microsoft Windows NT 10.0.14393.0

Microsoft-IIS/10.0

Does it mean, Vertica Driver for Ado.Net is not supported on OS Microsoft Windows NT 10.0.14393.0 ?


rjayabalan
  • Author
  • Participating Frequently
  • Dec 24, 2019 7:45 AM UTC

Hi @siddyash
This may due to Vertica.Data.dll written for .Net Framework v 4.6.1.
I have written my OData using .Net Core 2.1 and .Net Std 2.0
Do you have Vertica.Data.dll assembly for .Net Std 2.0 or higher?


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • Dec 24, 2019 1:52 PM UTC

@rjayabalan : It looks like a bug to me and we had similar bugs in past for 8.x vertica version. Please open a support case. we can work and file a bug accordingly.


rjayabalan
  • Author
  • Participating Frequently
  • Dec 30, 2019 6:53 AM UTC

Hi @SruthiA
I will create support ticket with Vertica soon. By the way, I converted my code from .Net Core/Std to .Net Fx 4.7.2 as well. Still, it is not working.


saxenam
  • Participating Frequently
  • Dec 31, 2019 5:39 AM UTC

@rjayabalan I have checked and found that you are using Vertica Server 9.2.1! Can you please update about the client driver version as well?


rjayabalan
  • Author
  • Participating Frequently
  • Dec 31, 2019 1:51 PM UTC

Hi @saxenam
You are correct. I was using Vertica.Data nuget packages. The package has Vertica.Data.dll v 7.2.3.0. After manually referring to Vertica.Data.dll assembly v 9.2.1, it is working now. Thank you @saxenam .