Page MenuHomePhabricator

Cant refresh Nodepool snapshot due to puppet: Could not find class passwords::puppet::database
Closed, ResolvedPublic

Description

The images do not have a private repo and any passwords would fail:

Applying puppet manifest /opt/git/integration/config/dib/puppet/ciimage.pp
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Notice: hiera(): Page Hiera:Hosts/ci-jessie-wikimedia-1472028399 is non-existent
Notice: hiera(): Page Hiera:Contintcloud/host/ci-jessie-wikimedia-1472028399 is non-existent
Error: Could not find class passwords::puppet::database for ci-jessie-wikimedia-1472028399.eqiad.wmflabs on node ci-jessie-wikimedia-1472028399.eqiad.wmflabs
Error: Could not find class passwords::puppet::database for ci-jessie-wikimedia-1472028399.eqiad.wmflabs on node ci-jessie-wikimedia-1472028399.eqiad.wmflabs
Puppet run failed. Exit code 1

Event Timeline

Git bisect on a Jessie image yields 8cfbc62e5d1c8657fd394728d1cf4d75952c91f3

commit 8cfbc62e5d1c8657fd394728d1cf4d75952c91f3
Author: Alexandros Kosiaris <akosiaris@wikimedia.org>
Date:   Mon Aug 1 20:12:55 2016 +0300

    include standard in a number of places
    
    Puppet 3.8 (at least) spews warning about
    Could not look up qualified variable '::standard::has_ganglia'; class
    ::standard has not been evaluated
    
    Try to fix it by including standard in all classes that use
    standard::has_ganglia and dont explicitly include the class
    
    Change-Id: I0904715036849da6dc6f2faff7448f7532691320

The puppet class standard is known to cause havoc as well as base which includes too many things.

Class we might be using when generating the images:

  • apache::monitoring
  • hhvm::monitoring
  • memcached

That is to fix up Could not look up qualified variable '::standard::has_ganglia'; class ::standard has not been evaluated. Maybe we can have that variable injected via hiera.

Removing the include standard from the apache module fix it:

diff --git a/modules/apache/manifests/monitoring.pp b/modules/apache/manifests/monitoring.pp
index 9aa7e13..dc6660b 100644
--- a/modules/apache/manifests/monitoring.pp
+++ b/modules/apache/manifests/monitoring.pp
@@ -7,7 +7,6 @@
 #
 class apache::monitoring {
     include ::apache::mod::status
-    include ::standard
 
     if $::standard::has_ganglia {
         include ::ganglia

@akosiaris I could use some assistance / idea on this one. For Nodepool I am provisioning lightweight base images that do not use ::standard and do not install ::base which adds too much packages to the image.

With 8cfbc62e5d1c8657fd394728d1cf4d75952c91f3 , you rightfully included ::standard in a few classes since they are checking $::standard::has_ganglia, that causes puppet to fail for me.

My aim is to avoid ::standard entirely, looks like on the image only apache::monitoring brings it up so maybe I can skip it. Or there might be a better fix to avoid coupling the various modules with ::standard.

I think the original issue related to puppetmaster class is gone.

The reason for Alexandros change is that some of our manifests have $::standard::has_ganglia and puppet 3.8 cant look it up. Hence why standard is added everywhere it is missing.

A similar issue is diamond::collector being included which add diamond as a service.

Maybe I can just override those two in the site.pp:

diff --git a/dib/puppet/ciimage.pp b/dib/puppet/ciimage.pp
index daaa770..718c83a 100644
--- a/dib/puppet/ciimage.pp
+++ b/dib/puppet/ciimage.pp
@@ -62,6 +62,19 @@ if os_version('debian >= jessie') {
     }
 }
 
+# Overrides
+class standard {
+
+}
+define diamond::collector(
+  $settings    = undef,
+  $ensure      = present,
+  $source      = undef,
+  $content     = undef,
+) {
+
+}
+
 # allow apache2 execution
 class apache2_allow_execution {
   exec { 'allow apache2 execution':

Change 308567 had a related patch set uploaded (by Hashar):
dib: override standard / diamond::collector

https://gerrit.wikimedia.org/r/308567

hashar claimed this task.

That fixed the build of both Jessie and Trusty images. I have confirmed that neither ::standard or diamond are included.

Change 308567 merged by jenkins-bot:
dib: override standard / diamond::collector

https://gerrit.wikimedia.org/r/308567

Mentioned in SAL [2016-09-05T14:08:11Z] <hashar> Refreshing Nodepool base images for Trusty and Jessie. Managed to build new ones after T143769

Cant refresh the snapshots since uploading the images fail with:

BadRequest: Invalid input for field/attribute properties. Value: {u'show': u'true'}. {u'show': u'true'} is not of type 'string' (HTTP 400)

That is unrelated.