Working with binary cookbook_file files


#1

I’m building a custom jetty cookbook to deploy some internal software here.

That software using jni so I have to set the LD_LIBRARY_PATH and bundle some
.so files for linux.

I’ve added my .so files to cookbook/files/linux-i686/libblah.so

In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty cookbook
runs, I get the error…

ERROR: Re-raising exception: Chef::Exceptions::FileNotFound - cookbook

custom-jetty does not contain file files/linux-i686/libblah.so

The path looks good to me, so I need to start digging. Where in the chef
server internals should I look to confirm that the files have uploaded
correctly?

Thanks for any help you can give.


#2

Hi,
while I hate to unload a wiki link on you,
http://wiki.opscode.com/display/chef/Files pretty much tells you all
you need to know. :slight_smile:
(you need to put the files in files/default, not files)
-Thom

On Tue, Oct 5, 2010 at 10:43, Luke Biddell luke.biddell@gmail.com wrote:

I’m building a custom jetty cookbook to deploy some internal software here.
That software using jni so I have to set the LD_LIBRARY_PATH and bundle some
.so files for linux.
I’ve added my .so files to cookbook/files/linux-i686/libblah.so
In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty cookbook
runs, I get the error…
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound - cookbook
custom-jetty does not contain file files/linux-i686/libblah.so
The path looks good to me, so I need to start digging. Where in the chef
server internals should I look to confirm that the files have uploaded
correctly?
Thanks for any help you can give.


#3

Thanks Thom, I’ll check it out. It’s somewhat misleading then that the
logging ties up.

On 5 October 2010 10:57, Thom May thom@clearairturbulence.org wrote:

Hi,
while I hate to unload a wiki link on you,
http://wiki.opscode.com/display/chef/Files pretty much tells you all
you need to know. :slight_smile:
(you need to put the files in files/default, not files)
-Thom

On Tue, Oct 5, 2010 at 10:43, Luke Biddell luke.biddell@gmail.com wrote:

I’m building a custom jetty cookbook to deploy some internal software
here.
That software using jni so I have to set the LD_LIBRARY_PATH and bundle
some
.so files for linux.
I’ve added my .so files to cookbook/files/linux-i686/libblah.so
In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty
cookbook
runs, I get the error…
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook
custom-jetty does not contain file files/linux-i686/libblah.so
The path looks good to me, so I need to start digging. Where in the chef
server internals should I look to confirm that the files have uploaded
correctly?
Thanks for any help you can give.


#4

Yup - that was it. Thanks Thom.

Shame the logging doesn’t include the default part of the path so you know
you’ve fallen through the conditions and not matched. ie

ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook custom-jetty does not contain file
files/default/linux-i686/libblah.so

Then you’d have a clue. RTFM though, fair enough.

On 5 October 2010 13:20, Luke Biddell luke.biddell@gmail.com wrote:

Thanks Thom, I’ll check it out. It’s somewhat misleading then that the
logging ties up.

On 5 October 2010 10:57, Thom May thom@clearairturbulence.org wrote:

Hi,
while I hate to unload a wiki link on you,
http://wiki.opscode.com/display/chef/Files pretty much tells you all
you need to know. :slight_smile:
(you need to put the files in files/default, not files)
-Thom

On Tue, Oct 5, 2010 at 10:43, Luke Biddell luke.biddell@gmail.com
wrote:

I’m building a custom jetty cookbook to deploy some internal software
here.
That software using jni so I have to set the LD_LIBRARY_PATH and bundle
some
.so files for linux.
I’ve added my .so files to cookbook/files/linux-i686/libblah.so
In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files
listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty
cookbook
runs, I get the error…
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook
custom-jetty does not contain file files/linux-i686/libblah.so
The path looks good to me, so I need to start digging. Where in the chef
server internals should I look to confirm that the files have uploaded
correctly?
Thanks for any help you can give.


#5

I guess it’s somewhat tricky in that it might not be default, and
listing all the
things it /could/ be would be rather sucky.

On Tue, Oct 5, 2010 at 13:43, Luke Biddell luke.biddell@gmail.com wrote:

Yup - that was it. Thanks Thom.
Shame the logging doesn’t include the default part of the path so you know
you’ve fallen through the conditions and not matched. ie
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook custom-jetty does not contain file
files/default/linux-i686/libblah.so

Then you’d have a clue. RTFM though, fair enough.

On 5 October 2010 13:20, Luke Biddell luke.biddell@gmail.com wrote:

Thanks Thom, I’ll check it out. It’s somewhat misleading then that the
logging ties up.

On 5 October 2010 10:57, Thom May thom@clearairturbulence.org wrote:

Hi,
while I hate to unload a wiki link on you,
http://wiki.opscode.com/display/chef/Files pretty much tells you all
you need to know. :slight_smile:
(you need to put the files in files/default, not files)
-Thom

On Tue, Oct 5, 2010 at 10:43, Luke Biddell luke.biddell@gmail.com
wrote:

