Page MenuHomeVyOS Platform

Exception in event handler script
Closed, ResolvedPublicBUG

Description

The event handler Python script (vyos-event-handler.py) sometimes exits because it cannot find the _PID key in the message entry.

The concerned code is:

for entry in data:
    message = entry['MESSAGE']
    pid = entry['_PID']

Here is an example of a message missing the _PID entry:

{'_TRANSPORT': 'kernel', 'SYSLOG_FACILITY': 0, 'SYSLOG_IDENTIFIER': 'kernel', '_MACHINE_ID': UUID('b7091403-46e6-45c4-8fdf-4661a4c8b44c'), '_HOSTNAME': 'vyos', '_RUNTIME_SCOPE': 'system', 'PRIORITY': 6, 'MESSAGE': '8021q: adding VLAN 0 to HW filter on device eth2', '_BOOT_ID': UUID('dabb841c-6005-4662-b2d6-41cc4da08b10'), '_SOURCE_MONOTONIC_TIMESTAMP': datetime.timedelta(days=4, seconds=61864, microseconds=27675), '__REALTIME_TIMESTAMP': datetime.datetime(2024, 2, 18, 19, 1, 12, 245638, tzinfo=datetime.timezone(datetime.timedelta(seconds=3600), 'CET')), '__MONOTONIC_TIMESTAMP': journal.Monotonic(timestamp=datetime.timedelta(days=4, seconds=61867, microseconds=525194), bootid=UUID('dabb841c-6005-4662-b2d6-41cc4da08b10')), '__CURSOR': 's=704d11a86950461bb214afc68b9e8c37;i=568260;b=dabb841c60054662b2d641cc4da08b10;m=5edef5044a;t=611abc3330986;x=3902b6a3be371d1b'}

I have experienced this issue with both the last rolling releases and version 1.4.

Details

Difficulty level
Unknown (require assessment)
Version
1.5-rolling-202401030023
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)