Project

General

Profile

Bug #2023

Don't try to save os=nil in the fact importer

Added by Greg Sutcliffe over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

(Was "Puppet run in Finish Template wipes Operating System field in DB")

It's possible to hit an edge case where the os field comes in as nil and we try to save a new OS with name=NULL to the DB, which fails validation. We should make that more defensive.

clean.log clean.log 23.2 KB Log of the problem happening Greg Sutcliffe, 12/09/2012 08:12 AM

Associated revisions

Revision a3d09f07 (diff)
Added by Dominic Cleal over 9 years ago

refs #2023 - always write using_storeconfigs default as a boolean

Revision 10130849 (diff)
Added by Ohad Levy over 9 years ago

fixes #2023 - Don't try to save os=nil in the fact importer

I've tried to address all possible places where empty set of facts (e.g. we
dont have the facts just yet as its a brand new install) could lead to the
operating system value disappering.

i believe the issue happened because of a boolean == string compareing (e.g.
some left overs in cache might lead to if "false" which is true.

I've also ensured that we get an exception if the operating system value is empty
or if it does not pass validations.

History

#1 Updated by Ohad Levy over 9 years ago

turn on sql debug and check the audit log too?

#2 Updated by Greg Sutcliffe over 9 years ago

The audit log definitely shows the OS being wiped. I turned on fulldebug, but it was so noisy I couldn't see anything useful. I'll try and get a full log pastie up tomorrow.

#3 Updated by Ohad Levy over 9 years ago

  • Priority changed from Urgent to Normal

I can't reproduce this, WFM

#4 Updated by Ohad Levy over 9 years ago

  • Assignee set to Greg Sutcliffe

#5 Updated by Greg Sutcliffe over 9 years ago

Log attached. This seems easily repeatable for me - set a host to "Build" and run Puppet - OS disappears. You can see a rollback/audit happening in the report processing section.

#6 Updated by Greg Sutcliffe over 9 years ago

  • Subject changed from Puppet run in Finish Template wipes Operating System field in DB to Don't try to save os=nil in the fact importer
  • Category changed from Host creation to Facts
  • Assignee deleted (Greg Sutcliffe)
  • Priority changed from Normal to Low
  • Target version deleted (1.1)

#7 Updated by Ohad Levy over 9 years ago

  • Target version set to 1.1

its not a nil os, rather a os with a nil name.

#8 Updated by Ohad Levy over 9 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ohad Levy
  • Priority changed from Low to Normal
  • % Done changed from 0 to 90

#9 Updated by Ohad Levy over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF