Project

General

Profile

Actions

Bug #29110

closed

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

Added by Martin Alfke about 4 years ago. Updated almost 4 years 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.

Actions #1

Updated by Lukas Zapletal about 4 years ago

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

Actions #2

Updated by Robert Flechtner about 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.

Actions #3

Updated by Lukas Zapletal about 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

Actions #5

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

Actions #6

Updated by The Foreman Bot about 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
Actions #7

Updated by Lukas Zapletal about 4 years ago

  • Target version set to 2.0.1

Requesting 2.0 backport, multiple users have reported this.

Actions #8

Updated by Martin Alfke about 4 years ago

Lukas Zapletal wrote:

Requesting 2.0 backport, multiple users have reported this.

Can we also receive a backport to 1.xx?

Actions #9

Updated by The Foreman Bot almost 4 years ago

  • Fixed in Releases 2.1.0 added
Actions #10

Updated by Anonymous almost 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #11

Updated by The Foreman Bot almost 4 years ago

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

Updated by The Foreman Bot almost 4 years ago

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

Updated by Lukas Zapletal almost 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.

Actions #14

Updated by Tomer Brisker almost 4 years ago

  • Fixed in Releases 1.24.3, 2.0.1, 2.1.0 added
Actions #15

Updated by Amit Upadhye almost 4 years ago

  • Category set to Facts
Actions

Also available in: Atom PDF