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

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 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=, Culture=neutral, PublicKeyToken=725728a8837b3bd5)
at Vertica.Data.Internal.IO.ProtocolStream.Startup (Vertica.Data, Version=, Culture=neutral, PublicKeyToken=725728a8837b3bd5)
at Vertica.Data.Internal.IO.ProtocolStream.InitSession (Vertica.Data, Version=, Culture=neutral, PublicKeyToken=725728a8837b3bd5)
at Vertica.Data.Internal.Core.VConnection.Connect (Vertica.Data, Version=, Culture=neutral, PublicKeyToken=725728a8837b3bd5)

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

Best Answer

  • saxenamsaxenam Vertica Employee Employee
    Answer ✓

    @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?


  • siddyashsiddyash Vertica Employee Employee

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

  • rjayabalanrjayabalan Vertica Customer

    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.

  • rjayabalanrjayabalan Vertica Customer

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

  • rjayabalanrjayabalan Vertica Customer

    Hi @siddyash

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

    OS version: Microsoft Windows NT 10.0.14393.0


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

  • rjayabalanrjayabalan Vertica Customer

    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?

  • SruthiASruthiA Vertica Employee Administrator

    @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.

  • rjayabalanrjayabalan Vertica Customer

    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.

  • rjayabalanrjayabalan Vertica Customer

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

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file