Could not find resource, but it's there.

1,432 views
Skip to first unread message

chris smith

unread,
Jan 8, 2017, 8:52:53 PM1/8/17
to Puppet Users
Hi,

This seems like a pretty simple thing but I can't figure out why this is throwing a warning.

I'm using puppet 4.8.1 installed from the puppetlabs-pc1 on scientific linux 6.

# puppet -V
4.8.1
# rpm -q puppet-agent
puppet-agent-1.8.2-1.el6.x86_64


My file is as simple as I can make it:

    file {'/test':
        ensure => directory,
        alias => 'abc',
    }

    file {'/test/2':
        ensure => directory,
        require => File['abc'],
    }


When I run it, it complains:

# puppet apply test.pp
Warning: Could not find resource 'File[abc]' in parameter 'require'
   (at /root/test.pp:8)
Notice: Compiled catalog for sl-x86-64.local in environment production in 0.10 seconds
Notice: /Stage[main]/Main/File[/test]/ensure: created
Notice: /Stage[main]/Main/File[/test/2]/ensure: created
Notice: Applied catalog in 0.04 seconds

Though it seems to apply the resources in the correct order (I haven't had it fail trying to create /test/2 before /test).

Any info or ideas would be great.

Cheers,
Chris.

Henrik Lindberg

unread,
Jan 9, 2017, 5:56:30 AM1/9/17
to puppet...@googlegroups.com
The reason it works is because the default ordering is "manifest order"
and your manifest has the resources in the correct order.

The reference File['abc'] does not succeed because 'abc' is an alias,
and not the title - I believe there is a ticket about that already logged.

- henrik


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Thomas Müller

unread,
Jan 10, 2017, 12:47:09 AM1/10/17
to Puppet Users
Wouldnt it work anyways (if manifest order or not) because the file typeauto-reqires its parents?

https://docs.puppet.com/puppet/latest/types/file.html#file-description

-Thomas

Rob Nelson

unread,
Jan 10, 2017, 9:41:56 AM1/10/17
to Puppet Users
The auto-require would succeed, but the additional require could still fail to find the resource, which fails catalog compilation entirely.

Josh Cooper

unread,
Jan 10, 2017, 2:20:57 PM1/10/17
to puppet...@googlegroups.com

- henrik


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1d0fd21d-f1a2-5f41-b53d-b0de9c4873f8%40puppet.com.

For more options, visit https://groups.google.com/d/optout.



--
Josh Cooper
Developer, Puppet

Arpin Dominique (Nter)

unread,
Jan 10, 2017, 2:26:15 PM1/10/17
to puppet...@googlegroups.com

Hi,

 

Because you don’t use the right name…

 

    file {'/test':
        ensure => directory,
        alias => 'abc',
    }

    file {'/test/2':
        ensure => directory,

        require => File['/test'],
    }


Regards,

 

Dominique Arpin

Tél. Interne: 140-4156

Tél. 514 285.2929 Poste: 140-4156


De : puppet...@googlegroups.com [mailto:puppet...@googlegroups.com] De la part de Josh Cooper
Envoyé : 10 janvier, 2017 14:21
À : puppet...@googlegroups.com
Objet : Re: [Puppet Users] Could not find resource, but it's there.

 

 

 

To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.



 

--

Josh Cooper

Developer, Puppet

--

You received this message because you are subscribed to the Google Groups "Puppet Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2Bu97ukjvHzs1rcu4qb55VYeMy8DnyFX6L0Wihfx0FyVvrcWkQ%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.


Mise en garde concernant la confidentialité : Le présent message, comprenant tout fichier qui y est joint, est envoyé à l'intention exclusive de son destinataire; il est de nature confidentielle et peut constituer une information protégée par le secret professionnel. Si vous n'êtes pas le destinataire, nous vous avisons que toute impression, copie, distribution ou autre utilisation de ce message est strictement interdite. Si vous avez reçu ce courriel par erreur, veuillez en aviser immédiatement l'expéditeur par retour de courriel et supprimer le courriel. Merci!

Confidentiality Warning: This message, including any attachment, is sent only for the use of the intended recipient; it is confidential and may constitute privileged information. If you are not the intended recipient, you are hereby notified that any printing, copying, distribution or other use of this message is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email, and delete it. Thank you!

Chris

unread,
Jan 11, 2017, 4:14:05 PM1/11/17
to puppet...@googlegroups.com
On 11/01/17 06:20, Josh Cooper wrote:
>
> The reference File['abc'] does not succeed because 'abc' is an
> alias, and not the title - I believe there is a ticket about that
> already logged.
>
>
> Filed as https://tickets.puppetlabs.com/browse/PUP-6984

Ah, awesome - thanks!

--
Postgresql & php tutorials
http://www.designmagick.com/

Chris

unread,
Jan 11, 2017, 4:15:08 PM1/11/17
to puppet...@googlegroups.com
On 11/01/17 06:26, Arpin Dominique (Nter) wrote:
> Because you don’t use the right name…
>

I was using the alias name, which should also work.

The bug report explains things.

Cheers,
Reply all
Reply to author
Forward
0 new messages