I’m building a custom jetty cookbook to deploy some internal software
here.
That software using jni so I have to set the LD_LIBRARY_PATH and bundle
some
.so files for linux.
I’ve added my .so files to cookbook/files/linux-i686/libblah.so
In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files
listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty
cookbook
runs, I get the error…
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook
custom-jetty does not contain file files/linux-i686/libblah.so
The path looks good to me, so I need to start digging. Where in the
chef
server internals should I look to confirm that the files have uploaded
correctly?
Thanks for any help you can give.


#6

I disagree. There’s only 4 places it could be according to the docco. Saying
the file could not be found and listing those places would be useful. It’s
an exceptional circumstance and should not happen very often at all - more
information is better in this case.

Thanks for all the help and prompt responses.

On 5 October 2010 13:55, Thom May thom@clearairturbulence.org wrote:

I guess it’s somewhat tricky in that it might not be default, and
listing all the
things it /could/ be would be rather sucky.

On Tue, Oct 5, 2010 at 13:43, Luke Biddell luke.biddell@gmail.com wrote:

Yup - that was it. Thanks Thom.
Shame the logging doesn’t include the default part of the path so you
know
you’ve fallen through the conditions and not matched. ie
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook custom-jetty does not contain file
files/default/linux-i686/libblah.so

Then you’d have a clue. RTFM though, fair enough.

On 5 October 2010 13:20, Luke Biddell luke.biddell@gmail.com wrote:

Thanks Thom, I’ll check it out. It’s somewhat misleading then that the
logging ties up.

On 5 October 2010 10:57, Thom May thom@clearairturbulence.org wrote:

Hi,
while I hate to unload a wiki link on you,
http://wiki.opscode.com/display/chef/Files pretty much tells you all
you need to know. :slight_smile:
(you need to put the files in files/default, not files)
-Thom

On Tue, Oct 5, 2010 at 10:43, Luke Biddell luke.biddell@gmail.com
wrote:

I’m building a custom jetty cookbook to deploy some internal software
here.
That software using jni so I have to set the LD_LIBRARY_PATH and
bundle

some
.so files for linux.
I’ve added my .so files to cookbook/files/linux-i686/libblah.so
In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files
listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty
cookbook
runs, I get the error…
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook
custom-jetty does not contain file files/linux-i686/libblah.so
The path looks good to me, so I need to start digging. Where in the
chef
server internals should I look to confirm that the files have
uploaded

correctly?
Thanks for any help you can give.


#7

Luke, this is a lovely ticket to file, and would be a great first patch. :slight_smile:

Adam

On Tue, Oct 5, 2010 at 6:52 AM, Luke Biddell luke.biddell@gmail.com wrote:

I disagree. There’s only 4 places it could be according to the docco. Saying
the file could not be found and listing those places would be useful. It’s
an exceptional circumstance and should not happen very often at all - more
information is better in this case.

Thanks for all the help and prompt responses.
On 5 October 2010 13:55, Thom May thom@clearairturbulence.org wrote:

I guess it’s somewhat tricky in that it might not be default, and
listing all the
things it /could/ be would be rather sucky.

On Tue, Oct 5, 2010 at 13:43, Luke Biddell luke.biddell@gmail.com wrote:

Yup - that was it. Thanks Thom.
Shame the logging doesn’t include the default part of the path so you
know
you’ve fallen through the conditions and not matched. ie
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook custom-jetty does not contain file
files/default/linux-i686/libblah.so

Then you’d have a clue. RTFM though, fair enough.

On 5 October 2010 13:20, Luke Biddell luke.biddell@gmail.com wrote:

Thanks Thom, I’ll check it out. It’s somewhat misleading then that the
logging ties up.

On 5 October 2010 10:57, Thom May thom@clearairturbulence.org wrote:

Hi,
while I hate to unload a wiki link on you,
http://wiki.opscode.com/display/chef/Files pretty much tells you all
you need to know. :slight_smile:
(you need to put the files in files/default, not files)
-Thom

On Tue, Oct 5, 2010 at 10:43, Luke Biddell luke.biddell@gmail.com
wrote:

I’m building a custom jetty cookbook to deploy some internal
software
here.
That software using jni so I have to set the LD_LIBRARY_PATH and
bundle
some
.so files for linux.
I’ve added my .so files to cookbook/files/linux-i686/libblah.so
In my recipe I refer to them like this…

cookbook_file “#{node[:jetty][:libraries_path]}/libblah.so” do
source "#{node[:os]}-#{node[:kernel][:machine]}/libblah.so"
end

…and I do "knife cookbook upload custom-jetty.

If I go to the admin console on the chef server, I don’t see files
listed
under the cookbook, I only see “Attribute Files”, “Recipe Files” and
"Template Files".

On the machine that’s running the chef-client, when my custom-jetty
cookbook
runs, I get the error…
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound -
cookbook
custom-jetty does not contain file files/linux-i686/libblah.so
The path looks good to me, so I need to start digging. Where in the
chef
server internals should I look to confirm that the files have
uploaded
correctly?
Thanks for any help you can give.


Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com