Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9560

master compile errors on upper case class ref with unknown class where apply works



    • Bug
    • Status: Closed
    • Low
    • Resolution: Won't Do
    • PUP 6.0.5
    • None
    • Compiler
    • None
    • Froyo
    • Needs Assessment
    • Needs Assessment


      This was initially reported as related to hiera and lookup, but when problem was reproduced it was triggered without hiera/lookup being involved. In essence a Class[test] reference works when using apply, but not when compiling via the master - changing the test to Test makes it work on the master.


      Puppet Version: 6.0.5-1stretch
      Puppet Server Version: 6.2.0-1stretch 
      OS Name/Version: Debian 9

      I'm using the lookup function to create a file resource from Hiera data:

        ensure: 'directory'
        mode: '0755'
        owner: 'root'
        group: 'root'
        before: 'Class[nfs]'

      This results in the following error when the agent runs on the node:

      "Server Error: Invalid relationship:  File[/primary] { before => Class[nfs] }, because Class[nfs] doesn't seem to be in the catalog".

      But here's the thing: if the first letter of the class name is capitalized - to be clear, as in Class[Nfs] - the agent run proceeds smoothly.  

      This is at odds with what happens if I create the file resource explicitly in a manifest.  In that case, it is not necessary to capitalize the class name in the "before =>" attribute.

      So on the face of it, it seems something is amiss in the Hiera lookup, or parsing, or ... something ...

      (Incidentally, this happens no matter which class I'm referencing - it's not restricted to the "nfs" (derdanne-nfs module) class.)

      Stephen Kenny





            skenny Stephen Kenny
            skenny Stephen Kenny
            0 Vote for this issue
            6 Start watching this issue



              Zendesk Support