Skip to content

IBC does not restart Gateway after it exits #269

Open
@dkharrat

Description

I'm using IBC to run both a paper and live of IB Gateway using a docker package.

I noticed for some reason the paper Gateway shutdown and IBC did not restart it (at around 2:01 PM UTC). The Gateway for the live account is still running fine. I'm not sure why the paper Gateway shutdown. Restarting the container worked fine and both paper & live Gateways started fine. Here's the relevant logs (times are UTC):

2024-10-12 07:10:20:779 IBC: detected frame entitled: Starting application...; event=Lost focus
2024-10-12 07:10:20:783 IBC: detected frame entitled: Starting application...; event=Deactivated
2024-10-12 07:10:20:788 IBC: detected frame entitled: Starting application...; event=Closed
2024-10-12 16:01:11:766 IBC: detected frame entitled: Starting application...; event=Lost focus
2024-10-12 16:01:11:767 IBC: detected frame entitled: Starting application...; event=Deactivated
2024-10-12 16:01:11:767 IBC: detected frame entitled: Starting application...; event=Closed
2024-10-12 16:01:51:972 IBC: detected frame entitled: Connecting to server...; event=Activated
2024-10-12 16:01:51:973 IBC: detected frame entitled: Connecting to server...; event=Focused
2024-10-12 16:01:51:974 IBC: detected frame entitled: Connecting to server...; event=Opened
2024-10-12 16:01:52:408 IBC: detected dialog entitled: Shutdown progress; event=Opened
2024-10-12 16:01:52:423 IBC: detected frame entitled: Attempt 2: Authenticating...; event=Lost focus
2024-10-12 16:01:52:423 IBC: detected frame entitled: Attempt 2: Authenticating...; event=Deactivated
2024-10-12 16:01:52:424 IBC: detected dialog entitled: Shutdown progress; event=Activated
2024-10-12 16:01:52:424 IBC: detected dialog entitled: Shutdown progress; event=Focused
2024-10-12 16:01:52:425 IBC: detected dialog entitled: IB Gateway; event=Opened
2024-10-12 16:01:52:425 IBC: detected dialog entitled: Shutdown progress; event=Lost focus
2024-10-12 16:01:52:426 IBC: detected dialog entitled: Shutdown progress; event=Deactivated
2024-10-12 16:01:52:427 IBC: detected dialog entitled: IB Gateway; event=Activated
2024-10-12 16:01:52:431 IBC: detected dialog entitled: IB Gateway; event=Focused
2024-10-12 16:01:53,370 JTS-ShutdownTask-Shutdown_IA-35213 ERROR Attempted to append to non-started appender d
2024-10-12 16:01:53,371 JTS-ShutdownTask-Shutdown_IA-35213 ERROR Attempted to append to non-started appender d
2024-10-12 16:01:53,374 NIA-Input-Queue-2 ERROR Attempted to append to non-started appender d
2024-10-12 16:01:53,374 NIA-Input-Queue-2 ERROR Attempted to append to non-started appender d
2024-10-12 16:01:53,566 pool-2-thread-1 ERROR Attempted to append to non-started appender f
IBC returned exit status 0
autorestart file not found

Gateway finished

My settings are:

IBC Settings:
    AcceptBidAskLastSizeDisplayUpdateNotification=accept
    AcceptIncomingConnectionAction=
    AcceptNonBrokerageAccountWarning=yes
    AllowBlindTrading=
    AutoLogoffTime=
    AutoRestartTime=11:59 PM
    BindAddress=
    BypassBondWarning=
    BypassCalledBondWarning=
    BypassNegativeYieldToWorstConfirmation=
    BypassNoOverfillProtectionPrecaution=
    BypassOrderPrecautions=
    BypassPriceBasedVolatilityRiskWarning=
    BypassRedirectOrderWarning=
    BypassSameActionPairTradeWarning=
    BypassUSStocksMarketDataInSharesWarning=
    ClosedownAt=
    ColdRestartTime=
    CommandPrompt=
    CommandServerPort=0
    ConfirmCryptoCurrencyOrders=transmit
    ConfirmOrderIdReset=
    ControlFrom=
    DismissNSEComplianceNotice=yes
    DismissPasswordExpiryWarning=no
    ExistingSessionDetectedAction=
    ExitAfterSecondFactorAuthenticationTimeout=no
    FIX=no
    FIXLoginId=***
    FIXPassword=***
    IbDir=
    IbLoginId=***
    IbPassword=***
    LogStructureScope=known
    LogStructureWhen=never
    LoginDialogDisplayTimeout=60
    MinimizeMainWindow=no
    OverrideTwsApiPort=
    OverrideTwsMasterClientID=
    ReadOnlyApi=no
    ReadOnlyLogin=no
    ReloginAfterSecondFactorAuthenticationTimeout=yes
    ResetOrderIdsAtStart=
    SaveTwsSettingsAt=
    SecondFactorAuthenticationExitInterval=60
    SecondFactorAuthenticationTimeout=180
    SecondFactorDevice=
    SendMarketDataInLotsForUSstocks=
    StoreSettingsOnServer=
    SuppressInfoMessages=yes
    TradingMode=paper
    TrustedTwsApiClientIPs=
End IBC Settings

The interesting part is that the exist status is 0. I believe this indicates a normal shutdown? Based on the ibstart.sh script, it appears that IBC does not attempt to restart Gateway if there's no autorestart file or exist status does not match certain codes.

Any idea why this happened? Also, what's the reason IBC does not attempt to restart Gateway in all cases?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions