# Issue with http\_request

**URL:** <https://discourse.chef.io/t/issue-with-http-request/7702>\
**Category:** Chef Infra (archive)\
**Created:** [January 28, 2016, 8:58pm UTC](https://discourse.chef.io/t/issue-with-http-request/7702 "2016-01-28T20:58:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkampf](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jkampf](https://discourse.chef.io/u/jkampf)\
**Post date:** [January 28, 2016, 8:58pm UTC](https://discourse.chef.io/t/issue-with-http-request/7702/1 "2016-01-28T20:58:14Z")

</div>

So I am putting a check in at the end of my recipe to make sure that a service is up and running. I’m doing a simple http get. I want to retry it for a period of time until it finally works. However changing the retries does not appear to be affecting the execution.

I am expecting the 404 error. However I see a diffrence between the Resource Declaration and the Compiled Resource.

http\_request[check\_heartbeat] action get

```
================================================================================
Error executing action `get` on resource 'http_request[check_heartbeat]'
================================================================================

Net::HTTPServerException
------------------------
404 "Not Found"

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/camel-karaf-esb-cookbook/recipes/default.rb

323: http_request 'check_heartbeat' do
324: url 'http://localhost:8181/cxf/heartbeat'
325: action :get
326: retries 2
327: retry_delay 30
328: end
329:

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/camel-karaf-esb-cookbook/recipes/default.rb:323:in `from_file'

http_request("check_heartbeat") do
  action [:get]
  retries 0
  retry_delay 30
  guard_interpreter :default
  message "check_heartbeat"
  url "http://localhost:8181/cxf/heartbeat"
  headers {"Accept-Encoding"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"}
  cookbook_name "camel-karaf-esb-cookbook"
  recipe_name "default"

```

Is this an issue with the error reporting? Or is is the complied execution actually not retrying?

---

<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:** [January 28, 2016, 10:37pm UTC](https://discourse.chef.io/t/issue-with-http-request/7702/2 "2016-01-28T22:37:30Z")

</div>

> [@jkampf](#):
>
> Is this an issue with the error reporting? Or is is the complied execution actually not retrying?

internally, Chef mutates the retry count by subtracting 1 from it for each retry, which makes the declared resource show the wrong value. It's quite possible that Chef exhausted all the retries; if you have the full log, there should be a message for each retry.
