This article addresses the issue where a subscriber remains stuck in the "Terminated" state for an extended period after a link goes down or is disconnected. Specifically, the subscriber session stays in the "Terminated" state for exactly 5 minutes and 10 seconds. This delay occurs because the final accounting statistics are not sent from the Packet Forwarding Engine (PFE). The authd process waits for the final stats from bbe-statsd, causing the subscriber session to remain in the "Terminated" state until the timeout period elapses.
When encountering this issue, the subscriber session remains in the "Terminated" state for 5 minutes and 10 seconds. This can be identified by examining specific logs that indicate the delayed processing of the final accounting statistics.
Logs indicating the issue:
The following logs can be used to identify the issue:
AUTHD Trace Indicating Session Logout:
May 13 11:22:48.300470 SEQ RecvClientMsg:jpppd-client session-id:119601895 Opcode:3, Subcode:15 (SESSION_LOGOUT) May 13 11:22:48.300510 Setting terminate ID to 1001b May 13 11:22:48.300519 Decoding incoming attributes May 13 11:22:48.300526 Begin to logout Subscriber May 13 11:22:48.300533 Received subscriber logout request session-id:119601895 May 13 11:22:48.300540 subscriberLogoutV4 session-id:119601895
Auth-FSM Triggering Accounting Stop:
May 13 11:22:48.503433 ################################################################### May 13 11:22:48.503438 ########################### TERMINATE REQ RCVD ######################### May 13 11:22:48.503443 ################################################################### May 13 11:22:48.503467 ======= Accounting STOP triggered for session-id:119601895 ============== May 13 11:22:48.503566 Final stats request, waiting for callback, session-id:119601895 May 13 11:22:48.503594 Special (undelivered) terminate response for session-id:119601895 to keep outstanding messages below quota. Actual response could be delayed depending on timeouts and configured values.
Final Stats received and Accounting-Response after 5 mins 10 sec:
May 13 11:27:57.630805 Read from stats-db request, session-id:119601895 May 13 11:27:57.630842 AccFsm::current state=Acc-Start-Sent(1) event=10 session-id:119601895 May 13 11:27:57.635688 authd_radius_acctg_callback Result is :(CLIENT_REQ_STATUS_SUCCESS) reply_code:(Accounting-Response) 5 session-id:119601895
To resolve this issue, follow these steps:
Upgrade Junos Version: Ensure the device is running the Junos release which includes the fix for PR1519103.
If the issue persists collect the below logs for further analysis
set cli timestamp show subscribers extensive mac-address <> | refresh 1 | no-more
Configure below traceoptions :
set system processes general-authentication-service traceoptions file name authd.log set system processes general-authentication-service traceoptions file size 100m set system processes general-authentication-service traceoptions file files 10 set system processes general-authentication-service traceoptions flag all set system processes smg-service traceoptions file smg-service.log set system processes smg-service traceoptions file size 100m set system processes smg-service traceoptions file files 10 set system processes smg-service traceoptions level all set system processes smg-service traceoptions flag all set protocols ppp-service traceoptions file ppp.log set protocols ppp-service traceoptions file size 100m set protocols ppp-service traceoptions file files 10 set protocols ppp-service traceoptions flag all set protocols pppoe traceoptions file pppoe.log set protocols pppoe traceoptions file size 100m set protocols pppoe traceoptions file files 10 set protocols pppoe traceoptions flag all