Logon, heartbeats and logout
FIX Logon rejected: Logout with text, or disconnect after Logon
The acceptor answered your Logon with a Logout (35=5) whose Text (58) gives the reason, or it closed the TCP connection without answering. The second case is harder: the reason is only in the acceptor's logs.
What it means
A Logon is validated in steps: the TCP connection is accepted (IP allow-list, TLS), the CompID pair is matched to a configured session, then the Logon content is checked: sequence number, credentials, heartbeat interval and session hours.
Failures in the first two steps usually end in a silent disconnect. Failures in the last step usually get a Logout with Text (58). On FIXT 1.1 sessions, the Logout can also carry SessionStatus (1409), with codes such as 5 (invalid username or password), 7 (logons not allowed at this time) and 8 (password expired).
Common causes
- CompIDs not configured on the acceptor, or swapped (SenderCompID (49) and TargetCompID (56)).
- Source IP not on the counterparty's allow-list, or TLS expected and plain TCP used.
- Wrong Username (553) or Password (554) (FIX 4.3 and later), or credentials expected in a venue-specific field.
- Sequence number too low. See the MsgSeqNum too low page.
- BeginString different from the session's FIX version; QuickFIX answers with "Incorrect BeginString".
- Logon outside the configured session hours.
- Another connection is already logged on with the same session.
- On FIXT 1.1, DefaultApplVerID (1137) missing from the Logon.
How to fix it
On the initiator (the side logging on)
- Read the Logout text first. If there is none, check CompIDs, IP, port and TLS with the counterparty.
- Check HeartBtInt (108) matches what was agreed, and that you are inside the session hours.
- Make sure only one instance of your engine runs per session.
On the acceptor
- Send a Logout with a specific Text (58) for every refusal you can name. A silent disconnect costs both sides time.
- Log refused connections with source IP and CompIDs.
Example
A FIX 4.4 Logon with Username and Password, refused with a Logout.
1. Buy side: Logon
8=FIX.4.4|9=115|35=A|49=BUYSIDE|56=SELLSIDE|34=1|52=20261020-06:59:58.000|98=0|108=30|141=Y|553=buyside_trading|554=wrong-password|10=131|
2. Sell side: Logout with the reason
8=FIX.4.4|9=90|35=5|49=SELLSIDE|56=BUYSIDE|34=1|52=20261020-06:59:58.010|58=Invalid username or password|10=201|
SOH (0x01) is shown as |. BodyLength (9) and CheckSum (10) are calculated as if every | were SOH.
Open this example in the parserQuestions
- My Logon gets no reply and the connection closes. Why?
- The acceptor did not find a session for your CompIDs, or refused the connection before reading the Logon (IP allow-list, TLS, wrong port). These cases rarely produce a Logout, so ask the counterparty to check their logs at the time of your attempt.
- What HeartBtInt (108) should I send?
- The value agreed with the counterparty, commonly 30 seconds. Some acceptors refuse a Logon whose interval differs from their configuration.