Skip to content

FirebirdSql.Data.FirebirdClient.FbException (0x80004005): invalid request handle ---> FirebirdSql.Data.Common.IscException: invalid request handle #965

Closed as not planned

Description

@oshinyil

Hi,

I got error FirebirdSql.Data.FirebirdClient.FbException (0x80004005) in FirebirdSql.EntityFrameworkCore.Firebird version 7.10.1. I couldn't reproduce it, but this happened in production.

FirebirdSql.Data.FirebirdClient.FbException (0x80004005): invalid request handle ---> FirebirdSql.Data.Common.IscException: invalid request handle
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse response)
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse[TResponse]()
   at FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.Rollback()
   at FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.Dispose()
   at FirebirdSql.Data.FirebirdClient.FbTransaction.Dispose(Boolean disposing)
   at FirebirdSql.Data.FirebirdClient.FbTransaction.Dispose(Boolean disposing)
   at FirebirdSql.Data.FirebirdClient.FbCommand.RollbackImplicitTransaction()
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<InitializeReaderAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<MoveNextAsync>d__17.MoveNext() 
FirebirdSql.Data.FirebirdClient.FbException (0x80004005): invalid transaction handle (expecting explicit transaction start) ---> FirebirdSql.Data.Common.IscException: invalid transaction handle (expecting explicit transaction start)
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse response)
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse[TResponse]()
   at FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.BeginTransaction(TransactionParameterBuffer tpb)
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.BeginTransaction(TransactionParameterBuffer tpb)
   at FirebirdSql.Data.FirebirdClient.FbTransaction.BeginTransaction()
   at FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<InitializeReaderAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<MoveNextAsync>d__17.MoveNext() 
FirebirdSql.Data.FirebirdClient.FbException (0x80004005): SQLDA error ---> FirebirdSql.Data.Common.IscException: SQLDA error
   at FirebirdSql.Data.Client.Managed.Version10.GdsStatement.ParseTruncSqlInfo(Byte[] info, Byte[] items, Descriptor[]& rowDescs)
   at FirebirdSql.Data.Client.Managed.Version10.GdsStatement.ProcessPrepareResponse(GenericResponse response)
   at FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Prepare(String commandText)
   at FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.<ExecuteReaderAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<InitializeReaderAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.<MoveNextAsync>d__17.MoveNext() 

This is the translated query.

