Sun java install apt-get update

Hi *,

What a difference a day made :frowning:

Yesterday i finished a chef config which worked well. Running it today i get caught by external dependecies:

[Thu, 28 Apr 2011 13:50:17 +0000] INFO: Setting mode to 644 for file[/etc/apt/sources.list.d/ubuntu-partner-source.list]
[Thu, 28 Apr 2011 13:50:38 +0000] ERROR: apt_repository[ubuntu-partner] (/var/chef-solo/cookbooks/java/recipes/sun.rb:32:in from_file') had an error: apt-get update returned 100, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/…/lib/chef/mixin/command.rb:131:in run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/execute.rb:49:inaction_run’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/…/lib/chef/resource.rb:395:in send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:inrun_action’
/var/chef-solo/cookbooks/apt/providers/repository.rb:59:in class_from_file' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:ininstance_eval’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/…/lib/chef/provider.rb:104:in `action_add’

so I searched the mailing list and found there is a apt recipe with a cache / cache-client config

so is it possible to pre-load apt with external apt_repository information and share this on a client run?

what would it take? A instance with apt::cache and a recipe which does add this repos?

cu edi


DI Edmund Haselwanter, edmund@haselwanter.com, http://edmund.haselwanter.com/
http://www.iteh.at | http://facebook.com/iTeh.solutions | http://at.linkedin.com/in/haselwanteredmund

On Thursday, April 28, 2011 at 7:21 AM, Haselwanter Edmund wrote:
Hi *,

What a difference a day made :frowning:

Yesterday i finished a chef config which worked well. Running it today i get caught by external dependecies:

[Thu, 28 Apr 2011 13:50:17 +0000] INFO: Setting mode to 644 for file[/etc/apt/sources.list.d/ubuntu-partner-source.list]
[Thu, 28 Apr 2011 13:50:38 +0000] ERROR: apt_repository[ubuntu-partner] (/var/chef-solo/cookbooks/java/recipes/sun.rb:32:in from_file') had an error: apt-get update returned 100, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/mixin/command.rb:184:in handle_command_failures'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/mixin/command.rb:131:in run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/execute.rb:49:in action_run'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in run_action'
/var/chef-solo/cookbooks/apt/providers/repository.rb:59:in class_from_file' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in instance_eval'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in `action_add'

so I searched the mailing list and found there is a apt recipe with a cache / cache-client config

so is it possible to pre-load apt with external apt_repository information and share this on a client run?

what would it take? A instance with apt::cache and a recipe which does add this repos?

I haven't used the apt cacher yet, but does running apt-get update resolve the problem? Alternatively, can you run with -l debug to get the explanation of the error?

--
Dan DeLeo
cu edi

--
DI Edmund Haselwanter, edmund@haselwanter.com, http://edmund.haselwanter.com/
http://www.iteh.at | Facebook | http://at.linkedin.com/in/haselwanteredmund

On 28.04.2011, at 17:44, Daniel DeLeo wrote:

On Thursday, April 28, 2011 at 7:21 AM, Haselwanter Edmund wrote:

Hi *,

What a difference a day made :frowning:

Yesterday i finished a chef config which worked well. Running it today i get caught by external dependecies:

[Thu, 28 Apr 2011 13:50:17 +0000] INFO: Setting mode to 644 for file[/etc/apt/sources.list.d/ubuntu-partner-source.list]
[Thu, 28 Apr 2011 13:50:38 +0000] ERROR: apt_repository[ubuntu-partner] (/var/chef-solo/cookbooks/java/recipes/sun.rb:32:in from_file') had an error: apt-get update returned 100, expected 0 /usr/lib/ruby/gems/1.8/gems//chef-0.9.16/bin/../lib/chef/mixin/command.rb:184:in handle_command_failures'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/mixin/command.rb:131:in run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider/execute.rb:49:in action_run'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/resource.rb:395:in run_action'
/var/chef-solo/cookbooks/apt/providers/repository.rb:59:in class_from_file' /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in instance_eval'
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/bin/../lib/chef/provider.rb:104:in `action_add'

so I searched the mailing list and found there is a apt recipe with a cache / cache-client config

so is it possible to pre-load apt with external apt_repository information and share this on a client run?

what would it take? A instance with apt::cache and a recipe which does add this repos?

I haven't used the apt cacher yet, but does running apt-get update resolve the problem? Alternatively, can you run with -l debug to get the explanation of the error?

it seems they did a update on the ubuntu partner apt_repo. running it manually on the commandline worked without a problem.

so what to do about such a problem? running against my own mirror of this partner repo? I though a step in between would be running against a cached local apt which i can update with cron. but that would require to add all needed repos outside a chef run?

--
Dan DeLeo

cu edi

--
DI Edmund Haselwanter, edmund@haselwanter.com, http://edmund.haselwanter.com/
http://www.iteh.at | Facebook | http://at.linkedin.com/in/haselwanteredmund

--
DI Edmund Haselwanter, edmund@haselwanter.com, http://edmund.haselwanter.com/
http://www.iteh.at | Facebook | http://at.linkedin.com/in/haselwanteredmund

On Thu, Apr 28, 2011 at 10:26 AM, Haselwanter Edmund
edmund@haselwanter.com wrote:

On Thursday, April 28, 2011 at 7:21 AM, Haselwanter Edmund wrote:

[Thu, 28 Apr 2011 13:50:17 +0000] INFO: Setting mode to 644 for
file[/etc/apt/sources.list.d/ubuntu-partner-source.list]
[Thu, 28 Apr 2011 13:50:38 +0000] ERROR: apt_repository[ubuntu-partner]
(/var/chef-solo/cookbooks/java/recipes/sun.rb:32:in `from_file') had an
error:
apt-get update returned 100, expected 0

it seems they did a update on the ubuntu partner apt_repo. running it
manually on the commandline worked without a problem.

If there is an issue with a repository, such as a timeout or a key
problem, "apt-get update" will exit with 100.

When running a periodic apt-get update, I tend to ignore failure:

execute "apt-get-update" do
ignore_failure true
command "apt-get update"
end

Note that ignore_failure supersedes the old attribute epic_fail.

It might look a little more correct to specify that you expect specific failure:

execute "apt-get-update" do
returns [0, 100]
command "apt-get update"
end

When you do add keys or a new repository, you can't do this because
you need to be sure the changes occurred. In the past, I've used
Ubuntu's update-notifier framework to handle updating the apt cache.

Run apt-get update to create the stamp file

execute "apt-get-update" do
ignore_failure true
command "apt-get update"
not_if do File.exists?('/var/lib/apt/periodic/update-success-stamp') end
end

provides /var/lib/apt/periodic/update-success-stamp on apt-get update

package "update-notifier-common" do
ignore_failure true
notifies :run, resources(:execute => "apt-get-update"), :immediately
end

execute "apt-get-update-periodic" do
epic_fail true
command "apt-get update"
only_if do
File.exists?('/var/lib/apt/periodic/update-success-stamp') &&
File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400
end
end

Bryan