[featured] fix non existing feature start#234
Conversation
Fix an issue that when starting a non existing feature and then installing it with sonic-package-manager it won't start. E.g: admin@sonic:~$ redis-cli -n 4 hmset 'FEATURE|non-existing' state enabled OK admin@sonic:~$ sudo zless /var/log/syslog | grep featured 2025 Mar 26 15:19:33.237090 sonic INFO featured: Feature non-existing is enabled and started With this patch an error is recorded and feature state is not cached: 2025 Mar 26 15:35:32.794640 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'unmask', 'non-existing.service']' 2025 Mar 26 15:35:33.233685 sonic INFO featured: Output: , Stderr: Unit non-existing.service does not exist, proceeding anyway. 2025 Mar 26 15:35:33.233743 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'enable', 'non-existing.service']' 2025 Mar 26 15:35:33.247238 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'non-existing.service'] - failed: return code - 1, output: 2025 Mar 26 15:35:33.247300 sonic ERR featured: Feature 'non-existing.service' failed to be enabled and started 2025 Mar 26 15:35:39.331762 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'unmask', 'non-existing.service']' 2025 Mar 26 15:35:39.780474 sonic INFO featured: Output: , Stderr: Unit non-existing.service does not exist, proceeding anyway. 2025 Mar 26 15:35:39.780513 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'enable', 'non-existing.service']' 2025 Mar 26 15:35:39.795113 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'non-existing.service'] - failed: return code - 1, output: 2025 Mar 26 15:35:39.795153 sonic ERR featured: Feature 'non-existing.service' failed to be enabled and started Feature will start next time when setting state field in FEATURE table Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hi @stepanblyschak , this change is blocking submodule advance in master and 202505 branch, could you check: 202505: @qiluo-msft @zbud-msft for viz, since in 202505, telemetry is the only one reporting issue(in master, both frr_bmp and telemetry report issues), not sure whether it's the hidden issue is exposed. |
|
Hi @yejianquan, telemetry is not a built container in public image. Thats why test fails when running |
Hi @zbud-msft so we should add the error msg into common ignore list of log analyzer? |
|
Hi @stepanblyschak seems like featured is trying to stop telemetry.service that is already disabled in public image. Seems like this PR is responsible for that change and needs to be fixed. |
This reverts commit 29b8be8.
|
@zbud-msft Featured does not do anything special with telemetry. Errors: could happen only if user provided telemetry in CONFIG_DB when telemetry is not built in the image and correctly reports the issue. |
This reverts commit 29b8be8. Because it blocks submodule update in sonic-buildimage repo. The build and test are verified in a draft PR sonic-net/sonic-buildimage#23027.
This reverts commit 29b8be8. Because it blocks submodule update in sonic-buildimage repo. The build and test are verified in a draft PR sonic-net/sonic-buildimage#23027.
This reverts commit 29b8be8. Because it blocks submodule update in sonic-buildimage repo. The build and test are verified in a draft PR sonic-net/sonic-buildimage#23027.
Fix an issue that when starting a non existing feature and then installing it with sonic-package-manager it won't start. E.g: admin@sonic:~$ redis-cli -n 4 hmset 'FEATURE|non-existing' state enabled OK admin@sonic:~$ sudo zless /var/log/syslog | grep featured 2025 Mar 26 15:19:33.237090 sonic INFO featured: Feature non-existing is enabled and started With this patch an error is recordded and feature state is not cached: 2025 Mar 26 15:35:32.794640 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'unmask', 'non-existing.service']' 2025 Mar 26 15:35:33.233685 sonic INFO featured: Output: , Stderr: Unit non-existing.service does not exist, proceeding anyway. 2025 Mar 26 15:35:33.233743 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'enable', 'non-existing.service']' 2025 Mar 26 15:35:33.247238 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'non-existing.service'] - failed: return code - 1, output: 2025 Mar 26 15:35:33.247300 sonic ERR featured: Feature 'non-existing.service' failed to be enabled and started 2025 Mar 26 15:35:39.331762 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'unmask', 'non-existing.service']' 2025 Mar 26 15:35:39.780474 sonic INFO featured: Output: , Stderr: Unit non-existing.service does not exist, proceeding anyway. 2025 Mar 26 15:35:39.780513 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'enable', 'non-existing.service']' 2025 Mar 26 15:35:39.795113 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'non-existing.service'] - failed: return code - 1, output: 2025 Mar 26 15:35:39.795153 sonic ERR featured: Feature 'non-existing.service' failed to be enabled and started Feature will start next time when setting state field in FEATURE table
Fix an issue that when starting a non existing feature and then installing it with sonic-package-manager it won't start. E.g: admin@sonic:~$ redis-cli -n 4 hmset 'FEATURE|non-existing' state enabled OK admin@sonic:~$ sudo zless /var/log/syslog | grep featured 2025 Mar 26 15:19:33.237090 sonic INFO featured: Feature non-existing is enabled and started With this patch an error is recordded and feature state is not cached: 2025 Mar 26 15:35:32.794640 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'unmask', 'non-existing.service']' 2025 Mar 26 15:35:33.233685 sonic INFO featured: Output: , Stderr: Unit non-existing.service does not exist, proceeding anyway. 2025 Mar 26 15:35:33.233743 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'enable', 'non-existing.service']' 2025 Mar 26 15:35:33.247238 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'non-existing.service'] - failed: return code - 1, output: 2025 Mar 26 15:35:33.247300 sonic ERR featured: Feature 'non-existing.service' failed to be enabled and started 2025 Mar 26 15:35:39.331762 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'unmask', 'non-existing.service']' 2025 Mar 26 15:35:39.780474 sonic INFO featured: Output: , Stderr: Unit non-existing.service does not exist, proceeding anyway. 2025 Mar 26 15:35:39.780513 sonic INFO featured: Running cmd: '['sudo', 'systemctl', 'enable', 'non-existing.service']' 2025 Mar 26 15:35:39.795113 sonic ERR featured: ['sudo', 'systemctl', 'enable', 'non-existing.service'] - failed: return code - 1, output: 2025 Mar 26 15:35:39.795153 sonic ERR featured: Feature 'non-existing.service' failed to be enabled and started Feature will start next time when setting state field in FEATURE table
Fix an issue that when starting a non existing feature and then installing it with sonic-package-manager it won't start.
E.g:
With this patch an error is recordded and feature state is not cached:
Feature will start next time when setting state field in FEATURE table