# Getting this error when I try to knife bootstrap on chef-workstation

**URL:** <https://discourse.chef.io/t/getting-this-error-when-i-try-to-knife-bootstrap-on-chef-workstation/10581>\
**Category:** Chef Infra (archive)\
**Created:** [March 14, 2017, 7:45pm UTC](https://discourse.chef.io/t/getting-this-error-when-i-try-to-knife-bootstrap-on-chef-workstation/10581 "2017-03-14T19:45:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayshah309](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@jayshah309](https://discourse.chef.io/u/jayshah309)\
**Post date:** [March 14, 2017, 7:45pm UTC](https://discourse.chef.io/t/getting-this-error-when-i-try-to-knife-bootstrap-on-chef-workstation/10581/1 "2017-03-14T19:45:35Z")

</div>

root@chefwork:~/.chef# knife bootstrap 172.31.219.206 -x jay -A --sudo -N chefnode  
Node chefnode exists, overwrite it? (Y/N) y  
Client chefnode exists, overwrite it? (Y/N) y  
Creating new client for chefnode  
Creating new node for chefnode  
Connecting to 172.31.219.206  
[jay@172.31.219.206](mailto:jay@172.31.219.206)’s password:  
172.31.219.206 knife sudo password:  
Enter your password:  
172.31.219.206  
172.31.219.206 -----\> Existing Chef installation detected  
172.31.219.206 Starting the first Chef Client run…  
172.31.219.206 [2017-03-14T12:37:28-07:00] INFO: Forking chef instance to converge…  
172.31.219.206 Starting Chef Client, version 12.19.36  
172.31.219.206 [2017-03-14T12:37:28-07:00] INFO: \*\*\* Chef 12.19.36 \*\*\*  
172.31.219.206 [2017-03-14T12:37:28-07:00] INFO: Platform: x86\_64-linux  
172.31.219.206 [2017-03-14T12:37:28-07:00] INFO: Chef-client pid: 3589  
172.31.219.206  
172.31.219.206 ================================================================================  
172.31.219.206 Chef encountered an error attempting to load the node data for "chefnode"  
172.31.219.206 ================================================================================  
172.31.219.206  
172.31.219.206 Unexpected API Request Failure:  
172.31.219.206 -------------------------------  
172.31.219.206 Cannot fetch the contents of the response.  
172.31.219.206  
172.31.219.206 Platform:  
172.31.219.206 ---------  
172.31.219.206 x86\_64-linux  
172.31.219.206  
172.31.219.206  
172.31.219.206 Running handlers:  
172.31.219.206 [2017-03-14T12:38:49-07:00] ERROR: Running exception handlers  
172.31.219.206 Running handlers complete  
172.31.219.206 [2017-03-14T12:38:49-07:00] ERROR: Exception handlers complete  
172.31.219.206 Chef Client failed. 0 resources updated in 01 minutes 20 seconds  
172.31.219.206 [2017-03-14T12:38:49-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
172.31.219.206 [2017-03-14T12:38:49-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report  
172.31.219.206 [2017-03-14T12:38:49-07:00] ERROR: 504 "Gateway Timeout"  
172.31.219.206 [2017-03-14T12:38:49-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [March 14, 2017, 8:54pm UTC](https://discourse.chef.io/t/getting-this-error-when-i-try-to-knife-bootstrap-on-chef-workstation/10581/2 "2017-03-14T20:54:28Z")

</div>

> [@jayshah309](#):
>
> ERROR: 504 "Gateway Timeout"

Either your chef server is broken/misconfigured/etc. or some proxy between your node and the Chef Server is causing the error. Since knife is making successful API requests it's more likely to be the second option.

---

<div class="post-metadata">

**Author:** ![jayshah309](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@jayshah309](https://discourse.chef.io/u/jayshah309)\
**Post date:** [March 14, 2017, 9:06pm UTC](https://discourse.chef.io/t/getting-this-error-when-i-try-to-knife-bootstrap-on-chef-workstation/10581/3 "2017-03-14T21:06:06Z")

</div>

Thank you for the reply. I have put no\_proxy for all the chef components in my lab. This is the output of the chef-stacktrace.out

jay@chefnode:/etc/chef$ sudo cat /var/chef/cache/chef-stacktrace.out  
Generated at 2017-03-14 14:04:14 -0700  
Net::HTTPFatalError: 504 “Gateway Timeout”  
/opt/chef/embedded/lib/ruby/2.3.0/net/http/response.rb:120:in `error!' /opt/chef/embedded/lib/ruby/2.3.0/net/http/response.rb:129:in`value’  
/opt/chef/embedded/lib/ruby/2.3.0/net/http.rb:920:in `connect' /opt/chef/embedded/lib/ruby/2.3.0/net/http.rb:863:in`do\_start’  
/opt/chef/embedded/lib/ruby/2.3.0/net/http.rb:852:in `start' /opt/chef/embedded/lib/ruby/2.3.0/net/http.rb:1398:in`request’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http/basic\_client.rb:70:in `request' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:340:in`block in send\_http\_request’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:372:in `block in retrying_http_errors' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:370:in`loop’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:370:in `retrying_http_errors' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:333:in`send\_http\_request’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:148:in `request' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/http.rb:115:in`get’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/node.rb:581:in `load' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/node.rb:565:in`find\_or\_create’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/policy\_builder/dynamic.rb:72:in `load_node' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:468:in`load\_node’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/client.rb:270:in `run' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:295:in`block in fork\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in `fork' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:283:in`fork\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:248:in `block in run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/local_mode.rb:44:in`with\_server\_connectivity’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:236:in `run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:464:in`sleep\_then\_run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:451:in `block in interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in`loop’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:450:in `interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application/client.rb:434:in`run\_application’  
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/lib/chef/application.rb:59:in `run' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36/bin/chef-client:26:in`\<top (required)\>’  
/usr/bin/chef-client:57:in `load' /usr/bin/chef-client:57:in`’

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [March 15, 2017, 6:29pm UTC](https://discourse.chef.io/t/getting-this-error-when-i-try-to-knife-bootstrap-on-chef-workstation/10581/4 "2017-03-15T18:29:46Z")

</div>

> [@jayshah309](#):
>
> Thank you for the reply. I have put no\_proxy for all the chef components in my lab. This is the output of the chef-stacktrace.out

The stack trace won't be very helpful in this situation. I'd start by watching the Chef Server logs (`chef-server-ctl tail` can help) to see if Chef Server actually gets the request. If Chef Server is actually returning the 504 response, you'll want to dig in to what Chef Server is doing to see why. If not, your config to disable request proxying might be incorrect, you could double check the `client.rb` and/or run Chef Client with `-l debug` to get more info.