SELECT "t7"."TerminalId", "t7"."ActiveGuiSessionId", "t7"."Discriminator", "t7"."Enabled", "t7"."UiContextId", "t7"."Certificate", "t7"."CurrentMode", "t7"."PendingMode", "t7"."TerminalId0", "t7"."Core_AdminPassword", "t7"."Core_AdminPin", "t7"."Core_AdminUsername", "t7"."Core_DefaultLoginMethodDisplay", "t7"."Core_FaxModule", "t7"."Core_GuestLogin", "t7"."Core_GuestLoginScreen", "t7"."Core_IdleTimeout", "t7"."Core_LoginMethod", "t7"."Core_LoginMethodSimple", "t7"."Core_Model", "t7"."Core_PackageUrl", "t7"."Core_PrinterAddress", "t7"."Core_PrinterId", "t7"."Core_SerialNumber", "t7"."TerminalId1", "t7"."Core_SmtpInfo_Address", "t7"."Core_SmtpInfo_Port", "t7"."Core_SmtpInfo_SenderAddress", "t7"."Id", "t7"."AccountSessionReference", "t7"."AccountSessionSessionId", "t7"."Discriminator0", "t7"."EndTime", "t7"."MachineId", "t7"."ModelSrc", "t7"."SelectedProject", "t7"."StartTime", "t7"."TerminalId2", "t7"."Id0", "t7"."User_Domain", "t7"."User_Email", "t7"."User_FullName", "t7"."User_Id", "t7"."User_UserName", "t7"."Reference", "t7"."SessionId", "t7"."Discriminator1", "t7"."GroupId", "t7"."InitialSessionId", "t7"."IsClosed", "t7"."PriceListSrc", "t7"."TerminalId3", "t7"."TerminalIpAddress", "t7"."Username", "t7"."AvailableBalance", "t7"."UnblockedBalance", "t7"."ExclusiveOwnership", "t7"."Rules", "t8"."Id", "t8"."AccountSessionReference", "t8"."AccountSessionSessionId", "t8"."Commited", "t8"."Discriminator", "t8"."JobId", "t8"."BlockedAmount", "t8"."PaidAmount", "t8"."BlockedCountersData"
FROM (
    SELECT "t"."TerminalId", "t"."ActiveGuiSessionId", "t"."Discriminator", "t"."Enabled", "t"."UiContextId", "t"."Certificate", "t"."CurrentMode", "t"."PendingMode", "t1"."TerminalId" AS "TerminalId0", "t1"."Core_AdminPassword", "t1"."Core_AdminPin", "t1"."Core_AdminUsername", "t1"."Core_DefaultLoginMethodDisplay", "t1"."Core_FaxModule", "t1"."Core_GuestLogin", "t1"."Core_GuestLoginScreen", "t1"."Core_IdleTimeout", "t1"."Core_LoginMethod", "t1"."Core_LoginMethodSimple", "t1"."Core_Model", "t1"."Core_PackageUrl", "t1"."Core_PrinterAddress", "t1"."Core_PrinterId", "t1"."Core_SerialNumber", "t5"."TerminalId" AS "TerminalId1", "t5"."Core_SmtpInfo_Address", "t5"."Core_SmtpInfo_Port", "t5"."Core_SmtpInfo_SenderAddress", "t2"."Id", "t2"."AccountSessionReference", "t2"."AccountSessionSessionId", "t2"."Discriminator" AS "Discriminator0", "t2"."EndTime", "t2"."MachineId", "t2"."ModelSrc", "t2"."SelectedProject", "t2"."StartTime", "t2"."TerminalId" AS "TerminalId2", "t6"."Id" AS "Id0", "t6"."User_Domain", "t6"."User_Email", "t6"."User_FullName", "t6"."User_Id", "t6"."User_UserName", "t3"."Reference", "t3"."SessionId", "t3"."Discriminator" AS "Discriminator1", "t3"."GroupId", "t3"."InitialSessionId", "t3"."IsClosed", "t3"."PriceListSrc", "t3"."TerminalId" AS "TerminalId3", "t3"."TerminalIpAddress", "t3"."Username", "t3"."AvailableBalance", "t3"."UnblockedBalance", "t3"."ExclusiveOwnership", "t3"."Rules"
    FROM "Terminals" AS "t"
    LEFT JOIN (
        SELECT "t0"."TerminalId", "t0"."Core_AdminPassword", "t0"."Core_AdminPin", "t0"."Core_AdminUsername", "t0"."Core_DefaultLoginMethodDisplay", "t0"."Core_FaxModule", "t0"."Core_GuestLogin", "t0"."Core_GuestLoginScreen", "t0"."Core_IdleTimeout", "t0"."Core_LoginMethod", "t0"."Core_LoginMethodSimple", "t0"."Core_Model", "t0"."Core_PackageUrl", "t0"."Core_PrinterAddress", "t0"."Core_PrinterId", "t0"."Core_SerialNumber"
        FROM "Terminals" AS "t0"
        WHERE "t0"."Core_PrinterId" IS NOT NULL AND ("t0"."Core_LoginMethodSimple" IS NOT NULL AND ("t0"."Core_LoginMethod" IS NOT NULL AND ("t0"."Core_IdleTimeout" IS NOT NULL AND ("t0"."Core_FaxModule" IS NOT NULL AND "t0"."Core_DefaultLoginMethodDisplay" IS NOT NULL))))
    ) AS "t1" ON "t"."TerminalId" = "t1"."TerminalId"
    LEFT JOIN (
        SELECT "s"."Id", "s"."AccountSessionReference", "s"."AccountSessionSessionId", "s"."Discriminator", "s"."EndTime", "s"."MachineId", "s"."ModelSrc", "s"."SelectedProject", "s"."StartTime", "s"."TerminalId"
        FROM "Sessions" AS "s"
        WHERE "s"."Discriminator" IN (CAST(_UTF8'GuiSession' AS VARCHAR(10) CHARACTER SET UTF8), CAST(_UTF8'HpGuiSession' AS VARCHAR(12) CHARACTER SET UTF8))
    ) AS "t2" ON "t"."ActiveGuiSessionId" = "t2"."Id"
    LEFT JOIN (
        SELECT "a"."Reference", "a"."SessionId", "a"."Discriminator", "a"."GroupId", "a"."InitialSessionId", "a"."IsClosed", "a"."PriceListSrc", "a"."TerminalId", "a"."TerminalIpAddress", "a"."Username", "a"."AvailableBalance", "a"."UnblockedBalance", "a"."ExclusiveOwnership", "a"."Rules"
        FROM "AccountSessions" AS "a"
        WHERE "a"."Discriminator" IN (CAST(_UTF8'CostCenterAccountSession' AS VARCHAR(24) CHARACTER SET UTF8), CAST(_UTF8'CreditAccountSession' AS VARCHAR(20) CHARACTER SET UTF8), CAST(_UTF8'NoAccountSession' AS VARCHAR(16) CHARACTER SET UTF8), CAST(_UTF8'QuotaAccountSession' AS VARCHAR(19) CHARACTER SET UTF8))
    ) AS "t3" ON ("t2"."AccountSessionReference" = "t3"."Reference") AND ("t2"."AccountSessionSessionId" = "t3"."SessionId")
    LEFT JOIN (
        SELECT "t4"."TerminalId", "t4"."Core_SmtpInfo_Address", "t4"."Core_SmtpInfo_Port", "t4"."Core_SmtpInfo_SenderAddress"
        FROM "Terminals" AS "t4"
        WHERE "t4"."Core_SmtpInfo_SenderAddress" IS NOT NULL OR ("t4"."Core_SmtpInfo_Port" IS NOT NULL OR "t4"."Core_SmtpInfo_Address" IS NOT NULL)
    ) AS "t5" ON "t1"."TerminalId" = "t5"."TerminalId"
    LEFT JOIN (
        SELECT "s0"."Id", "s0"."User_Domain", "s0"."User_Email", "s0"."User_FullName", "s0"."User_Id", "s0"."User_UserName"
        FROM "Sessions" AS "s0"
        WHERE "s0"."User_Id" IS NOT NULL
    ) AS "t6" ON "t2"."Id" = "t6"."Id"
    WHERE ("t"."Discriminator" = CAST(_UTF8'HpTerminal' AS VARCHAR(10) CHARACTER SET UTF8)) AND ("t"."Enabled" AND ("t1"."Core_PrinterAddress" = CAST(@__printerAddress_0 AS VARCHAR(8191))))
    ROWS (2)
) AS "t7"
LEFT JOIN (
    SELECT "a0"."Id", "a0"."AccountSessionReference", "a0"."AccountSessionSessionId", "a0"."Commited", "a0"."Discriminator", "a0"."JobId", "a0"."BlockedAmount", "a0"."PaidAmount", "a0"."BlockedCountersData"
    FROM "Allocations" AS "a0"
    WHERE "a0"."Discriminator" IN (CAST(_UTF8'CreditAllocation' AS VARCHAR(16) CHARACTER SET UTF8), CAST(_UTF8'NoAllocation' AS VARCHAR(12) CHARACTER SET UTF8), CAST(_UTF8'QuotaAllocation' AS VARCHAR(15) CHARACTER SET UTF8))
) AS "t8" ON (("t7"."Reference" = "t8"."AccountSessionReference") OR ("t7"."Reference" IS NULL AND "t8"."AccountSessionReference" IS NULL)) AND (("t7"."SessionId" = "t8"."AccountSessionSessionId") OR ("t7"."SessionId" IS NULL AND "t8"."AccountSessionSessionId" IS NULL))
ORDER BY "t7"."TerminalId", "t8"."Id" 

Could you please help to investigate this issue?

Thank you.

Activity

  1. cincuranet commented on Jul 11, 2021

    @cincuranet
    Member

    A call stack is not enough to understand this issue. Steps to reproduce would be best. But providing as much information as possible what was happening before and what is the environment is a good start.

  2. self-assigned this
    on Jul 11, 2021
  3. oshinyil commented on Jul 20, 2021

    @oshinyil
    Author

    Here is the environment.

    • Environment.Version: 4.0.30319.42000
    • RuntimeInformation.FrameworkDescription: 4.7.3740.0
    • RuntimeInformation.OSDescription: Microsoft Windows 10.0.17763

    I am not sure what was happening before. The error suddenly happened and we needed to restart the application.

  4. cincuranet commented on Jul 20, 2021

    @cincuranet
    Member

    Closing in favor of #963.

  5. added theissue type on Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions