Project

General

Profile

Bug #29110

Uploading facts from Debian 10 (Buster) nodes returns error message from Foreman

Added by Martin Alfke 8 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
Facts
Target version:

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.

Associated revisions

Revision 5d61c18f (diff)
Added by Lukáš Zapletal 6 months ago

Fixes #29110 - updated fact parser to handle v3 debian OS (#7482)

History

#1 Updated by Lukas Zapletal 8 months ago

Smells like race condition. Try without --push-facts-parallel and also indlude full backtrace of the error.

#2 Updated by Robert Flechtner 8 months 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.

#3 Updated by Lukas Zapletal 8 months 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

#5 Updated by Ewoud Kohl van Wijngaarden 8 months 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\.]/, '')

#6 Updated by The Foreman Bot 8 months ago

  • Assignee set to Lukas Zapletal
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7482 added

#7 Updated by Lukas Zapletal 8 months ago

  • Target version set to 2.0.1

Requesting 2.0 backport, multiple users have reported this.

#8 Updated by Martin Alfke 7 months ago

Lukas Zapletal wrote:

Requesting 2.0 backport, multiple users have reported this.

Can we also receive a backport to 1.xx?

#9 Updated by The Foreman Bot 6 months ago

  • Fixed in Releases 2.1.0 added

#10 Updated by Anonymous 6 months ago

  • Status changed from Ready For Testing to Closed

#11 Updated by The Foreman Bot 6 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7631 added

#12 Updated by The Foreman Bot 6 months ago

  • Pull request https://github.com/theforeman/foreman/pull/7632 added

#13 Updated by Lukas Zapletal 6 months 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.

#14 Updated by Tomer Brisker 6 months ago

  • Fixed in Releases 1.24.3, 2.0.1, 2.1.0 added

#15 Updated by Amit Upadhye 6 months ago

  • Category set to Facts

Also available in: Atom PDF