Ask Your Question

How do I debug - Could not find relationship target "File[]" error

asked 2015-11-11 12:09:59 -0500

rewurzb gravatar image

I am creating and provisioning a virtual machine. The OS is CentOS. In the /var/log/messages log file I see the error

 Could not find relationship target "File[]"

but there isn't any other information. There are hundreds of file specs scattered across scores of manifest files. How do I get Puppet to tell me at least which manifest file contains the error?

I am not a Puppet guru and I inherited this project, so I know little about the specs themselves. If I can't find a way to narrow down the cause of the issue, I may have to go through every manifest to find it.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-11 16:08:55 -0500

GregLarkin gravatar image

Hi there,

The two messages at the top of this page ( present the same problem and the solution. The issue stems from a construct in your code that looks like this:

file { $myfilename:
  ensure => file,

If $myfilename is not defined, you will get the error that you saw. You should be able to find the error by using "puppet apply" on a test machine for all of the classes that might contain the failing code. Then you should be able to tell what variable is having a problem a fix it.

Hope that helps!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-11-11 12:09:59 -0500

Seen: 314 times

Last updated: Nov 11 '15