troubleshoot puppet install order

LukeChavers asked:

My puppet agent run fails initially, then succeeds on the second run. I understand that it probably has to do with my execution order, and a dependency is being added later on in the execution process.

However, I cannot figure out what the missing dependency is, are there any troubleshooting practices that might help me to figure it out?

Here’s my error:

CXX(target) Release/obj.target/contextify/src/contextify.o
make: g++: Command not found
make: *** [Release/obj.target/contextify/src/contextify.o] Error 127

.. which occurs as my puppet class is trying to install an NPM module with:

/usr/bin/node /usr/bin/npm install --global log.io --user 'monitor'

Additional points that may be relevant

  • I understand the failure is related to the g++ binary, but I do not see where any of the catalog beyond this failure could install g++ (I assume I should find a ‘gcc’ or ‘make’ package, or a package that has one of those as a dependency)
  • This failure does not occur in my Vagrant testing environment, but only when trying to provision an AWS instance
  • Running CentOS 6.4

Thank you for your help!

My answer:


You probably didn’t provision a minimal server with Vagrant, so all the packages you needed were already installed.

You can locate the package you need with yum:

yum whatprovides '*/g++'

This works whether or not the package is installed.

You can then include the named package in an appropriate place in one of your classes:

package { 'gcc-c++':
    ensure => installed,
}

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.