Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookbook_file error gives incomplete list of search locations #1479

Closed
lindes opened this issue Jun 10, 2014 · 3 comments · Fixed by #7295
Closed

cookbook_file error gives incomplete list of search locations #1479

lindes opened this issue Jun 10, 2014 · 3 comments · Fixed by #7295
Labels
Type: Bug Does not work as expected.

Comments

@lindes
Copy link

lindes commented Jun 10, 2014

When using a cookbook_file directive, one of the locations that Chef looks for files is based on the FQDN of the hostname in question, prepended by host-. I'd missed the host- prepend in my reading of some instructions on this point, and was having a situation where Chef couldn't find the file; in doing so, it presented a list of locations that it had looked, but that list did not include the host-<FQDN> subdirectory.

The commit that introduced the current messaging is 16a45a4. I believe this should probably be referencing the preferences variable, since preferences_for_path seems to be what generates the list of files that are actually checked... But I'm not very familiar with this codebase, and don't have a chef development environment set up just now, so hence submitting a ticket rather than a pull request.

Here's an example of the error message, from inside a Vagrant configuration:

==> server: [2014-06-10T23:03:31+00:00] FATAL: Chef::Exceptions::FileNotFound: cookbook_file[/etc/foo.conf] (bcfg2::default line 4) had an error: Chef::Exceptions::FileNotFound: Cookbook 'foo' (0.0.0) does not contain a file at any of these locations:
==> server:   files/ubuntu-12.04/foo.conf
==> server:   files/ubuntu/foo.conf
==> server:   files/default/foo.conf

I would expect to have an extra line (above the ubuntu-12.04 line), like:

==> server:   files/host-my-server.example.com/foo.conf
@sersut
Copy link
Contributor

sersut commented Jun 11, 2014

Agreed @lindes. This would be a nice to have. Would be cool if you can spare some time to take a stab at this. Let us know if we can give some pointers to get you started on this.

@aronwoost
Copy link

+1

@lamont-granquist lamont-granquist added this to the Unassigned milestone Mar 4, 2015
@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 25, 2017
lamont-granquist added a commit that referenced this issue May 25, 2018
closes #1479

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lock
Copy link

lock bot commented Jul 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants