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

Udev fact exceeds the number of facts limit #314

Closed
bitcrush opened this issue Jan 27, 2023 · 15 comments · Fixed by #316
Closed

Udev fact exceeds the number of facts limit #314

bitcrush opened this issue Jan 27, 2023 · 15 comments · Fixed by #316

Comments

@bitcrush
Copy link

The new udev fact introduced in v4.0.0 of the module seems to create a high number of nested facts, which on my nodes exceeds the default limit of 2048 by a lot. Is this actually intended behaviour?

Info: Loading facts
Warning: The current total number of facts: 11210 exceeds the number of facts limit: 2048
@jhoblitt
Copy link
Member

jhoblitt commented Jan 28, 2023

Yes, this was anticipated. The fact warning threshold Is fairly arbitrary and my production envs were over the default value without this fact. Is a blurb in the README a needed?

@bitcrush
Copy link
Author

Thank you for the clarification. I think a small note in the README would be reasonable as the fact alone seems to exceed the soft limit on most Linux systems.

@jhoblitt
Copy link
Member

I'll add a blurb to the docs. Do you have a sense of how many "facts" this change added to your nodes and what the total was prior?

@bitcrush
Copy link
Author

Thanks! The total prior adding the fact was 755. So the number added by it would be 10455.

@jhoblitt
Copy link
Member

Thank you. If this fact ends up causing problems we can probably do something like add an external fact that can be used as a switch to turn it on and off.

@ekohl
Copy link
Member

ekohl commented Jan 29, 2023

Should this fact rather be opt-in then?

@jhoblitt
Copy link
Member

The pre-merge discussion was a long term goal of to try to move this fact into core facter. I don't consider the agent's fact limit warning a problem per se. I suspect most sites have > 2k facts and have adjusted and/or are ignoring the warning. I'd rather not preemptively disable the fact unless causes real world problems. My largest concern is the fact might be slow (> 1s) on some systems.

@ekohl
Copy link
Member

ekohl commented Jan 30, 2023

My biggest concern is systems which store facts in their database, such as PuppetDB and Foreman may take a large hit as well.

@jhoblitt
Copy link
Member

I increased the max number of facts in foreman to capture all the data. I'm also injecting the fact into the foreman discovery image.

@antaflos
Copy link

This fact (feature) should definitely be opt-in. We managed to kill our Foreman instance multiple times with errors related to pushing facts from Puppet servers to Foreman once we updated puppet-systemd to 4.0.0. The udev facts seem to get particularly numerous on bare metal hosts (Dell PowerEdge R6525 in this case) and resulted in scary looking error logs like these in Foreman's production.log:

2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::path could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::name could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::property::DEVNAME could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::property::DEVPATH could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::property::MAJOR could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::property::MINOR could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty50::property::SUBSYSTEM could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty51::path could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty51::name could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty51::property::DEVNAME could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty51::property::DEVPATH could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty51::property::MAJOR could not be imported because of Validation failed: Fact name has already been taken
2023-01-30T11:32:55 [E|app|efebb1b1] Fact udev::path::/devices/virtual/tty/tty51::property::MINOR could not be imported because of Validation failed: Fact name has already been taken

And the push facts script on the Puppet servers also complained:

During fact upload occured an exception: Net::ReadTimeout
Could not send facts to Foreman: Net::ReadTimeout

It also resulted in Foreman adding that particular Dell server multiple times to its list of hosts:

kvmhost11-duplicated-blurred

After downgrading puppet-systemd and manually cleaning up all of the facts and reports collected on the Puppet servers it now seems to run stable again.

So yeah, please make this udev fact feature optional.

@jhoblitt
Copy link
Member

@antaflos Ugh. I think we will need to do a major version bump to back it out.

Out of curiosity, what version of foreman are you running? Could you share a udevdb dump from one of the R6525s to add to the test fixtures?

@antaflos
Copy link

@jhoblitt We are on Foreman 3.4.1 (on Ubuntu 20.04), so more or less up to date, I think. Of course I can provide a udev dump; do you have a command in mind I should run? Something like udevadm info --export-db?

@jhoblitt
Copy link
Member

@antaflos udevadm info -e > foo.txt should be sufficient.

There is still discussion ongoing on slack as to if we are going to disable this fact or remove it completely. Hopefully, we will get a patch release out today or tomorrow.

@antaflos
Copy link

Ok @jhoblitt, here you go:

udevdump.txt

@jhoblitt jhoblitt added the bug Something isn't working label Jan 30, 2023
@jhoblitt
Copy link
Member

The fixed will be included in the #317 release.

@bastelfreak bastelfreak added skip-changelog and removed bug Something isn't working labels Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants