The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #6678

zone type fails with internal error when :ip is not specified (type lacks appropriate parameter validation)

Added by Anonymous over 3 years ago. Updated about 2 years ago.

Status:ClosedStart date:03/10/2011
Priority:NormalDue date:
Assignee:Rahul Gopinath% Done:

0%

Category:usability
Target version:3.0.0
Affected Puppet version:development Branch:https://github.com/puppetlabs/puppet/pull/955
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

We fail trying to split ‘nil’ internally, because of insufficient validation done in the type.

zone { "foo": }
private method `split' called for nil:NilClass
# lib/puppet/type/zone.rb:441:in `validate'
# lib/puppet/type.rb:1751:in `initialize'

Extracting this behaviour requires either Solaris, or stubbing enough of the provider code to pretend we are.

This seems to be a pattern in these type, and presumably providers, where they simply don’t do enough validation early enough on their inputs. We also don’t actually test those, which means we don’t detect this sort of problem earlier in the picture.


Related issues

Related to Puppet - Feature #4296: Zone type should have defrouter parameter Closed 07/20/2010
Blocked by Puppet - Bug #7175: Zone provider unable to create new zones since 0.24.8 Closed 04/20/2011

History

#1 Updated by James Turnbull over 3 years ago

See also #4296

#2 Updated by Ben Hughes over 3 years ago

  • Status changed from Unreviewed to Code Insufficient
  • Assignee set to Ben Hughes

Who’s best to speak to about this?

I’ve added some simple validation of requiring ip in the type, assuming all zones should have an IP, but I don’t really know Solaris zones at all so don’t know what’s required.

[ben@solaris:~]% cat zone.pp
zone{ "foo": }
[ben@solaris:~]% puppet apply -v zone.pp
Attribute 'ip' is mandatory

#3 Updated by Anonymous over 3 years ago

I can’t assist: other than noting the problem, I don’t know the underlying tools at all so can’t comment on what is or isn’t require. Perhaps git blame can shed some light on appropriate people to contact directly?

#4 Updated by Devon Peters almost 3 years ago

  • Assignee changed from Ben Hughes to Devon Peters

#5 Updated by Devon Peters almost 3 years ago

  • Assignee changed from Devon Peters to Anonymous

The only required parameter for creating a zone should be the path – that way there’s a location on disk to create it at. It’s certainly possible (though with limited usefulness) to have a zone with no IP configured. I’d be happy to help out with this, or provide any details/testing to help get this fixed.

#6 Updated by Anonymous almost 3 years ago

  • Assignee deleted (Anonymous)

Devon Peters wrote:

The only required parameter for creating a zone should be the path – that way there’s a location on disk to create it at. It’s certainly possible (though with limited usefulness) to have a zone with no IP configured. I’d be happy to help out with this, or provide any details/testing to help get this fixed.

Well, the main thing you could do is write the code. I would totally accept patches, but am unlikely to find time to address this before then. The platform team is at your disposal to help you get moving with that, of course.

#7 Updated by Ben Hughes over 2 years ago

so running ‘puppet resource zone’ which fails in a similar place points back to this commit https://github.com/puppetlabs/puppet/commit/a166d50c3c555a38ae13c1658b9afaefd583cfc9#L1R404. Will investigate more, but didn’t want to lose this info.

#8 Updated by Rahul Gopinath over 2 years ago

  • Status changed from Code Insufficient to In Topic Branch Pending Review
  • Assignee set to Rahul Gopinath
  • Target version set to 3.x
  • Branch set to emptyzone

#9 Updated by Rahul Gopinath over 2 years ago

  • Branch changed from emptyzone to https://github.com/puppetlabs/puppet/pull/955

#10 Updated by Rahul Gopinath about 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

#11 Updated by Josh Cooper about 2 years ago

  • Target version changed from 3.x to 3.0.0

#12 Updated by Matthaus Owens about 2 years ago

  • Status changed from Merged - Pending Release to Closed

Released in Puppet 3.0.0-rc4

Also available in: Atom PDF