Skip to content

interfaces: fix snapd system-key comparison always failing - #17418

Open
ZeyadYasser wants to merge 2 commits into
canonical:masterfrom
ZeyadYasser:fix-lp-2161845
Open

interfaces: fix snapd system-key comparison always failing#17418
ZeyadYasser wants to merge 2 commits into
canonical:masterfrom
ZeyadYasser:fix-lp-2161845

Conversation

@ZeyadYasser

Copy link
Copy Markdown
Contributor

There is a tiny window between snap run detecting a mismatch due to a removed system-key due to an ongoing profile regeneration and sending the advice request to snapd POST /v2/system-info (action: advise-system-key-mismatch) where the ongoing change might have finished which triggers another profile regeneration change and with many snap run launches this keeps cascading.

JIRA: SNAPDENG-37268

The apparmor-parser-features field must be excluded from the
comparison. It can only be populated by snapd, which runs
apparmor_parser when writing the key to disk (see WriteSystemKey);
a key generated by a client (e.g. "snap run") always leaves it
unset, because the client deliberately avoids invoking the parser.

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>
This fixes case where the system-key file is removed due to an
ongoing regeneration the SystemKeyMismatchAdvice check will
error due to missing file.

Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>
@ZeyadYasser ZeyadYasser added this to the 2.78 milestone Jul 30, 2026
@github-actions

Copy link
Copy Markdown

Thu Jul 30 13:27:45 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/30545303947

No spread failures reported

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.14%. Comparing base (d7c520b) to head (6c164ce).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #17418      +/-   ##
==========================================
- Coverage   78.81%   78.14%   -0.68%     
==========================================
  Files        1406     1406              
  Lines      197084   198809    +1725     
  Branches     2498     2498              
==========================================
+ Hits       155330   155354      +24     
- Misses      32387    34091    +1704     
+ Partials     9367     9364       -3     
Flag Coverage Δ
unittests 78.14% <100.00%> (-0.68%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant