{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/3143","labels_url":"https://api.github.com/repos/chef/chef/issues/3143/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/3143/comments","events_url":"https://api.github.com/repos/chef/chef/issues/3143/events","html_url":"https://github.com/chef/chef/issues/3143","id":64301647,"number":3143,"title":"yum package resource fails with \"ImportError: No module named yum\"","user":{"login":"knoxvilledba","id":2632396,"avatar_url":"https://avatars.githubusercontent.com/u/2632396?v=3","gravatar_id":"","url":"https://api.github.com/users/knoxvilledba","html_url":"https://github.com/knoxvilledba","followers_url":"https://api.github.com/users/knoxvilledba/followers","following_url":"https://api.github.com/users/knoxvilledba/following{/other_user}","gists_url":"https://api.github.com/users/knoxvilledba/gists{/gist_id}","starred_url":"https://api.github.com/users/knoxvilledba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knoxvilledba/subscriptions","organizations_url":"https://api.github.com/users/knoxvilledba/orgs","repos_url":"https://api.github.com/users/knoxvilledba/repos","events_url":"https://api.github.com/users/knoxvilledba/events{/privacy}","received_events_url":"https://api.github.com/users/knoxvilledba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-25T15:41:39Z","updated_at":"2015-03-26T16:41:59Z","closed_at":null,"body":"\"Amazon Linux AMI 2014.09\" servers starting failing upon attempting to install any package with chef-client. The failure looks like this for any \"package\" install you try:\r\n\r\nError executing action `install` on resource 'yum_package[tzdata]'\r\n    ================================================================================\r\n\r\n    Mixlib::ShellOut::ShellCommandFailed\r\n    ------------------------------------\r\n    Expected process to exit with [0], but received '1'\r\n    ---- Begin output of /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----\r\n    STDOUT:\r\n    STDERR: Traceback (most recent call last):\r\n      File \"/opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py\", line 36, in <module>\r\n        import yum\r\n    ImportError: No module named yum\r\n    ---- End output of /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 ----\r\n    Ran /usr/bin/python /opt/chef/embedded/apps/chef/lib/chef/provider/package/yum-dump.py --options --installed-provides --yum-lock-timeout 30 returned 1\r\n\r\n    Resource Declaration:\r\n    ---------------------\r\n    # In /etc/chef/local-mode-cache/cache/cookbooks/timezone-ii/recipes/default.rb\r\n\r\n     13: package value_for_platform_family(\r\n     14:   'gentoo'  => 'timezone-data',\r\n\r\n    Compiled Resource:\r\n    ------------------\r\n    # Declared in /etc/chef/local-mode-cache/cache/cookbooks/timezone-ii/recipes/default.rb:13:in `from_file'\r\n\r\n    yum_package(\"tzdata\") do\r\n      action :install\r\n      retries 0\r\n      retry_delay 2\r\n      default_guard_interpreter :default\r\n      package_name \"tzdata\"\r\n      timeout 900\r\n      flush_cache {:before=>false, :after=>false}\r\n      declared_type :package\r\n      cookbook_name \"timezone-ii\"\r\n      recipe_name \"default\"\r\n    end\r\n\r\n\r\nAfter investigation, I found that the package which I update in my userdata \"aws-cfn-bootstrap\" was updated sometime in the last 24 hours, updating its dependencies to install python27. yum-dump.py seems to be calling /usr/bin/python, which is symlinked to python2.6 after the 2.7 install. /usr/bin/yum header was updated to \"#!/usr/bin/python2.7\". The problem seems to be that the 2.7 install breaks 2.6 interactivity with yum."},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/86612480","html_url":"https://github.com/chef/chef/issues/3143#issuecomment-86612480","issue_url":"https://api.github.com/repos/chef/chef/issues/3143","id":86612480,"user":{"login":"danielsdeleo","id":37162,"avatar_url":"https://avatars.githubusercontent.com/u/37162?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsdeleo","html_url":"https://github.com/danielsdeleo","followers_url":"https://api.github.com/users/danielsdeleo/followers","following_url":"https://api.github.com/users/danielsdeleo/following{/other_user}","gists_url":"https://api.github.com/users/danielsdeleo/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsdeleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsdeleo/subscriptions","organizations_url":"https://api.github.com/users/danielsdeleo/orgs","repos_url":"https://api.github.com/users/danielsdeleo/repos","events_url":"https://api.github.com/users/danielsdeleo/events{/privacy}","received_events_url":"https://api.github.com/users/danielsdeleo/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T16:41:59Z","updated_at":"2015-03-26T16:41:59Z","body":"A year or two ago I looked for ruby libraries for yum and there was only one abandonware one which was only installable as an RPM. Maybe that's gotten better, or we could write our own?"}}