Skip to content

[pmon]: Install libyaml-cpp runtime dependency#28098

Open
zjswhhh wants to merge 1 commit into
sonic-net:masterfrom
zjswhhh:pmon-libyaml-cpp-fix
Open

[pmon]: Install libyaml-cpp runtime dependency#28098
zjswhhh wants to merge 1 commit into
sonic-net:masterfrom
zjswhhh:pmon-libyaml-cpp-fix

Conversation

@zjswhhh

@zjswhhh zjswhhh commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Why I did it

PMON was upgraded to a Trixie-based container, but docker-platform-monitor does not install the Trixie runtime package that provides libyaml-cpp.so.0.8. This is not expected to affect every Trixie-based PMON platform. The impact is platform-specific: platforms whose PMON-loaded platform API or daemon dependency chain requires libyaml-cpp.so.0.8 can fail with ImportError, while platforms without that dependency can continue to run normally.

The issue was reproduced on affected Cisco 8102 SmartSwitch NPU images, where the host had the library while the pmon container did not. This caused platform daemons such as chassisd, thermalctld, syseepromd, xcvrd, psud, and sensormond to exit with ImportError. When chassisd was down, chassis/DPU state was not initialized and DPU management reachability failed.

Evidence from affected 8102 SmartSwitch NPUs:

pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/thermal.py", line 15, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/psu_tray.py", line 10, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/psu.py", line 20, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/thermal.py", line 21, in <module>
pmon#supervisord: thermalctld     raise ImportError (str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/chassis.py", line 20, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/psu_tray.py", line 17, in <module>
pmon#supervisord: thermalctld     raise ImportError (str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found- required module not found
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/platform.py", line 12, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/chassis.py", line 63, in <module>
pmon#supervisord: thermalctld     raise ImportError (str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found- required module not found- required module not found
pmon#supervisord: thermalctld   File "/usr/local/bin/thermalctld", line 20, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/__init__.py", line 2, in <module>
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/platform.py", line 14, in <module>
pmon#supervisord: thermalctld     raise ImportError(str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found- required module not found- required module not found- required module not found

pmon supervisor state before live mitigation:

chassisd      FATAL  Exited too quickly
psud          FATAL  Exited too quickly
sensormond    FATAL  Exited too quickly
syseepromd    FATAL  Exited too quickly
thermalctld   FATAL  Exited too quickly
xcvrd         FATAL  Exited too quickly

Library presence check before live mitigation:

HOST
/usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.8

PMON
# no libyaml-cpp.so.0.8 found

After copying libyaml-cpp.so.0.8 into the running pmon container and restarting the daemons, the platform daemons recovered and required DPU state became ready again:

chassisd      RUNNING
psud          RUNNING
sensormond    RUNNING
syseepromd    RUNNING
thermalctld   RUNNING
xcvrd         RUNNING

Required DPUs: Online/up/Ready=true
Work item tracking
  • Microsoft ADO (number only):

How I did it

Install the Trixie runtime package libyaml-cpp0.8 in the docker-platform-monitor image so PMON platform daemon dependencies are present inside the container when a platform plugin requires this shared library.

How to verify it

  • Verified libyaml-cpp0.8 exists in Debian Trixie:
    docker run --rm debian:trixie bash -lc 'apt-get update -qq && apt-cache policy libyaml-cpp0.8'
  • Ran make configure PLATFORM=vs and make SONIC_BUILD_JOBS=4 target/docker-platform-monitor.gz.
  • Loaded the built PMON image and verified the runtime package and shared object exist:
gzip -dc target/docker-platform-monitor.gz | docker load
docker run --rm --entrypoint bash docker-platform-monitor:latest -lc \
  'dpkg -l | grep libyaml-cpp0.8; dpkg -L libyaml-cpp0.8 | grep libyaml-cpp.so.0.8'

Observed:

ii  libyaml-cpp0.8:amd64  0.8.0+dfsg-7  amd64  YAML parser and emitter for C++
/usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.8.0
/usr/lib/x86_64-linux-gnu/libyaml-cpp.so.0.8

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

  • master

Description for the changelog

Install libyaml-cpp runtime dependency in the PMON container for platforms that require it.

Link to config_db schema for YANG module changes

N/A

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@zjswhhh zjswhhh marked this pull request as ready for review June 26, 2026 00:02
@zjswhhh zjswhhh requested a review from lguohan as a code owner June 26, 2026 00:02
Copilot AI review requested due to automatic review settings June 26, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the docker-platform-monitor (PMON) container image to include the Debian Trixie runtime package libyaml-cpp0.8, addressing failures where platform daemons load shared objects requiring libyaml-cpp.so.0.8 inside the container.

