# Chef-Shell with local mode?

**URL:** <https://discourse.chef.io/t/chef-shell-with-local-mode/6583>\
**Category:** Chef Infra (archive)\
**Created:** [May 15, 2015, 6:50pm UTC](https://discourse.chef.io/t/chef-shell-with-local-mode/6583 "2015-05-15T18:50:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Helgeson](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eric_helgeson/32/67_2.png) [@Eric\_Helgeson](https://discourse.chef.io/u/Eric_Helgeson)\
**Post date:** [May 15, 2015, 6:50pm UTC](https://discourse.chef.io/t/chef-shell-with-local-mode/6583/1 "2015-05-15T18:50:31Z")

</div>

Ohai,

I was looking a chef-shell to do some interactive debugging. I’m using  
chef-zero provisioner in Vagrant.

It looks like chef-shell has a -z option, but that is not chef-zero, just  
chef-client mode. So I tried installing chef-zero gem on the machine and  
setting the chef\_server\_url “[http://localhost:8889](http://localhost:8889)”, to no avail. Always  
get a 404 when setting chef-zero --file-store.

I then tried to just use solo mode, but it’s not picking up any of the  
cookbook settings from solo.rb or the run\_list from dna.json

[vagrant@app-vagrant vagrant-chef]$ sudo chef-shell --solo -c  
/tmp/vagrant-chef/solo.rb -j /tmp/vagrant-chef/dna.json loading  
configuration: /tmp/vagrant-chef/solo.rb  
Session type: solo  
Loading…done.

This is the chef-shell.  
Chef Version: 12.3.0  
[http://www.chef.io/](http://www.chef.io/)  
[http://docs.chef.io/](http://docs.chef.io/)

run `help' for help,`exit’ or ^D to quit.

Ohai2u vagrant@app-vagrant!

chef \> cookbooks.all  
[2015-05-15T18:30:48+00:00] ERROR: Connection refused connecting to  
[https://localhost/cookbooks](https://localhost/cookbooks), retry 1/5  
Thoughts on how to get this up and running? Blogposts about this  
are fairly dated.

Thanks,  
-Eric Helgeson  
@nulleric [https://twitter.com/nulleric](https://twitter.com/nulleric)  
[https://usingchef.com](https://usingchef.com)

---

<div class="post-metadata">

**Author:** ![Ranjib](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ranjib/32/1040_2.png) [@Ranjib](https://discourse.chef.io/u/Ranjib)\
**Post date:** [May 15, 2015, 9:18pm UTC](https://discourse.chef.io/t/chef-shell-with-local-mode/6583/2 "2015-05-15T21:18:07Z")

</div>

chef-client -z internally uses chef-zero. it is intended to replace  
chef-solo and add search ability even in solo mode.  
unfortunately chef-shell uses -z for client session.  
i use `chef-client -z ` aka the new chef-solo extensively, as well as a  
chef-zero + chef-client .  
Can you try spin up chef-zero -d , and then chef-shell -z -c  
/path/to/knife.rb which reflects the chef-zero configs?

On Fri, May 15, 2015 at 11:50 AM, Eric Helgeson [erichelgeson@gmail.com](mailto:erichelgeson@gmail.com)  
wrote:

> Ohai,
> 
> I was looking a chef-shell to do some interactive debugging. I'm using  
> chef-zero provisioner in Vagrant.
> 
> It looks like chef-shell has a -z option, but that is not chef-zero, just  
> chef-client mode. So I tried installing chef-zero gem on the machine and  
> setting the chef\_server\_url "[http://localhost:8889](http://localhost:8889)", to no avail. Always  
> get a 404 when setting chef-zero --file-store.
> 
> I then tried to just use solo mode, but it's not picking up any of the  
> cookbook settings from solo.rb or the run\_list from dna.json
> 
> [vagrant@app-vagrant vagrant-chef]$ sudo chef-shell --solo -c  
> /tmp/vagrant-chef/solo.rb -j /tmp/vagrant-chef/dna.json loading  
> configuration: /tmp/vagrant-chef/solo.rb  
> Session type: solo  
> Loading.....done.
> 
> This is the chef-shell.  
> Chef Version: 12.3.0  
> [http://www.chef.io/](http://www.chef.io/)  
> [http://docs.chef.io/](http://docs.chef.io/)
> 
> run `help' for help, `exit' or ^D to quit.
> 
> Ohai2u vagrant@app-vagrant!
> 
> chef \> cookbooks.all  
> [2015-05-15T18:30:48+00:00] ERROR: Connection refused connecting to  
> [https://localhost/cookbooks](https://localhost/cookbooks), retry 1/5  
> Thoughts on how to get this up and running? Blogposts about this  
> are fairly dated.
> 
> Thanks,  
> -Eric Helgeson  
> @nulleric [https://twitter.com/nulleric](https://twitter.com/nulleric)  
> [https://usingchef.com](https://usingchef.com)

---

<div class="post-metadata">

**Author:** ![jtimberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jtimberman/32/8_2.png) [@jtimberman](https://discourse.chef.io/u/jtimberman)\
**Post date:** [May 15, 2015, 10:06pm UTC](https://discourse.chef.io/t/chef-shell-with-local-mode/6583/3 "2015-05-15T22:06:20Z")

</div>

Hi Eric,

You need to start chef-zero separately. chef-shell doesn't spawn any  
chef-zero processes.

E.g., in "terminal window 1":

% chef-zero

> > Starting Chef Zero (v4.2.1)...  
> > WEBrick (v1.3.1) on Rack (v1.6.1) is listening at [http://127.0.0.1:8889](http://127.0.0.1:8889)  
> > Press CTRL+C to stop

Then in "terminal window 2":

% chef-shell -z -S [http://localhost:8889](http://localhost:8889)

I'm not familiar with the 'zero --file-store option, though.

On Fri, May 15, 2015 at 12:50 PM, Eric Helgeson [erichelgeson@gmail.com](mailto:erichelgeson@gmail.com) wrote:

> Ohai,
> 
> I was looking a chef-shell to do some interactive debugging. I'm using  
> chef-zero provisioner in Vagrant.
> 
> It looks like chef-shell has a -z option, but that is not chef-zero, just  
> chef-client mode. So I tried installing chef-zero gem on the machine and  
> setting the chef\_server\_url "[http://localhost:8889](http://localhost:8889)", to no avail. Always get  
> a 404 when setting chef-zero --file-store.
> 
> I then tried to just use solo mode, but it's not picking up any of the  
> cookbook settings from solo.rb or the run\_list from dna.json
> 
> [vagrant@app-vagrant vagrant-chef]$ sudo chef-shell --solo -c  
> /tmp/vagrant-chef/solo.rb -j /tmp/vagrant-chef/dna.json loading  
> configuration: /tmp/vagrant-chef/solo.rb  
> Session type: solo  
> Loading.....done.
> 
> This is the chef-shell.  
> Chef Version: 12.3.0  
> [http://www.chef.io/](http://www.chef.io/)  
> [http://docs.chef.io/](http://docs.chef.io/)
> 
> run `help' for help, `exit' or ^D to quit.
> 
> Ohai2u vagrant@app-vagrant!
> 
> chef \> cookbooks.all  
> [2015-05-15T18:30:48+00:00] ERROR: Connection refused connecting to  
> [https://localhost/cookbooks](https://localhost/cookbooks), retry 1/5
> 
> Thoughts on how to get this up and running? Blogposts about this are fairly  
> dated.
> 
> Thanks,  
> -Eric Helgeson  
> @nulleric  
> [https://usingchef.com](https://usingchef.com)
