We have the .Net 5 c# container lambda function hosted in Lambda. To connect to on-premise DB2, we are using IBM.Data.DB2.Core-lnx 5.0.0.400 NuGet. We have created a deployment image/package and referenced it to Lambda. Required DLLs for IBM DB2 is part of the deployment packages/image.
While connecting to DB2 calls we are getting the following error:
{
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'db2app64.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdb2app64.dll: cannot open shared object file: No such file or directory",
"stackTrace": [
"at IBM.Data.Db2.UnsafeNativeMethods.DB232.SQLFreeConnAttribsADONET(DB2SQLGetConnAttribsADONETParams& pParam)",
"at IBM.Data.Db2.ConnSettingsFromXmlConfig.Dispose(Boolean disposing)",
"at IBM.Data.Db2.ConnSettingsFromXmlConfig.Dispose()",
"at IBM.Data.Db2.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended)",
"at IBM.Data.Db2.DB2Connection.set_ConnectionString(String value)",
"at IBM.Data.Db2.DB2Connection..ctor(String connectionString)",
"at IBM.EntityFrameworkCore.Storage.Internal.Db2SqlConnection.CreateDbConnection()",
"at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()",
"at IBM.EntityFrameworkCore.Storage.Db2RelationalCommand.CreateDbCommand(RelationalCommandParameterObject parameterObject, Guid commandId, DbCommandMethod commandMethod)",
"at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)",
"at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(DbContext _, Boolean result)",
"at Microsoft.EntityFrameworkCore.Storage.NonRetryingExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)",
"at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()",
"at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)",
"at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)",
"at mlpv2.db2.lambda.func.DB2Function.GetRecords(DB2Context dB2Context, ILambdaContext lambdaContext) in /src/DB2Function.cs:line 47",
"at mlpv2.db2.lambda.func.DB2Function.DB2FunctionHandler(String input, ILambdaContext context) in /src/DB2Function.cs:line 24",
"at lambda_method1(Closure , Stream , ILambdaContext , Stream )",
"at Amazon.Lambda.RuntimeSupport.Bootstrap.UserCodeLoader.Invoke(Stream lambdaData, ILambdaContext lambdaContext, Stream outStream) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/UserCodeLoader.cs:line 139",
"at Amazon.Lambda.RuntimeSupport.HandlerWrapper.<>c__DisplayClass8_0.<GetHandlerWrapper>b__0(InvocationRequest invocation) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/HandlerWrapper.cs:line 56",
"at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs:line 151"
]
}
Can anyone shed light on this issue?
------------------------------
Thanks,
Gajendran Muthuraj
------------------------------
#DataManagementGlobal#DataServerDrivers