Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for LP#2012284 #724

Merged
merged 3 commits into from
Oct 27, 2023

Conversation

rodrigogansobarbieri
Copy link
Contributor

Error creating Nova VM with AppArmor set
to "enforce": osinfo permission denied

Closes: #723

has_2012284:
input:
path: 'var/log/nova/nova-compute.log'
expr: ".+Failure prepping block device: gi.repository.GLib.GError: g-io-error-quark: Error opening directory '/usr/share/osinfo': Permission denied"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should have a timestamp match, at least all the existing nova ones have something like this:

([\d-]+) ([\d:]+).\d{3} .+Failure...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. However, I had to change the quotation marks and the ' in the message to a . because they cannot be escaped in yaml (as far as I could find)

type: LaunchpadBug
bug-id: 2012284
message: >-
known nova compute issue caused when package gir1.2-libosinfo-1.0 is installed
Copy link
Contributor

Choose a reason for hiding this comment

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

Known (although most of the other scenario messages are lower case :-/ )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

bug-id: 2012284
message: >-
known nova compute issue caused when package gir1.2-libosinfo-1.0 is installed
and apparmor is set to enforced. To fix the issue, the offending package needs to
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's actually "enforce" (without the d), at least according to the bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

has_2012284:
input:
path: 'var/log/nova/nova-compute.log'
expr: '([\d-]+) ([\d:]+).\d{3} .+Failure prepping block device: gi.repository.GLib.GError: g-io-error-quark: Error opening directory ./usr/share/osinfo.: Permission denied'
Copy link
Contributor

Choose a reason for hiding this comment

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

So now I see I commented the opposite in your other patch - let's wait for Ed to confirm which is correct.

@dosaboy
Copy link
Member

dosaboy commented Sep 21, 2023

I would like the check to also check that the package is installed and/or enforce mode is set. If the issue gets fixed but the logs still exist we dont want to the issue to be raised.

@dosaboy
Copy link
Member

dosaboy commented Oct 17, 2023

could also check whether or not nova-compute is in enforce or complain mode using #751

raised-bugs:
https://bugs.launchpad.net/bugs/2012284: >-
Known nova compute issue caused when package gir1.2-libosinfo-1.0 is installed
and apparmor is set to enforce. To fix the issue, the offending package needs to
Copy link
Member

Choose a reason for hiding this comment

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

now that the apparmor helper is available you can actually check what mode nova-compute is in e.g.

vars:
  nc_aa_mode: '@hotsos.core.host_helpers.apparmor.AAProfileFactory.mode:nova-compute'
checks:
  nc_in_enforce_mode:
    varops: [[$nc_aa_mode], [eq, enforce]]
...
``

- sos_commands/date/date
raised-bugs:
https://bugs.launchpad.net/bugs/2012284: >-
Known nova compute issue caused when package gir1.2-libosinfo-1.0 is installed
Copy link
Member

Choose a reason for hiding this comment

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

If this package was to be uninstalled we would want to stop raising this issue if we saw the log message since that would be a false positive. Can we add a check that the package is installed?

Error creating Nova VM with AppArmor set
to "enforce": osinfo permission denied
@rodrigogansobarbieri
Copy link
Contributor Author

rebased and addressed review feedback

@dosaboy
Copy link
Member

dosaboy commented Oct 27, 2023

lgtm thanks @rodrigogansobarbieri !

@dosaboy dosaboy merged commit d9ecc76 into canonical:main Oct 27, 2023
8 checks passed
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.

check for LP#2012284 - osinfo permission denied
3 participants