Changes:

  • Add libyaml-cpp0.8 to the PMON container’s apt-get install package list.

build-essential \
python3-dev \
ipmitool \
libyaml-cpp0.8 \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 910e6fa: added libyaml-cpp0.8==0.8.0+dfsg-7 to the PMON Trixie version lock manifests.

@zjswhhh zjswhhh force-pushed the pmon-libyaml-cpp-fix branch from b6e7b69 to 230b15a Compare June 26, 2026 00:06
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@zjswhhh

zjswhhh commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Hi @saiarcot895 - please help review

@saiarcot895

Copy link
Copy Markdown
Contributor

This is a generic PMON container dependency issue

What's the full backtrace? I don't think this is a generic issue, considering there are different platforms able to run Trixie-based pmon.

@zjswhhh

zjswhhh commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, agreed -- this should not be described as a generic PMON/Trixie issue. More precise scope: this affects platforms whose PMON-loaded platform API dependency chain requires libyaml-cpp.so.0.8. Other platforms can run Trixie-based PMON if their platform package does not require that shared object.

Full traceback from the reproduced failure, with lab identifiers redacted:

pmon#supervisord: thermalctld Traceback (most recent call last):
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/thermal.py", line 15, in <module>
pmon#supervisord: thermalctld     import cisco_bsp
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld During handling of the above exception, another exception occurred:
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld Traceback (most recent call last):
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/psu_tray.py", line 10, in <module>
pmon#supervisord: thermalctld     from sonic_platform.psu import Psu, PsuAdaptor
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/psu.py", line 20, in <module>
pmon#supervisord: thermalctld     from sonic_platform.thermal import Thermal
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/thermal.py", line 21, in <module>
pmon#supervisord: thermalctld     raise ImportError (str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld During handling of the above exception, another exception occurred:
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld Traceback (most recent call last):
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/chassis.py", line 20, in <module>
pmon#supervisord: thermalctld     from sonic_platform.psu_tray import make_psu_tray
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/psu_tray.py", line 17, in <module>
pmon#supervisord: thermalctld     raise ImportError (str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found- required module not found
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld During handling of the above exception, another exception occurred:
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld Traceback (most recent call last):
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/platform.py", line 12, in <module>
pmon#supervisord: thermalctld     from sonic_platform.chassis import Chassis
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/chassis.py", line 63, in <module>
pmon#supervisord: thermalctld     raise ImportError (str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found- required module not found- required module not found
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld During handling of the above exception, another exception occurred:
pmon#supervisord: thermalctld
pmon#supervisord: thermalctld Traceback (most recent call last):
pmon#supervisord: thermalctld   File "/usr/local/bin/thermalctld", line 20, in <module>
pmon#supervisord: thermalctld     import sonic_platform
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/__init__.py", line 2, in <module>
pmon#supervisord: thermalctld     from sonic_platform import *
pmon#supervisord: thermalctld   File "/usr/local/lib/python3.13/dist-packages/sonic_platform/platform.py", line 14, in <module>
pmon#supervisord: thermalctld     raise ImportError(str(e) + "- required module not found")
pmon#supervisord: thermalctld ImportError: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory- required module not found- required module not found- required module not found- required module not found
pmon#supervisord: exited: thermalctld (exit status 1; not expected)

The same root import failure was also observed in chassisd, psud, and sensormond startup paths. xcvrd and syseepromd had supervisor failure/state evidence in the same PMON failure window, but I did not find a retained full Python traceback for those two in the rotated logs.

Comment thread dockers/docker-platform-monitor/Dockerfile.j2
Install libyaml-cpp0.8 in the Trixie-based PMON container so platform plugins that depend on libyaml-cpp.so.0.8 can load inside pmon.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jing Zhang <zhangjing@microsoft.com>
@zjswhhh zjswhhh force-pushed the pmon-libyaml-cpp-fix branch from 230b15a to 910e6fa Compare June 26, 2026 21:11
Copilot AI review requested due to automatic review settings June 26, 2026 21:11
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines 6 to +8
gcc-14-arm-linux-gnueabihf==14.2.0-19
gcc-arm-linux-gnueabihf==4:14.2.0-1
libyaml-cpp0.8==0.8.0+dfsg-7
@zjswhhh

zjswhhh commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1149886:

✅Stage Test:

  • Job impacted-area-kvmtest-t1-lag-vpp by Elastictest: retried.

@zjswhhh

zjswhhh commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Hi @kperumalbfn - can you help merge please

@zjswhhh

zjswhhh commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yxieca - please help merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants