Description

After enabling jdhcp traceoption, the MX jdhcpd daemon reported the following message in trace log:

user@MX240> show log dhcp-log | match ERROR
Apr 17 20:01:48.086329 [MSTR][ERROR] jdhcpd_request_delete_baseline_stats: libstats delete: failed; error 3, session_id = 11

There is no service impact.

Solution

Access to accounting profile or statistics statement under the profile was not configured/applied. For libstats to function, accounting needs to be configured:

set access profile access-profile-dhcp accounting statistics volume-time
set access-profile access-profile-dhcp

If the above accounting configuration is not done, the libstats database entry will not be created as per design, which results in the error 'DHCP:[ERROR] jdhcpd_request_delete_baseline_stats: libstats delete: failed; error 3, session_id =x'

To understand how the error message is generated, here is a simulation process:

  1. Enable jdhcpd traceoption

    system {
        processes {
            dhcp-service {
                traceoptions {
                    file dhcp-log size 500m;
                    level all;
                    flag all;
                }
            }
        }
    }
    
  2. Login dhcp subscribers

  3. Clear dhcp relay/server statistics

    user@MX240> clear dhcp relay statistics
    
    or
    user@MX240> clear dhcp server statistics 
    
  4. Logout dhcp subscribers

This error has no service impact and can be ignored safely. Adding 'accounting statistics volume-time' may also prevent this error message.

Example:

user@MX240#show access
profile access-profile-dhcp {
    authentication-order none;
    accounting {
        order radius;
        statistics volume-time;
    }
}