Opsworks自定义配方因python :: pip而失败

时间:2014-03-02 01:25:49

标签: python pip chef-recipe aws-opsworks

警告:我刚刚开始学习Chef,所以以下错误可能非常简单:(

我花了最后三天试图找出以下内容,但到目前为止我还没有取得任何进展(除了失去很多头发)。

我正在尝试在opswork堆栈的Web服务器层内安装New Relic python代理。 New Relic食谱(https://github.com/escapestudios-cookbooks/newrelic)需要我添加的python cookbook(https://github.com/poise/python)。无论我做什么,由于配方中的未定义方法,包将无法安装。然后我认为这个python cookbook可能与Amazon不兼容(未列为平台),因此我尝试了其他十几本烹饪书。

我更改了食谱但仍然没有 - 无论我做什么,都不起作用。

尝试使用python cookbook运行New Relic配方时,这是最明显的错误日志:

Opsworks平台:安装了python,python-pip和python-devel的Amazon AMI 2013-9。

New Relic食谱:

#install latest python agent
python_pip "newrelic" do
    action :install
    if node['newrelic']['python_version'] != "latest"
        version node['newrelic']['python_version']
    end
end

错误日志

...
    /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_cleanup/attributes/default.rb

    [2014-03-02T01:00:31+00:00] DEBUG: Loading Recipe python::pip via include_recipe
    [2014-03-02T01:00:31+00:00] DEBUG: Found recipe pip in cookbook python
    [2014-03-02T01:00:31+00:00] DEBUG: filtered backtrace of compile error: 
    [2014-03-02T01:00:31+00:00] DEBUG: filtered backtrace of compile error: 
    [2014-03-02T01:00:31+00:00] DEBUG: backtrace entry for compile error: '/opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/python/recipes/pip.rb:26:in `from_file''
    [2014-03-02T01:00:31+00:00] DEBUG: Line number of compile error: '26'

    ================================================================================
    Recipe Compile Error in /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/newrelic/recipes/python-agent.rb
    ================================================================================


    NoMethodError
    -------------
    undefined method `[]' for nil:NilClass


    Cookbook Trace:
    ---------------
    /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/python/recipes/pip.rb:26:in `from_file'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:132:in `include_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `each'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `include_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/newrelic/recipes/python-agent.rb:8:in `from_file'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:139:in `compile_recipes'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `each'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:86:in `load'
    /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb:15:in `from_file'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `call'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `action_run'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/why_run.rb:52:in `call'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/why_run.rb:52:in `add_action'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:151:in `converge_by'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:32:in `action_run'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:114:in `send'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:114:in `run_action'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in `run_action'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:in `run_action'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `each'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/chef-solo:25
    /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
    /opt/aws/opsworks/current/bin/chef-solo:16


    Relevant File Content:
    ----------------------
    /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/python/recipes/pip.rb:

    19:  #
    20:  
    21:  # Where does pip get installed?
    22:  # platform/method: path (proof)
    23:  # redhat/package: /usr/bin/pip (sha a8a3a3)
    24:  # omnibus/source: /opt/local/bin/pip (sha 29ce9874)
    25:  
    26>> if node['python']['install_method'] == 'source'
    27:    pip_binary = "#{node['python']['prefix_dir']}/bin/pip"
    28:  elsif platform_family?("rhel", "fedora")
    29:    pip_binary = "/usr/bin/pip"
    30:  elsif platform_family?("smartos")
    31:    pip_binary = "/opt/local/bin/pip"
    32:  else
    33:    pip_binary = "/usr/local/bin/pip"
    34:  end
    35:  



    [2014-03-02T01:00:32+00:00] ERROR: Caught exception while compiling OpsWorks custom run list: NoMethodError - undefined method `[]' for nil:NilClass - /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/python/recipes/pip.rb:26:in `from_file'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:132:in `include_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `each'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `include_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/newrelic/recipes/python-agent.rb:8:in `from_file'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:139:in `compile_recipes'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `each'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:86:in `load'
    /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb:15:in `from_file'
    /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `call'
   ...
11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/chef-solo:25
        /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
        /opt/aws/opsworks/current/bin/chef-solo:16

        ================================================================================
        Error executing action `run` on resource 'ruby_block[Compile Custom OpsWorks Run List]'
        ================================================================================


        NoMethodError
        -------------
        undefined method `[]' for nil:NilClass


        Resource Declaration:
        ---------------------
        # In /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb

        3: ruby_block("Compile Custom OpsWorks Run List") do
        4:   block do
        5:     begin
        6: 
        7:       # Reload cookbooks after they're available on local filesystem
        8:       cl = Chef::CookbookLoader.new(Chef::Config[:cookbook_path])
        9:       cl.load_cookbooks
        10:       self.run_context.instance_variable_set(:@cookbook_collection, Chef::CookbookCollection.new(cl))
        11: 
        12:       # Expand run list with custom cookbooks and load them into the current run_context
        13:       opsworks_run_list = Chef::RunList.new(*node[:opsworks_custom_cookbooks][:recipes])
        14:       Chef::Log.info "New Run List expands to #{opsworks_run_list.run_list_items.map(&:name).inspect}"
        15:       self.run_context.load(opsworks_run_list)
        16: 
        17:     rescue Exception => e
        18:       Chef::Log.error "Caught exception while compiling OpsWorks custom run list: #{e.class} - #{e.message} - #{e.backtrace.join("\n")}"
        19:       raise e
        20:     end
        21: 
        22:   end
        23: end



        Compiled Resource:
        ------------------
        # Declared in /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb:3:in `from_file'

        ruby_block("Compile Custom OpsWorks Run List") do
        block_name "Compile Custom OpsWorks Run List"
        retry_delay 2
        cookbook_name :opsworks_custom_cookbooks
        retries 0
        block #<Proc:0x00007f4774f06168@/opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb:4>
        recipe_name "execute"
        action "run"
        end



        [2014-03-02T01:00:32+00:00] INFO: Running queued delayed notifications before re-raising exception
        [2014-03-02T01:00:32+00:00] DEBUG: Re-raising exception: NoMethodError - ruby_block[Compile Custom OpsWorks Run List] (opsworks_custom_cookbooks::execute line 3) had an error: NoMethodError: undefined method `[]' for nil:NilClass
        /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/python/recipes/pip.rb:26:in `from_file'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:132:in `include_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `each'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `include_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/newrelic/recipes/python-agent.rb:8:in `from_file'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:139:in `compile_recipes'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `each'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:86:in `load'
        /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb:15:in `from_file'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `call'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `action_run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/why_run.rb:52:in `call'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/why_run.rb:52:in `add_action'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:151:in `converge_by'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:32:in `action_run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:114:in `send'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider.rb:114:in `run_action'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource.rb:617:in `run_action'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:50:in `run_action'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `each'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:82:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/runner.rb:81:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/chef-solo:25
        /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
        /opt/aws/opsworks/current/bin/chef-solo:16
        [2014-03-02T01:00:32+00:00] ERROR: Running exception handlers
        [2014-03-02T01:00:32+00:00] ERROR: Exception handlers complete
        [2014-03-02T01:00:32+00:00] FATAL: Stacktrace dumped to /opt/aws/opsworks/releases/20140211150717_220/chef-stacktrace.out
        [2014-03-02T01:00:32+00:00] DEBUG: NoMethodError: ruby_block[Compile Custom OpsWorks Run List] (opsworks_custom_cookbooks::execute line 3) had an error: NoMethodError: undefined method `[]' for nil:NilClass
        /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/python/recipes/pip.rb:26:in `from_file'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:132:in `include_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `each'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:131:in `include_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/site-cookbooks/newrelic/recipes/python-agent.rb:8:in `from_file'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/cookbook_version.rb:346:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:151:in `load_recipe'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:139:in `compile_recipes'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `each'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:137:in `compile_recipes'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:74:in `compile'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/run_context.rb:86:in `load'
        /opt/aws/opsworks/releases/20140211150717_220/cookbooks/opsworks_custom_cookbooks/recipes/execute.rb:15:in `from_file'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `call'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/provider/ruby_block.rb:33:in `action_run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/why_run.rb:52:in `call'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/mixin/why_run.rb:52:in `add_action'
...
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:404:in `converge'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:469:in `do_run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in `run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/../lib/chef/application.rb:73:in `run'
        /opt/aws/opsworks/releases/20140211150717_220/vendor/gems/chef-11.4.4/bin/chef-solo:25
        /opt/aws/opsworks/current/bin/chef-solo:16:in `load'
        /opt/aws/opsworks/current/bin/chef-solo:16
        [2014-03-02T01:00:32+00:00] FATAL: NoMethodError: ruby_block[Compile Custom OpsWorks Run List] (opsworks_custom_cookbooks::execute line 3) had an error: NoMethodError: undefined method `[]' for nil:NilClass

1 个答案:

答案 0 :(得分:0)

从你的问题来看,一件小事并不清楚。你的图层配方是什么样的?它们是否按正确顺序排列:python,newrelic?

你是直接使用python :: pip还是python?您可能需要包含python,而不仅仅是:: pip