Db2 Connect

 View Only
Expand all | Collapse all

ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process + There are no context policies. Function: AESEncryptADONET (Encryption Info)

  • 1.  ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process + There are no context policies. Function: AESEncryptADONET (Encryption Info)

    Posted Wed January 05, 2022 01:25 PM
    Dear Community:

    We are wanting to deploy a Framework.net 5.0 web application with EntityFramework as a means of connection to an Informix database and on Windows Server 2019 IIS.

    An exception occurs when establishing the connection with the database:
    ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in  Process: 10188 Thread 6 AppDomain: Name:InvoicesFacilitator\r\nThere are no context policies. Function: AESEncryptADONET (Encryption Info)\n CallStack:    at System.Environment.get_StackTrace()\r\n   at IBM.Data.Db2.DB2ConnPool.HandleUnknownErrors(String strFncMsg, Exception exception, Boolean bThrow)\r\n   at IBM.Data.Db2.DB2ConnPool.EncryptString(String value)\r\n   at IBM.Data.Db2.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended)\r\n   at IBM.Data.Db2.DB2Connection.set_ConnectionString(String value)\r\n   at IBM.Data.Db2.DB2Connection..ctor(String connectionString)\r\n   at IBM.EntityFrameworkCore.Storage.Internal.Db2SqlConnection.CreateDbConnection()\r\n   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()\r\n   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetDbConnection(DatabaseFacade databaseFacade)\r\n   at BnkInvFnd.DataAccess.Repository.Data.TbaseContext.obtenerDatosSQL(String lsSQL) in E:\\_Documentos jbarbery\\Documentos\\07-Fuentes\\Proyectos en GIT\\BankInvoicesFinder\\BnkInvFnd.DataAccess\\Repository\\Data\\TbaseContext.cs:line 27\r\n   at BnkInvFnd.DataAccess.Repository.TbaseRepository.getInvoicesByCage(Int32 liCage, String lsNit, DateTime ldFechaInicio, DateTime ldFechaFin, UInt32 liPagina) in E:\\_Documentos jbarbery\\Documentos\\07-Fuentes\\Proyectos en GIT\\BankInvoicesFinder\\BnkInvFnd.DataAccess\\Repository\\TbaseRepository.cs:line 108\r\n   at BnkInvFnd.Services.Finder.buscarFacturas(UInt32 liPagina) in E:\\_Documentos jbarbery\\Documentos\\07-Fuentes\\Proyectos en GIT\\BankInvoicesFinder\\BnkInvFnd.Services\\Finder.cs:line 45\r\n   at InvoicesFacilitator.Controllers.InvoicesController.buscarFacturas(InSearchInvoices value) in E:\\_Documentos jbarbery\\Documentos\\07-Fuentes\\Proyectos en GIT\\BankInvoicesFinder\\InvoicesFacilitator\\Controllers\\InvoicesController.cs:line 60\r\n   at lambda_method2(Closure , Object , Object[] )\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)\r\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeAsync()\r\n   at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointFactory.<>c__DisplayClass7_0.<CreateRequestDelegate>b__0(HttpContext context)\r\n   at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)\r\n   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\r\n   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)\r\n   at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)\r\n   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\r\n   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\r\n   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<UseMiddleware>b__2(HttpContext context)\r\n   at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context)\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context)\r\n   at Microsoft.AspNetCore.HostFiltering.HostFilteringMiddleware.Invoke(HttpContext context)\r\n   at Microsoft.AspNetCore.Hosting.HostingApplication.ProcessRequestAsync(Context context)\r\n   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()\r\n   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest()\r\n   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest()\r\n   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.Execute()\r\n   at System.Threading.ThreadPoolWorkQueue.Dispatch()\r\n   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() InnerException Message: AESEncryptADONET - Encryption - no error information available Check InnerException property for more detail.  SQLSTATE=58005​

    We have tried to set the folder location "clidriver" and "clidriver / bin" in the Windows environment variables but have not been successful.

    We would appreciate guidance on this topic.

    Sincerely,

    JBV



    ------------------------------
    Jesus Barbery Vargas
    ------------------------------


  • 2.  RE: ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process + There are no context policies. Function: AESEncryptADONET (Encryption Info)

    Posted Mon January 24, 2022 05:43 AM
    Hi,
    You have to check db2diag.log to get more information maybe.

    There is some environmentvariable IT34929 to set maybe.

    Maybe a restore abended before.
    Can you check on db2 cmd line if you can connect to the database?
    There are other entries in the support database. One is the following refering to an unsuccessful restore


    here is the error messages information
    [db2inst1@cbd99799170d ~]$ db2 ? sql0902


    SQL0902C A system error occurred. Subsequent SQL statements cannot be
    processed. IBM software support reason code: "<reason-code>".

    Explanation:

    This message is returned when the database manager encounters a critical
    error, such as a severe operating system error, or an error accessing
    storage media, which might prevent a database from continuing to be
    usable. There are different scenarios in which the database manager
    might encounter an operating system error, or a severe media error. Here
    is one example of a scenario in which this message can be returned:

    * This message can be returned when a database manager resource
    requires a semaphore, but there are not enough semaphores to satisfy
    the request.

    The runtime token, "<reason-code>", might sometimes be empty,
    and is intended to assist IBM software support personnel only.

    User response:

    Respond to this message by performing the following troubleshooting
    steps:
    1. Review diagnostic information in db2diag log files to identify errors
    that occurred before this message was returned.

    2. If there are messages in the db2diag log files indicating that too
    many semaphores have been requested, or that there are not enough
    semaphores to serve the database manager requests, increase the
    number of semaphores using operating system parameters.

    If the error continues after performing the troubleshooting steps
    described, contact IBM software support for assistance:
    1. Collect diagnostic information using trace facilities such as the DB2
    trace and the Independent Trace Facility.

    2. Collect the following diagnostic information:

    * Problem description

    * SQLCODE

    * Reason "<reason>"

    * SQLCA contents if possible

    * Trace files, if possible

    3. Contact IBM software support.

    Federated system users: isolate the problem to the data source failing
    the request and take the necessary diagnostic steps for that data
    source. The problem determination procedures for data sources vary, so
    refer to the applicable data source manuals.

    sqlcode: -902

    sqlstate: 58005


    ----------------------------------
    Kind regards
    Joachim Stumpf

    ------------------------------
    joachim stumpf
    ------------------------------



  • 3.  RE: ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process + There are no context policies. Function: AESEncryptADONET (Encryption Info)

    Posted 11 days ago
    We faced the same issue on Windows Server 2019 after deploying .NET 6 API. We were able to resolve it after installing Microsoft Visual C++ 2013 Redistributable (only x64)

    ------------------------------
    Prabhdeep Singh
    ------------------------------