Skip to content

[spm]: Handle enabled/disabled action for generated/transient units#22

Closed
nazariig wants to merge 1 commit into
masterfrom
master-spm-fix
Closed

[spm]: Handle enabled/disabled action for generated/transient units#22
nazariig wants to merge 1 commit into
masterfrom
master-spm-fix

Conversation

@nazariig
Copy link
Copy Markdown
Owner

@nazariig nazariig commented Feb 10, 2026

ERR log:

root@sonic:/home/admin# sudo sonic-package-manager install -y cpu-report==2.0.0
Execute systemctl action stop on cpu-report service
Execute systemctl action disable on cpu-report service
removed /usr/lib/systemd/system/cpu-report.service
removed /usr/local/bin/cpu-report.sh
removed /usr/bin/cpu-report.sh
removed /etc/sonic/cpu-report_reconcile
removed /etc/systemd/system/cpu-report.service.d
generated /usr/bin/cpu-report.sh
generated /usr/local/bin/cpu-report.sh
generated /usr/lib/systemd/system/cpu-report.service
cpu-report entry is added to AUTO_TECHSUPPORT_FEATURE table
Execute systemctl action enable on cpu-report service
Failed to enable unit: Unit /run/systemd/generator/cpu-report.service is transient or generated
cpu-report entry is added to AUTO_TECHSUPPORT_FEATURE table
removed /usr/lib/systemd/system/cpu-report.service
removed /usr/local/bin/cpu-report.sh
removed /usr/bin/cpu-report.sh
removed /etc/sonic/cpu-report_reconcile
removed /etc/systemd/system/cpu-report.service.d
generated /usr/bin/cpu-report.sh
generated /usr/local/bin/cpu-report.sh
generated /usr/lib/systemd/system/cpu-report.service
Execute systemctl action enable on cpu-report service
Failed to enable unit: Unit /run/systemd/generator/cpu-report.service is transient or generated
error: failed in rollback: Failed to execute "['systemctl', 'enable', 'cpu-report']"
Failed to install cpu-report==2.0.0: Failed to upgrade cpu-report: Failed to execute "['systemctl', 'enable', 'cpu-report']"

Steps to reproduce:

  1. Add app repository
sudo sonic-package-manager repository add <app> <repo_url> --default-reference=1.0.0
  1. Install app v1.0.0
sudo sonic-package-manager install <app>==1.0.0 -y
  1. Enable the feature and wait for container to come up
sudo config feature state <app> enabled
  1. Upgrade to v2.0.0 — THIS triggers the bug
sudo sonic-package-manager install -y <app>==2.0.0

Sample:

SHELL:

root@sonic:/home/admin# sonic-package-manager install cpu-report==2.0.0 -y
Execute systemctl action stop on cpu-report service
Execute systemctl action disable on cpu-report service
warning: Skipping systemctl disable for generated/transient unit cpu-report
removed /usr/lib/systemd/system/cpu-report.service
removed /usr/local/bin/cpu-report.sh
removed /usr/bin/cpu-report.sh
removed /etc/sonic/cpu-report_reconcile
removed /etc/systemd/system/cpu-report.service.d
generated /usr/bin/cpu-report.sh
generated /usr/local/bin/cpu-report.sh
generated /usr/lib/systemd/system/cpu-report.service
cpu-report entry is added to AUTO_TECHSUPPORT_FEATURE table
Execute systemctl action enable on cpu-report service
warning: Skipping systemctl enable for generated/transient unit cpu-report
Execute systemctl action start on cpu-report service

SYSLOG:

2026 Feb 10 16:18:55.531288 sonic INFO sonic-package-manager: Execute systemctl action disable on cpu-report service
2026 Feb 10 16:18:55.541984 sonic WARNING sonic-package-manager: Skipping systemctl disable for generated/transient unit cpu-report
2026 Feb 10 16:18:55.542262 sonic INFO sonic-package-manager: removed /usr/lib/systemd/system/cpu-report.service
2026 Feb 10 16:18:55.542481 sonic INFO sonic-package-manager: removed /usr/local/bin/cpu-report.sh
2026 Feb 10 16:18:55.542676 sonic INFO sonic-package-manager: removed /usr/bin/cpu-report.sh
2026 Feb 10 16:18:55.542861 sonic INFO sonic-package-manager: removed /etc/sonic/cpu-report_reconcile
2026 Feb 10 16:18:55.543674 sonic INFO sonic-package-manager: removed /etc/systemd/system/cpu-report.service.d
2026 Feb 10 16:18:56.190582 sonic INFO sonic-package-manager: generated /usr/bin/cpu-report.sh
2026 Feb 10 16:18:56.201750 sonic INFO sonic-package-manager: generated /usr/local/bin/cpu-report.sh
2026 Feb 10 16:18:56.218809 sonic INFO sonic-package-manager: generated /usr/lib/systemd/system/cpu-report.service
2026 Feb 10 16:18:56.894541 sonic INFO sonic-package-manager: cpu-report entry is added to AUTO_TECHSUPPORT_FEATURE table
2026 Feb 10 16:18:56.894689 sonic INFO sonic-package-manager: Execute systemctl action enable on cpu-report service
2026 Feb 10 16:18:56.905258 sonic WARNING sonic-package-manager: Skipping systemctl enable for generated/transient unit cpu-report
2026 Feb 10 16:18:56.905380 sonic INFO sonic-package-manager: Execute systemctl action start on cpu-report service

System logger fix also resolves the issue of missing application tag and very first word of the message:

2026 Feb 10 14:31:39.193944 sonic WARNING systemctl enable for generated/transient unit cpu-report

What I did

How I did it

How to verify it

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

…racefully

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@ayurkiv-nvda
Copy link
Copy Markdown

LGTM

@nazariig nazariig closed this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants