Closed chrisduong closed 10 years ago
Based on the information you provided me, I do not know what is wrong. There are a couple of things that could be at play here.
berks
. I would make sure that Berkshelf works for you outside of knife-container. You could do this by simply running berks install
in your terminal from your docker context directory. docker build
. It possible that your build froze at another location but the logs just didn't make it to STDOUT yet. I would take a look at the docker logs for that intermediate container to see if anything else shows up.Also, does this happen repeatedly? Does it happen every time you run knife container docker build
?
Hi,
I tried to use Berkshelf to manage dependencies in apache2 cookbook and all of its dependencies. And knife container docker build again. It still stops responding right after "fetching all cookbook index"
➜ precise64.cookbook knife container docker build chef/precise_apache2 -VV 3.1.3 Resolving cookbook dependencies... Fetching cookbook index from https://api.berkshelf.com... Using apache2 (2.0.0) Using iptables (0.13.2) Using logrotate (1.6.0) Using pacman (1.1.1)
The container has not been created and launched yet
Maybe my internet connection is not good. I'm still debugging, I'll let you know when I found sth.
Based on your output it looks like it is freezing during the berks upload
phase. Can you please run the following commands from your context directory and share the output? That might indicate whether there is a problem or if your connection is simply slow.
$ berks install -d
$ berks upload -d
Hi,
berks install -d && berks upload -d look normal. Now, I'm facing the new problem
➜ precise64.cookbook knife container docker build chef/precise_apache2 -VV
3.1.3
Resolving cookbook dependencies...
Fetching cookbook index from https://api.berkshelf.com...
Using apache2 (2.0.0)
Using logrotate (1.6.0)
Using iptables (0.13.2)
Using pacman (1.1.1)
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:357:in each': task was terminated (Celluloid::Task::TerminatedError) from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:357:in
cleanup'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:341:in shutdown' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:333:in
handle_crash'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:162:in rescue in run' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:148:in
run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor.rb:130:in block in start' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/thread_handle.rb:13:in
block in initialize'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/actor_system.rb:32:in block in get_thread' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/internal_pool.rb:99:in
call'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/internal_pool.rb:99:in block in create' from (celluloid):0:in
remote procedure call'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/calls.rb:92:in value' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0.pre2/lib/celluloid/proxies/sync_proxy.rb:33:in
method_missing'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/uploader.rb:54:in block (2 levels) in upload' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/uploader.rb:50:in
each'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/uploader.rb:50:in block in upload' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.0.0/lib/ridley/client.rb:36:in
open'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.0.0/lib/ridley.rb:51:in open' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf.rb:157:in
ridley_connection'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/uploader.rb:49:in upload' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/uploader.rb:36:in
run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/berksfile.rb:542:in upload' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:208:in
upload'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in
invoke_command'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:52:in
dispatch'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:27:in
execute!'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.1.3/bin/berks:5:in <top (required)>' from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/bin/berks:23:in
load'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/bin/berks:23:in `
It hangs right after that.
Can you share the full logs of that container by running docker logs <CONTAINER_ID>
?
Hi,
This time I remember to run chef shell-init in my current terminal since I'm using "chefdk" The docker build && init run successfully. The last logs are:
[2014-08-17T04:45:56+00:00] INFO: Processing service[apache2] action reload (apache2::default line 24) [2014-08-17T04:45:59+00:00] INFO: Chef Run complete in 501.470356953 seconds [2014-08-17T04:45:59+00:00] INFO: Running report handlers [2014-08-17T04:45:59+00:00] INFO: Report handlers complete [2014-08-17T04:45:59+00:00] INFO: Sending resource update report (run-id: 13ea30e9-c768-487c-ae59-90a82f9ee727) [2014-08-17T04:46:02+00:00] INFO: Deleting client key... ---> 1a41d1ae2172 Removing intermediate container f2c5980d55e4 Step 3 : RUN rm -rf /etc/chef/secure/* ---> Running in f46042cf720a ---> 5d8c2044019d Removing intermediate container f46042cf720a Step 4 : ENTRYPOINT ["chef-init"] ---> Running in 90d4197b003a ---> 9e637bc0e28f Removing intermediate container 90d4197b003a Step 5 : CMD ["--onboot"] ---> Running in b4877a8075b4 ---> 6ac06dfefb92 Removing intermediate container b4877a8075b4 Successfully built 6ac06dfefb92 WARNING: Deleted node chrisduong-precise_apache2-build WARNING: Deleted client chrisduong-precise_apache2-build
Maybe the gem library was messed up, sorry for this inconvience.
Hi,
I make Dockerfile with this command: $ knife container docker init chef/precise_apache2 -r 'recipe[apache2]' -b After successfully, I launch this: $ knife container docker build chef/precise_apache2 -VV The terminal open ➜ precise64.cookbook knife container docker build chef/precise_apache2 -VV Failed to load /home/cduong/.gemrc because it doesn't contain valid YAML hash 3.1.3 Resolving cookbook dependencies... Using apache2 (2.0.0) Using logrotate (1.6.0) Using iptables (0.13.2) Using pacman (1.1.1)
^C^C%
It had been running more than 5mins after the line "Using pacman ...". then I have to Control+C to break it. Please help, thanks.