Skip to content
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

undefined method `[]' for nil:NilClass when attempting to pull workflow_stage with delivery sugar #40

Open
sflaherty2009 opened this issue Dec 12, 2017 · 0 comments

Comments

@sflaherty2009
Copy link

In chef automate I am using delivery-sugar to run test kitchen for aws ec2. When running my recipe in the acceptance stage and attempting to use the workflow_stage variable I am presented with the following error.
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/dt_zks_kafka/recipes/default.rb
================================================================================

   NoMethodError
   -------------
   undefined method `[]' for nil:NilClass
   
   Cookbook Trace:
   ---------------
     /tmp/kitchen/cache/cookbooks/delivery-sugar/libraries/delivery_change.rb:46:in `initialize'
     /tmp/kitchen/cache/cookbooks/delivery-sugar/libraries/delivery_dsl.rb:439:in `new'
     /tmp/kitchen/cache/cookbooks/delivery-sugar/libraries/delivery_dsl.rb:439:in `change'
     /tmp/kitchen/cache/cookbooks/delivery-sugar/libraries/delivery_dsl.rb:211:in `workflow_stage'
     /tmp/kitchen/cache/cookbooks/dt_zks_kafka/recipes/server.rb:9:in `from_file'
     /tmp/kitchen/cache/cookbooks/dt_zks_kafka/recipes/default.rb:7:in `from_file'
   
   Relevant File Content:
   ----------------------
   /tmp/kitchen/cache/cookbooks/delivery-sugar/libraries/delivery_change.rb:
   
    39:      # rubocop:disable AbcSize
    40:      # rubocop:disable Metrics/MethodLength
    41:      # rubocop:disable AccessorMethodName
    42:      # rubocop:disable CyclomaticComplexity
    43:      # rubocop:disable PerceivedComplexity
    44:      #
    45:      def initialize(node)
    46>>       change = node['delivery']['change']
    47:        workspace = node['delivery']['workspace']
    48:        @build_user = node['delivery_builder']['build_user']
    49:        @workspace_repo = workspace['repo']
    50:        @workspace_cache = workspace['cache']
    51:        @workspace_chef = workspace['chef']
    52:        @workspace_root = workspace['root']
    53:        @workspace_path = node['delivery']['workspace_path'] ||
    54:                          '/var/opt/delivery/workspace'
    55:        @enterprise = change['enterprise']
   
   System Info:
   ------------
   chef_version=13.6.4
   platform=ubuntu
   platform_version=16.04
   ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
   program_name=chef-solo worker: ppid=1522;start=13:21:48;
   executable=/opt/chef/bin/chef-solo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant