Project

General

Profile

Actions

Bug #18868

closed

unable to submit Parallels PSBM facts

Added by Tim Meusel about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Facts
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I operate many PSBM (Paralells Server for Bare Metall) nodes. This is a patched CentOS 6 based operating system from parallels. The facts are a bit different to a normal CentOS 6 machine. You can see an example here: https://github.com/theforeman/puppet-puppet/pull/487

I get a long error when I try to submit the facts to foreman:

2017-03-11 11:49:38 df26fb2c [app] [W] Action failed 
 | ActiveRecord::RecordInvalid: Validation failed: Minor version is not a number
...
2017-03-11 11:49:38 df26fb2c [app] [I]   Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (0.6ms) 
2017-03-11 11:49:38 df26fb2c [app] [I] Completed 500 Internal Server Error in 909ms (Views: 1.5ms | ActiveRecord: 354.1ms)

The full error message:
https://gist.github.com/bastelfreak/204cabf82f428b47c3881a30071dc6df

The facts are available here:
https://gist.github.com/bastelfreak/2c396428e3435aec77bb8bf998a16bb7#file-gistfile1-txt-L98

I had to trim some sensitive information, but I guess the os hash is the important one. I'm running the latest foreman on CentOS 7:

~ # rpm -qa | grep foreman
tfm-rubygem-foreman_hooks-0.3.13-1.fm1_14.el7.noarch
tfm-rubygem-foreman_column_view-0.3.0-1.fm1_14.el7.noarch
foreman-release-scl-3-1.el7.noarch
tfm-rubygem-foreman-tasks-core-0.1.1-1.fm1_14.el7.noarch
foreman-selinux-1.14.2-1.el7.noarch
foreman-1.14.2-1.el7.noarch
tfm-rubygem-puppetdb_foreman-2.0.0-1.fm1_14.el7.noarch
tfm-rubygem-foreman-tasks-0.8.6-1.fm1_14.el7.noarch
foreman-postgresql-1.14.2-1.el7.noarch
foreman-debug-1.14.2-1.el7.noarch
foreman-proxy-1.14.2-1.el7.noarch
~ #

And the packages on my puppetserver/foreman-proxy node:

~ # rpm -qa | grep foreman
foreman-postgresql-1.14.2-1.el7.noarch
tfm-rubygem-foreman-tasks-0.8.6-1.fm1_14.el7.noarch
tfm-rubygem-foreman_hooks-0.3.13-1.fm1_14.el7.noarch
tfm-rubygem-foreman-tasks-core-0.1.1-1.fm1_14.el7.noarch
foreman-selinux-1.14.2-1.el7.noarch
tfm-rubygem-puppetdb_foreman-2.0.0-1.fm1_14.el7.noarch
foreman-debug-1.14.2-1.el7.noarch
foreman-1.14.2-1.el7.noarch
foreman-proxy-selinux-1.14.2-1.el7.noarch
tfm-rubygem-foreman_column_view-0.3.0-1.fm1_14.el7.noarch
foreman-release-scl-3-1.el7.noarch
foreman-proxy-1.14.2-1.el7.noarch

I digged through my logs. I started with foreman 1.14.0. This bug was already present in that release and all upcoming. Let me know if you need any additional information

Actions #1

Updated by Anonymous about 7 years ago

  • Category set to Facts

could you try the following patch?

diff --git a/app/services/puppet_fact_parser.rb b/app/services/puppet_fact_parser.rb
index 0c1453d06..31c019054 100644
--- a/app/services/puppet_fact_parser.rb
+++ b/app/services/puppet_fact_parser.rb
@@ -28,6 +28,9 @@ class PuppetFactParser < FactParser
         orel.gsub!(/\-RELEASE\-p[0-9]+/, '')
       elsif os_name[/Solaris/i]
         orel.gsub!(/_u/, '.')
+      elsif os_name[/PSBM/i]
+        majorpsbm, minorpsbm = orel.split(".")
+        orel = majorpsbm + "." + minorpsbm
       end
       major, minor = orel.split('.', 2)
       major = major.to_s.gsub(/\D/, '')

Actions #2

Updated by Tim Meusel about 7 years ago

Moin,
thanks for the quick patch! This is working very good. Facts are now properly submitted and the nodes are listed as "PSBM 2.6" in the foreman UI.

Actions #3

Updated by Anonymous about 7 years ago

Allright. Would it be possible to get a full, unobfuscated output of "facter --json" from such an install (some install in a VM is sufficient)? Otherwise I'd have to mingle one from CentOS 6 facts and your gist to have a testset.

Actions #4

Updated by Tim Meusel about 7 years ago

This should work: https://gist.github.com/bastelfreak/d755fe22dffbddd03e74228a4660c3e8

I removed a few mountpoints to make it more readable and replaced some critical information with "REMOVED". IP-Adresses got replaced with fake ones.But this should be a functional json. let me know if you need any additional information.

Actions #5

Updated by The Foreman Bot about 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Anonymous
  • Pull request https://github.com/theforeman/foreman/pull/4369 added
Actions #6

Updated by Anonymous about 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #7

Updated by Ohad Levy almost 7 years ago

  • translation missing: en.field_release set to 209
Actions

Also available in: Atom PDF