{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14527","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14527/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14527/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14527/events","html_url":"https://github.com/ansible/ansible/issues/14527","id":134318455,"number":14527,"title":"Bug Report: exception when trying to dump all variables","user":{"login":"willharris","id":95639,"avatar_url":"https://avatars.githubusercontent.com/u/95639?v=3","gravatar_id":"","url":"https://api.github.com/users/willharris","html_url":"https://github.com/willharris","followers_url":"https://api.github.com/users/willharris/followers","following_url":"https://api.github.com/users/willharris/following{/other_user}","gists_url":"https://api.github.com/users/willharris/gists{/gist_id}","starred_url":"https://api.github.com/users/willharris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willharris/subscriptions","organizations_url":"https://api.github.com/users/willharris/orgs","repos_url":"https://api.github.com/users/willharris/repos","events_url":"https://api.github.com/users/willharris/events{/privacy}","received_events_url":"https://api.github.com/users/willharris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-17T15:51:13Z","updated_at":"2016-02-17T22:00:26Z","closed_at":"2016-02-17T22:00:26Z","body":"##### Issue Type:\r\n\r\nBug Report\r\n\r\n##### Ansible Version:\r\n```\r\nansible 2.0.0.2\r\n  config file = /Users/harris/Workspaces/Unleash12/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n##### Ansible Configuration:\r\n\r\n```\r\n[defaults]\r\nhost_key_checking=false\r\nlog_path=./ansible.log\r\nnocows=1\r\ntimeout=5\r\n\r\n[ssh_connection]\r\n#ssh_args =  # enable when SSH connections are slow\r\npipeling=True\r\n```\r\n##### Environment:\r\n\r\nHost: Mac OS X 10.11, Python 2.7.10\r\nTarget Machine: Ubuntu 14.04, Python 2.7.10\r\n\r\n##### Summary:\r\n\r\nI have a special playbook, `debug.yml`, that is used to dump all variables on the target machine. Since upgrading to 2.0, this is now throwing the following exception:\r\n\r\n```\r\nfatal: [hostname]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"AnsibleError: ERROR! an unexpected type error occurred. Error was exceptions must be old-style classes or derived from BaseException, not type\"}\r\n```\r\n\r\n##### Steps To Reproduce:\r\n\r\nPlaybook:\r\n```\r\n---\r\n- hosts: all\r\n  user: root\r\n  tasks:\r\n    - name: Dump all vars\r\n      action: template src=templates/debug-vars.txt.j2 dest=/tmp/debug-vars.txt\r\n```\r\nTemplate `debug-vars.txt.j2`:\r\n```\r\nEnvironment Variables (\"environment\"):\r\n--------------------------------\r\n{{ environment | to_nice_json }}\r\n\r\nGROUP NAMES Variables (\"group_names\"):\r\n--------------------------------\r\n{{ group_names | to_nice_json }}\r\n\r\nGROUPS Variables (\"groups\"):\r\n--------------------------------\r\n{{ groups | to_nice_json }}\r\n\r\nHOST Variables (\"hostvars\"):\r\n--------------------------------\r\n{{ hostvars | to_nice_json }}\r\n```\r\n##### Expected Results:\r\n\r\nI expect to get the results of the template written to /tmp/debug-vars.txt.\r\n\r\n##### Actual Results:\r\n\r\nI get the following exception:\r\n```\r\nfatal: [hostname]: FAILED! => {\"changed\": false, \"failed\": true, \"msg\": \"AnsibleError: ERROR! an unexpected type error occurred. Error was exceptions must be old-style classes or derived from BaseException, not type\"}\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/185426712","html_url":"https://github.com/ansible/ansible/issues/14527#issuecomment-185426712","issue_url":"https://api.github.com/repos/ansible/ansible/issues/14527","id":185426712,"user":{"login":"sivel","id":39340,"avatar_url":"https://avatars.githubusercontent.com/u/39340?v=3","gravatar_id":"","url":"https://api.github.com/users/sivel","html_url":"https://github.com/sivel","followers_url":"https://api.github.com/users/sivel/followers","following_url":"https://api.github.com/users/sivel/following{/other_user}","gists_url":"https://api.github.com/users/sivel/gists{/gist_id}","starred_url":"https://api.github.com/users/sivel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivel/subscriptions","organizations_url":"https://api.github.com/users/sivel/orgs","repos_url":"https://api.github.com/users/sivel/repos","events_url":"https://api.github.com/users/sivel/events{/privacy}","received_events_url":"https://api.github.com/users/sivel/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T22:00:26Z","updated_at":"2016-02-17T22:00:26Z","body":"I tracked this down in another issue that details the actual cause at #14542.\r\n\r\nI am going to close this issue in favor #14542 "}}