{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/6165","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/6165/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/6165/comments","events_url":"https://api.github.com/repos/chef/chef/issues/6165/events","html_url":"https://github.com/chef/chef/issues/6165","id":229748943,"number":6165,"title":"Chomp errors when using Chocolatey provider","user":{"login":"TonyChengCME","id":28788281,"avatar_url":"https://avatars1.githubusercontent.com/u/28788281?v=3","gravatar_id":"","url":"https://api.github.com/users/TonyChengCME","html_url":"https://github.com/TonyChengCME","followers_url":"https://api.github.com/users/TonyChengCME/followers","following_url":"https://api.github.com/users/TonyChengCME/following{/other_user}","gists_url":"https://api.github.com/users/TonyChengCME/gists{/gist_id}","starred_url":"https://api.github.com/users/TonyChengCME/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonyChengCME/subscriptions","organizations_url":"https://api.github.com/users/TonyChengCME/orgs","repos_url":"https://api.github.com/users/TonyChengCME/repos","events_url":"https://api.github.com/users/TonyChengCME/events{/privacy}","received_events_url":"https://api.github.com/users/TonyChengCME/received_events","type":"User","site_admin":false},"labels":[{"id":107919796,"url":"https://api.github.com/repos/chef/chef/labels/Windows","name":"Windows","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-18T17:29:29Z","updated_at":"2017-06-07T16:01:27Z","closed_at":null,"body":"## Description\r\n\r\nWhen I attempt to install a Chocolatey package using the Chef::Provider::Package::Chocolatey provider, I am getting a \"undefined method `chomp' for nil:NilClass\" error during my attempt to converge.  I upgraded the client to 12.16.64 and was able to execute the recipe locally.\r\n\r\n## Chef Version\r\n\r\nInitially started at 12.12.15 and upgraded to 12.16.64\r\n\r\n## Platform Version\r\n\r\nWindows Server 2012 R2\r\n\r\n## Replication Case\r\n\r\nWhen I attempt to install a Chocolatey package using the Chef::Provider::Package::Chocolatey provider in client version 12.12.15,  I am getting a `undefined method 'chomp' for nil:NilClass` error during my attempt to converge.  I upgraded the client to 12.16.64 and was able to successfully execute the recipe locally (i.e., \"chef-client -z\").  I then ran a “choco uninstall java-platform-se-8\" and added the JRE installation cookbook to the node’s run_list.  When I execute the chef-client.bat afterwards, it generated the `FATAL: NoMethodError: undefined method 'failed' for nil:NilClass` error again.\r\n\r\n## Client Output\r\n```\r\nRecipe: cme_etpawin_javajre::install_javajre\r\n  * chocolatey_package[java-platform-se-8] action install[2017-05-15T15:15:57-05:00] INFO: Processing chocolatey_package\r\n[java-platform-se-8] action install (cme_etpawin_javajre::install_javajre line 1)\r\n \r\n \r\n    ================================================================================\r\n    Error executing action `install` on resource 'chocolatey_package[java-platform-se-8]'\r\n    ================================================================================\r\n \r\n    NoMethodError\r\n    -------------\r\n    undefined method `chomp' for nil:NilClass\r\n \r\n    Resource Declaration:\r\n    ---------------------\r\n    # In C:/chef/cache/cookbooks/cme_etpawin_javajre/recipes/install_javajre.rb\r\n \r\n      1: chocolatey_package 'java-platform-se-8' do\r\n      2:   provider                   Chef::Provider::Package::Chocolatey\r\n      3:   version                    '8.0.1210.13'\r\n      4:   action                     :install # defaults to :install if not specified\r\n      5: end\r\n \r\n    Compiled Resource:\r\n    ------------------\r\n    # Declared in C:/chef/cache/cookbooks/cme_etpawin_javajre/recipes/install_javajre.rb:1:in `from_file'\r\n \r\n    chocolatey_package(\"java-platform-se-8\") do\r\n      package_name [\"java-platform-se-8\"]\r\n      provider Chef::Provider::Package::Chocolatey\r\n      action [:install]\r\n      retries 0\r\n      retry_delay 2\r\n      default_guard_interpreter :default\r\n      declared_type :chocolatey_package\r\n      cookbook_name \"cme_etpawin_javajre\"\r\n      recipe_name \"install_javajre\"\r\n      version [\"8.0.1210.13\"]\r\n    end\r\n \r\n    Platform:\r\n    ---------\r\n    x64-mingw32\r\n \r\n[2017-05-15T15:16:03-05:00] INFO: Running queued delayed notifications before re-raising exception\r\n \r\nRunning handlers:\r\n[2017-05-15T15:16:03-05:00] ERROR: Running exception handlers\r\nRunning handlers complete\r\n[2017-05-15T15:16:03-05:00] ERROR: Exception handlers complete\r\nChef Client failed. 4 resources updated in 49 seconds\r\n[2017-05-15T15:16:03-05:00] INFO: Sending resource update report (run-id: 3a6c2087-f655-45f8-aa09-277f4026df8f)\r\n[2017-05-15T15:16:03-05:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stacktrace.out\r\n[2017-05-15T15:16:03-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report\r\n[2017-05-15T15:16:03-05:00] FATAL: NoMethodError: undefined method `failed' for nil:NilClass\r\nDid you mean?  fail\r\n```\r\n\r\n## Stacktrace\r\n\r\n```\r\nGenerated at 2017-05-15 15:16:03 -0500\r\nNoMethodError: undefined method `failed' for nil:NilClass\r\nDid you mean?  fail\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/data_collector.rb:210:in `resource_failed'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `call'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `each'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'\r\n(eval):2:in `resource_failed'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource.rb:634:in `rescue in run_action'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource.rb:620:in `run_action'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:69:in `run_action'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:97:in `each'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:96:in `converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:669:in `block in converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:664:in `catch'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:664:in `converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:703:in `converge_and_save'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:283:in `run'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:276:in `run_with_graceful_exit_option'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:252:in `block in run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:235:in `run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:450:in `loop'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:59:in `run'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/bin/chef-client:26:in `<top (required)>'\r\nC:/opscode/chef/bin/chef-client:65:in `load'\r\nC:/opscode/chef/bin/chef-client:65:in `<main>'\r\n\r\n>>>> Caused by NoMethodError: undefined method `chomp' for nil:NilClass\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:259:in `block in parse_list_output'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:256:in `each_line'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:256:in `parse_list_output'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:246:in `installed_packages'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:191:in `block in build_current_versions'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:190:in `map'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:190:in `build_current_versions'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider/package/chocolatey.rb:48:in `load_current_resource'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/provider.rb:128:in `run_action'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource.rb:622:in `run_action'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:69:in `run_action'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:97:in `each'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'\r\nC:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/runner.rb:96:in `converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:669:in `block in converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:664:in `catch'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:664:in `converge'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:703:in `converge_and_save'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/client.rb:283:in `run'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:276:in `run_with_graceful_exit_option'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:252:in `block in run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:235:in `run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:450:in `loop'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/lib/chef/application.rb:59:in `run'\r\nC:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.16.42-universal-mingw32/bin/chef-client:26:in `<top (required)>'\r\nC:/opscode/chef/bin/chef-client:65:in `load'\r\nC:/opscode/chef/bin/chef-client:65:in `<main>'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/306841683","html_url":"https://github.com/chef/chef/issues/6165#issuecomment-306841683","issue_url":"https://api.github.com/repos/chef/chef/issues/6165","id":306841683,"user":{"login":"TonyChengCME","id":28788281,"avatar_url":"https://avatars1.githubusercontent.com/u/28788281?v=3","gravatar_id":"","url":"https://api.github.com/users/TonyChengCME","html_url":"https://github.com/TonyChengCME","followers_url":"https://api.github.com/users/TonyChengCME/followers","following_url":"https://api.github.com/users/TonyChengCME/following{/other_user}","gists_url":"https://api.github.com/users/TonyChengCME/gists{/gist_id}","starred_url":"https://api.github.com/users/TonyChengCME/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TonyChengCME/subscriptions","organizations_url":"https://api.github.com/users/TonyChengCME/orgs","repos_url":"https://api.github.com/users/TonyChengCME/repos","events_url":"https://api.github.com/users/TonyChengCME/events{/privacy}","received_events_url":"https://api.github.com/users/TonyChengCME/received_events","type":"User","site_admin":false},"created_at":"2017-06-07T16:01:26Z","updated_at":"2017-06-07T16:01:26Z","body":"Sharad,\r\n\r\nMy apologies, the client version is actually Chef 12.16.42.  Also, I have attached the Chocolatey package to the Zendesk case.\r\n\r\nSincerely,\r\n\r\nAnthony Cheng\r\nCME Group\r\n20 South Wacker Drive\r\nChicago, IL 60606\r\nW:  312-930-3228\r\nC:  312-504-8720\r\n\r\nFrom: Nimisha Sharad [mailto:notifications@github.com]\r\nSent: Wednesday, June 07, 2017 1:56 AM\r\nTo: chef/chef <chef@noreply.github.com>\r\nCc: Cheng, Anthony <Anthony.Cheng@cmegroup.com>; Mention <mention@noreply.github.com>\r\nSubject: Re: [chef/chef] Chomp errors when using Chocolatey provider (#6165)\r\n\r\n\r\n@TonyChengCME<https://github.com/tonychengcme> , @piyushawasthi<https://github.com/piyushawasthi> is working on issue #15161. Seems like the error is being raised from here: https://github.com/chef/chef/blob/master/lib/chef/data_collector.rb#L212. This is raised when the resource fails for a particular action.\r\n@TonyChengCME<https://github.com/tonychengcme> , apart from what @btm<https://github.com/btm> asked, can you please provide us some more inputs:\r\n\r\n  1.  Is there anyway to share the Java package that is hosted in your NuGet repository? The chocolatey_package resource seems to be working for all the java packages available that @piyushawasthi<https://github.com/piyushawasthi> tried.\r\n  2.  chef-client version 12.16.64 isn't available. Can you please confirm if it's the correct version?\r\n\r\n—\r\nYou are receiving this because you were mentioned.\r\nReply to this email directly, view it on GitHub<https://github.com/chef/chef/issues/6165#issuecomment-306704375>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AbdGOeuf0N0X99TBZisogf61lqp2bBhwks5sBklogaJpZM4Nfjrj>.\r\n\r\n________________________________\r\nNOTICE: This message, and any attachments, are for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at E-Communication Disclaimer<http://www.cmegroup.com/tools-information/communications/e-communication-disclaimer.html>. If you are not the intended recipient, please delete this message. CME Group and its subsidiaries reserve the right to monitor all email communications that occur on CME Group information systems.\r\n"}}
{"actor":{"display_login":"TonyChengCME"}}