# New error message on unmodified cookbook

**URL:** <https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286>\
**Category:** Chef Infra (archive)\
**Created:** [September 1, 2016, 5:34am UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286 "2016-09-01T05:34:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zindello](https://avatars.discourse-cdn.com/v4/letter/z/977dab/32.png) [@zindello](https://discourse.chef.io/u/zindello)\
**Post date:** [September 1, 2016, 5:34am UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/1 "2016-09-01T05:34:58Z")

</div>

Hi All,

I have a number of cookbooks that install packages. Today for some reason the functionality has completely stopped working. The error I’m getting is as follows:

undefined method `declared\_key’ for Chef::Resource::YumPackage

Has anybody seen this before? Suggestions on how to go about fixing it?

Cheers,  
Josh

---

<div class="post-metadata">

**Author:** ![thommay](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@thommay](https://discourse.chef.io/u/thommay)\
**Post date:** [September 1, 2016, 9:57am UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/2 "2016-09-01T09:57:09Z")

</div>

Hi,  
Which version of chef are you using, do you have the compat resource cookbok and if so which version, and please show the complete backtrace.  
Thanks,  
-Thom

---

<div class="post-metadata">

**Author:** ![devopsified](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@devopsified](https://discourse.chef.io/u/devopsified)\
**Post date:** [September 22, 2016, 10:08am UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/3 "2016-09-22T10:08:50Z")

</div>

I am seeing a similar issue, but with RubyBlock. The ruby\_block resource actually executes fine, but the Chef run fails.

Here’s the ruby\_block that sends the notification:

```
ruby_block "run_block" do
    block do
        Chef::Log.info("Sending notification")
        Chef::Log.info("Response in message: #{node['aws']['lambda']['sample_function']['resp_json'][this_env]}")
        notifies :create, "ruby_block[deploy_sample_lambda_function]", :immediately
    end
end

```

Versions:

```
/opt/chefdk/embedded/bin/ruby --version
ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-darwin13.0]

vagrant -v
Vagrant 1.8.5

chef -v
Chef Development Kit Version: 0.17.17
chef-client version: 12.13.37
delivery version: master (f68e5c5804cd7d8a76c69b926fbb261e1070751b)
berks version: 4.3.5
kitchen version: 1.11.1

```

The error:

```
NoMethodError - undefined method `declared_key' for "ruby_block[deploy_sample_lambda_function]":String

```

Trace:

