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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 6.0.5
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Sub-team:
    • Team:
      Froyo
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      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.

      ORIGINAL


      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:

      '/primary':
        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

       

        Attachments

          Activity

            People

            Assignee:
            skenny Stephen Kenny
            Reporter:
            skenny Stephen Kenny
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support