New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property deprecations are broken in Chef 13 #7762

Open
martinisoft opened this Issue Oct 19, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@martinisoft
Contributor

martinisoft commented Oct 19, 2018

Description

Using the deprecated: option in a property on a custom resource causes a compile time error on Chef 13.11. I followed notes from the Change log talking about this new feature in 13.9 but it looks like this was never fully implemented since it lacks the target method

Chef Version

13.11.3

Platform Version

Ubuntu 16.04

Replication Case

Create any custom resource and use deprecated: 'with a generic message' at the end of the property to mark it as deprecated

Client Output

Starting Chef Client, version 13.11.3
       Creating a new client identity for datadog-ubuntu-1604 using the validator key.
       resolving cookbooks for run list: ["test::default"]
       Synchronizing Cookbooks:
         - test (0.1.0)
         - dnsimple_firewall (1.5.1)
         - dnsimple_library (3.7.0)
         - dnsimple_metrics (2.11.1)
         - chef-vault (3.1.1)
         - iptables-ng (3.0.1)
       Installing Cookbook Gems:
       Compiling Cookbooks...

       ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/test/recipes/default.rb
       ================================================================================

       NotImplementedError
       -------------------
       subclasses of Chef::Deprecated::Base should define #target

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/test/recipes/dnscheck2.rb:12:in `block in from_file'
         /tmp/kitchen/cache/cookbooks/test/recipes/dnscheck2.rb:10:in `from_file'
         /tmp/kitchen/cache/cookbooks/test/recipes/default.rb:16:in `from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/test/recipes/dnscheck2.rb:

         5:  # Copyright (C) 2017-2018 DNSimple Corp
         6:  #
         7:  # All rights reserved - Do Not Redistribute
         8:  #
         9:
        10:  dnsimple_metrics_check 'dnsimple_com_ipv6' do
        11:    check_name 'dns_check'
        12>>   generic true
        13:    instances(
        14:      [
        15:        {
        16:          hostname:    'dnsimple.com',
        17:          nameserver:  '::1',
        18:          record_type: 'AAAA',
        19:        },
        20:      ]
        21:    )

       System Info:
       ------------
       chef_version=13.11.3
       platform=ubuntu
       platform_version=16.04
       ruby=ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
       program_name=chef-client worker: ppid=1625;start=23:01:25;
       executable=/opt/chef/bin/chef-client


       Running handlers:
       [2018-10-19T23:01:32+00:00] ERROR: Running exception handlers
       [2018-10-19T23:01:32+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2018-10-19T23:01:32+00:00] ERROR: Exception handlers complete
       [2018-10-19T23:01:32+00:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 06 seconds
       [2018-10-19T23:01:32+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2018-10-19T23:01:32+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2018-10-19T23:01:32+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2018-10-19T23:01:32+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2018-10-19T23:01:32+00:00] ERROR: subclasses of Chef::Deprecated::Base should define #target
       [2018-10-19T23:01:32+00:00] ERROR: subclasses of Chef::Deprecated::Base should define #target
       [2018-10-19T23:01:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
       [2018-10-19T23:01:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Stacktrace

================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/test/recipes/default.rb
       ================================================================================

       NotImplementedError
       -------------------
       subclasses of Chef::Deprecated::Base should define #target

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/test/recipes/dnscheck2.rb:12:in `block in from_file'
         /tmp/kitchen/cache/cookbooks/test/recipes/dnscheck2.rb:10:in `from_file'
         /tmp/kitchen/cache/cookbooks/test/recipes/default.rb:16:in `from_file'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment