Bug #29110
closedUploading facts from Debian 10 (Buster) nodes returns error message from Foreman
Description
Running the fact upload on a Puppet master:
/opt/puppetlabs/puppet/bin/ruby /etc/puppetlabs/puppet/foreman_facts.rb --push-facts-parallel
Results in error messages from Debian Buster systems:
During the fact upload the server responded with: 500 Internal Server Error. Error is ignored and the execution continues.
{
"error": {"message":"Validation failed: Description has already been taken, Title has already been taken"}
}
No further log output available.
Any help appretiated.
Updated by Lukas Zapletal over 4 years ago
Smells like race condition. Try without --push-facts-parallel and also indlude full backtrace of the error.
Updated by Robert Flechtner over 4 years ago
I ran into the same issue. When Debian 10 facts are uploaded only the OS' major version is set in the title
and description
fields of the operatingsystems
table. This results in those fields always being set to "Debian 10"
independent of the minor
version fact, which is detected properly though and written to the minor
column of the table. This means that if Debian 10.0 facts have been uploaded before, the upload of Debian 10.1 facts will result in the Description has already been taken, Title has already been taken
error message.
Updated by Lukas Zapletal over 4 years ago
Sounds like a bug, here is the relevant code can you investigate? It should match minor and major versions:
https://github.com/theforeman/foreman/blob/develop/app/services/puppet_fact_parser.rb#L4-L40
Updated by Lukas Zapletal over 4 years ago
Updated by Ewoud Kohl van Wijngaarden over 4 years ago
Perhaps the core issue is that we don't deal with the change in Debian? Since Debian 7 the use of minor versions was dropped. Previously, Debian 6.0 and Debian 6.1 were seen as separate releases. With Debian 7, 7.0 an 7.1 are the same release. The .x is more like a .z in that sense. You can see this in the facter output as well:
$ facter os { architecture => "amd64", distro => { codename => "buster", description => "Debian GNU/Linux 10 (buster)", id => "Debian", release => { full => "10", major => "10" } }, family => "Debian", hardware => "x86_64", name => "Debian", release => { full => "10.3", major => "10", minor => "3" }, selinux => { enabled => false } }
Foreman still tries to parse the legacy facts itself and be smarter.
From Debian 9:
# facter lsbdistrelease 9.11
$ facter lsbdistrelease 10
I suspect the following code isn't smart enough about that.
major, minor = orel.split('.', 2) major = major.to_s.gsub(/\D/, '') minor = minor.to_s.gsub(/[^\d\.]/, '')
Updated by The Foreman Bot over 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Lukas Zapletal
- Pull request https://github.com/theforeman/foreman/pull/7482 added
Updated by Lukas Zapletal over 4 years ago
- Target version set to 2.0.1
Requesting 2.0 backport, multiple users have reported this.
Updated by Martin Alfke over 4 years ago
Lukas Zapletal wrote:
Requesting 2.0 backport, multiple users have reported this.
Can we also receive a backport to 1.xx?
Updated by Anonymous over 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 5d61c18fa7bdee314ac146ba6b35353c16c63b37.
Updated by The Foreman Bot over 4 years ago
- Pull request https://github.com/theforeman/foreman/pull/7631 added
Updated by The Foreman Bot over 4 years ago
- Pull request https://github.com/theforeman/foreman/pull/7632 added
Updated by Lukas Zapletal over 4 years ago
- Fixed in Releases deleted (
2.1.0)
Cherry picks for 2.0 and 1.24 are ready. The last call is on our release manager tho.
Updated by Tomer Brisker over 4 years ago
- Fixed in Releases 1.24.3, 2.0.1, 2.1.0 added