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

Using OpenTelemetry instrumentation and setting EnableSqlIdTracing = true causes errors when working with refcursor output of a packaged procedure #416

Open
omon77 opened this issue Oct 9, 2024 · 9 comments
Labels

Comments

@omon77
Copy link

omon77 commented Oct 9, 2024

While using Oracle.ManagedDataAccess.Core v23.5.1 and v23.6.0 (not sure about prior versions), and wiring up OpenTelemetry via Oracle Data Provider Instrumentation, setting EnableSqlIdTracing to true

tracing.AddOracleDataProviderInstrumentation(opt =>
{ 
    opt.EnableSqlIdTracing = true;
   .....
});

causes Oracle exception to be thrown when reading refcursor returned by a packaged procedure.

@alexkeh
Copy link
Member

alexkeh commented Oct 9, 2024

Can you turn on ODP.NET tracing and share the trace?

@omon77
Copy link
Author

omon77 commented Oct 9, 2024

@alexkeh , can I provide it via email ?

@alexkeh
Copy link
Member

alexkeh commented Oct 9, 2024

Yes, you can send it to dotnet_us(at)oracle.com.

@omon77
Copy link
Author

omon77 commented Oct 9, 2024

Traces sent.

@alexkeh alexkeh added the bug label Oct 10, 2024
@alexkeh
Copy link
Member

alexkeh commented Oct 10, 2024

Thanks @omon77 for reporting this issue. I was able to reproduce your findings with the test case. I've filed a bug (37160309) and will have the ODP.NET dev team review the issue to identify the root cause.

@omon77
Copy link
Author

omon77 commented Oct 10, 2024

Thank you @alexkeh !

@andrevlins
Copy link

Hello, I'm having problems when I use EnableSqlIdTracing = true with some queries as well. One of the cases is when there is a BLOB type column in the query return.

I think this problem is related to this issue.

query (column NOMEARQUIVO has type BLOB):

SELECT
    ADA.CODANEXO,
    ADA.TIPODOCUMENTOANEXO,
    ADA.ANEXADOEM,
    ADA.ARQUIVO,
    ADA.NOMEARQUIVO,
    ADA.EXTENSAOARQUIVO
FROM ADM$DOCUMENTOANEXO ADA
WHERE CODPACIENTE = :CodPaciente
AND ADA.DELETADO = 0

exception:

  at OracleInternal.TTC.TTCExecuteSql.<ReceiveExecuteResponseAsync>d__103.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   at OracleInternal.ServiceObjects.OracleDataReaderImpl.<FetchMoreRowsAsync>d__116.MoveNext()
   at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   at Oracle.ManagedDataAccess.Client.OracleDataReader.<ReadInternalAsync>d__368.MoveNext()
   at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
   at Oracle.ManagedDataAccess.Client.OracleDataReader.<ReadAsyncHelper>d__338.MoveNext()
   at Dapper.SqlMapper.<QueryAsync>d__33`1.MoveNext()
   at Program.<>c.<<<Main>$>b__0_0>d.MoveNext() in D:\source\AspireApp13\AspireApp13.ApiService\Program.cs:line 28
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.<<ExecuteTaskOfT>g__ExecuteAwaited|132_0>d`1.MoveNext()
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<<Invoke>g__Awaited|10_0>d.MoveNext()

@alexkeh
Copy link
Member

alexkeh commented Dec 3, 2024

@andrevlins Your issue could be a separate one. The exception reported in the original issue is the following:

2024-10-10 13:31:12.695071 TID:1 (PRI) (TTC) (ERR) (CID1) OracleException.HandleError() from TTCExecuteSql.Process_RPA_Message()(txnid=n/a) System.Exception: TTC Error at OracleInternal.TTC.OraBufReader.ReadLengthAndData(Byte repOffset, Byte typeRep, Boolean bAsync, Boolean IgnoreData) at OracleInternal.TTC.MarshallingEngine.BufferToValue(Byte repOffset, Boolean bAsync, Boolean bIgnoreData) at OracleInternal.TTC.MarshallingEngine.UnmarshalUB2(Boolean bAsync, Boolean bIgnoreData) at OracleInternal.TTC.TTCExecuteSql.Process_RPA_Message(Int64[] scnFromExecution, SqlStatementType statementType, Int32 arrayBindCount, RER_RefAndOutParamArgCtx refOutArgCtx, Boolean bReadSqlId, Boolean bAsync)

That's different from your issue. Can you share a trace from the ODP.NET app? That will tell us more details about what is generating the error.

@andrevlins
Copy link

@alexkeh here are the traces

traces.zip

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

No branches or pull requests

3 participants