```
    ==> default: * ruby_block[deploy_sample_lambda_function] action create * ruby_block[deploy_sample_lambda_function] action create[2016-09-22T09:52:30+00:00] INFO: Processing ruby_block[deploy_sample_lambda_function] action create (my__lambda::sample_function line 38)
==> default: [2016-09-22T09:52:30+00:00] DEBUG: Providers for generic ruby_block resource enabled on node include: [Chef::Provider::RubyBlock]
==> default: [2016-09-22T09:52:30+00:00] DEBUG: Provider for action create on resource ruby_block[deploy_sample_lambda_function] is Chef::Provider::RubyBlock
==> default: [2016-09-22T09:52:30+00:00] INFO: ** Running /usr/local/bin/aws lambda create-function --region us-west-2 --function-name sample_function --zip-file fileb:///root/files/opsdev/lambda/sample_function.py.zip --role arn:aws:iam::xxxxxxxxxxx:role/lambda_basic_execution --description "sample lambda function for CB testing" --handler sample_function.lambda_handler --runtime python2.7 --timeout 5 --memory-size 256
==> default: [2016-09-22T09:52:31+00:00] INFO: ShellOut response JSON: {
==> default: "CodeSha256": "LVsg+VEGEm8xXFYly8o5uiF7Puewjni/C9DhM3H9/w0=",
==> default: "FunctionName": "sample_function",
==> default: "CodeSize": 411,
==> default: "MemorySize": 256,
==> default: "FunctionArn": "arn:aws:lambda:us-west-2:xxxxxxxxxx:function:sample_function",
==> default: "Version": "$LATEST",
==> default: "Role": "arn:aws:iam::xxxxxxxxxxx:role/lambda_basic_execution",
==> default: "Timeout": 5,
==> default: "LastModified": "2016-09-22T09:52:31.387+0000",
==> default: "Handler": "sample_function.lambda_handler",
==> default: "Runtime": "python2.7",
==> default: "Description": "sample lambda function for CB testing"
==> default: }
==> default:
==> default: [2016-09-22T09:52:31+00:00] INFO: Saving response of create-function sample_function
==> default: [2016-09-22T09:52:31+00:00] INFO: response: {
==> default: "CodeSha256": "LVsg+VEGEm8xXFYly8o5uiF7Puewjni/C9DhM3H9/w0=",
==> default: "FunctionName": "sample_function",
==> default: "CodeSize": 411,
==> default: "MemorySize": 256,
==> default: "FunctionArn": "arn:aws:lambda:us-west-2:xxxxxxxxxxx:function:sample_function",
==> default: "Version": "$LATEST",
==> default: "Role": "arn:aws:iam::xxxxxxxxxxx:role/lambda_basic_execution",
==> default: "Timeout": 5,
==> default: "LastModified": "2016-09-22T09:52:31.387+0000",
==> default: "Handler": "sample_function.lambda_handler",
==> default: "Runtime": "python2.7",
==> default: "Description": "sample lambda function for CB testing"
==> default: }
==> default:
==> default: [2016-09-22T09:52:31+00:00] INFO: error:
==> default: [2016-09-22T09:52:31+00:00] INFO: exitcode: 0
==> default: [2016-09-22T09:52:31+00:00] INFO: ruby_block[deploy_sample_lambda_function] called
==> default:
==> default: - execute the ruby block deploy_sample_lambda_function
==> default: - execute the ruby block deploy_sample_lambda_function
==> default:
==> default: * ruby_block[run_block] action run * ruby_block[run_block] action run[2016-09-22T09:52:31+00:00] INFO: Processing ruby_block[run_block] action run (my__lambda::sample_function line 74)
==> default: [2016-09-22T09:52:31+00:00] DEBUG: Providers for generic ruby_block resource enabled on node include: [Chef::Provider::RubyBlock]
==> default: [2016-09-22T09:52:31+00:00] DEBUG: Provider for action run on resource ruby_block[run_block] is Chef::Provider::RubyBlock
==> default: [2016-09-22T09:52:31+00:00] INFO: Sending notification
==> default: [2016-09-22T09:52:31+00:00] INFO: Response in message: {
==> default: "CodeSha256": "LVsg+VEGEm8xXFYly8o5uiF7Puewjni/C9DhM3H9/w0=",
==> default: "FunctionName": "sample_function",
==> default: "CodeSize": 411,
==> default: "MemorySize": 256,
==> default: "FunctionArn": "arn:aws:lambda:us-west-2:xxxxxxxxxxx:function:sample_function",
==> default: "Version": "$LATEST",
==> default: "Role": "arn:aws:iam::xxxxxxxxxxx:role/lambda_basic_execution",
==> default: "Timeout": 5,
==> default: "LastModified": "2016-09-22T09:52:31.387+0000",
==> default: "Handler": "sample_function.lambda_handler",
==> default: "Runtime": "python2.7",
==> default: "Description": "sample lambda function for CB testing"
==> default: }
==> default:
==> default: [2016-09-22T09:52:31+00:00] INFO: ruby_block[run_block] called
==> default:
==> default: - execute the ruby block run_block
==> default: - execute the ruby block run_block
==> default:
==> default: [2016-09-22T09:52:31+00:00] INFO: ruby_block[run_block] sending create action to ruby_block[deploy_sample_lambda_function] (immediate)
==> default: [2016-09-22T09:52:31+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default: [2016-09-22T09:52:31+00:00] DEBUG: Re-raising exception: NoMethodError - undefined method `declared_key' for "ruby_block[deploy_sample_lambda_function]":String
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/run_context.rb:245:in `before_notifications'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:52:in `run_action'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:77:in `block in run_action'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:75:in `each'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:75:in `run_action'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:97:in `block (2 levels) in converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:97:in `each'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:97:in `block in converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:96:in `converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:669:in `block in converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:664:in `catch'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:664:in `converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:703:in `converge_and_save'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:283:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:302:in `block in fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:290:in `fork'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:290:in `fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:255:in `block in run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/local_mode.rb:44:in `with_server_connectivity'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:243:in `run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:450:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:450:in `interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:434:in `run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:60:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/solo.rb:226:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/bin/chef-solo:25:in `<top (required)>'
==> default: /usr/bin/chef-solo:54:in `load'
==> default: /usr/bin/chef-solo:54:in `<main>'
==> default:
==> default: Running handlers:
==> default:
==> default: Running handlers:
==> default: [2016-09-22T09:52:31+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default:
==> default: Running handlers complete
==> default:
==> default: [2016-09-22T09:52:31+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 2 resources updated in 07 seconds
==> default: Chef Client failed. 2 resources updated in 07 seconds
==> default: [2016-09-22T09:52:31+00:00] DEBUG: Server doesn't support resource history, skipping resource report.
==> default: [2016-09-22T09:52:31+00:00] DEBUG: Audit Reports are disabled. Skipping sending reports.
==> default: [2016-09-22T09:52:31+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2016-09-22T09:52:31+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2016-09-22T09:52:31+00:00] DEBUG: NoMethodError: undefined method `declared_key' for "ruby_block[deploy_sample_lambda_function]":String
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/run_context.rb:245:in `before_notifications'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:52:in `run_action'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:77:in `block in run_action'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:75:in `each'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:75:in `run_action'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:97:in `block (2 levels) in converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:97:in `each'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:97:in `block in converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/runner.rb:96:in `converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:669:in `block in converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:664:in `catch'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:664:in `converge'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:703:in `converge_and_save'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/client.rb:283:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:302:in `block in fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:290:in `fork'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:290:in `fork_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:255:in `block in run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/local_mode.rb:44:in `with_server_connectivity'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:243:in `run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:450:in `loop'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:450:in `interval_run_chef_client'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/client.rb:434:in `run_application'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application.rb:60:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/lib/chef/application/solo.rb:226:in `run'
==> default: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.14.77/bin/chef-solo:25:in `<top (required)>'
==> default: /usr/bin/chef-solo:54:in `load'
==> default: /usr/bin/chef-solo:54:in `<main>'
==> default: [2016-09-22T09:52:31+00:00] ERROR: undefined method `declared_key' for "ruby_block[deploy_sample_lambda_function]":String
==> default: [2016-09-22T09:52:31+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

```

Any help with this will be appreciated.

Cheers!

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [September 22, 2016, 3:03pm UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/4 "2016-09-22T15:03:05Z")

</div>

Can we see your `ruby_block[deploy_sample_lambda_function]` resource?

---

<div class="post-metadata">

**Author:** ![devopsified](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@devopsified](https://discourse.chef.io/u/devopsified)\
**Post date:** [September 22, 2016, 4:36pm UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/5 "2016-09-22T16:36:04Z")

</div>

Absolutely, here it goes:

```
ruby_block 'deploy_sample_lambda_function' do
    block do
        sample_function_cmd = "/usr/local/bin/aws lambda create-function \
        \-\-region us-west-2 \
        \-\-publish \
        \-\-function-name #{node['my_namespace']['lambda']['sample_function']['func_name'][this_env]} \
        \-\-zip-file fileb://#{node['my_namespace']['lambda']['sample_function']['zip_path'][this_env]}#{node['my_namespace']['lambda']['sample_function']['zip_filename'][this_env]} \
        \-\-role #{node['my_namespace']['lambda']['sample_function']['iam_role_arn'][this_env]} \
        \-\-description \"#{node['my_namespace']['lambda']['sample_function']['func_description'][this_env]}\" \
        \-\-handler #{node['my_namespace']['lambda']['sample_function']['handler'][this_env]} \
        \-\-runtime #{node['my_namespace']['lambda']['sample_function']['runtime'][this_env]} \
        \-\-timeout #{node['my_namespace']['lambda']['sample_function']['timeout_s'][this_env]} \
        \-\-memory-size #{node['my_namespace']['lambda']['sample_function']['memory_mb'][this_env]}"

        Chef::Log.info("** Running #{sample_function_cmd}\n\n")

        Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
        command_out = shell_out(sample_function_cmd)
        response = command_out.stdout
        error = command_out.stderr
        exitcode = command_out.exitstatus
        Chef::Log.info("ShellOut response JSON: #{response}")
        if [0, 255].include?(exitcode)
            Chef::Log.info("Saving response of create-function #{node['my_namespace']['lambda']['sample_function']['func_name'][this_env]}")
            Chef::Log.info("response: #{response}")
            Chef::Log.info("error: #{error}")
            Chef::Log.info("exitcode: #{exitcode}")
            node.override['this']['lambda']['sample_function']['resp_json'][this_env] = response
        else
            Chef::Log.info("Deployment of lambda function #{node['my_namespace']['lambda']['sample_function']['func_name'][this_env]} failed with code: #{exitcode}\nShellOut Error: #{error}")
        end
    end
    action :create
end
```

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [September 22, 2016, 5:03pm UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/6 "2016-09-22T17:03:37Z")

</div>

Oh I think the problem is that `notifies :create, "ruby_block[deploy_sample_lambda_function]", :immediately` is inside of your code `block` property. `notifies` is a resource property but in the `block` you are running it as free ruby code.

It should look like:

```auto
ruby_block "run_block" do
    block do
        Chef::Log.info("Sending notification")
        Chef::Log.info("Response in message: #{node['aws']['lambda']['sample_function']['resp_json'][this_env]}")
    end
    notifies :create, "ruby_block[deploy_sample_lambda_function]", :immediately
end

```

That all said, I’m not sure what use you are getting out of this ruby block.

---

<div class="post-metadata">

**Author:** ![devopsified](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@devopsified](https://discourse.chef.io/u/devopsified)\
**Post date:** [September 22, 2016, 6:25pm UTC](https://discourse.chef.io/t/new-error-message-on-unmodified-cookbook/9286/7 "2016-09-22T18:25:52Z")

</div>

[SOLVED]  
Thank you gentlemen 🙂  
Moving the notification out of the block did the trick and now Chef finishes its run without issues.  
Again, many thanks!
