{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/20494","labels_url":"https://api.github.com/repos/saltstack/salt/issues/20494/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/20494/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/20494/events","html_url":"https://github.com/saltstack/salt/issues/20494","id":56920117,"number":20494,"title":"Traceback in output with `--log-level debug` on Windows","user":{"login":"lorengordon","id":8457307,"avatar_url":"https://avatars.githubusercontent.com/u/8457307?v=3","gravatar_id":"","url":"https://api.github.com/users/lorengordon","html_url":"https://github.com/lorengordon","followers_url":"https://api.github.com/users/lorengordon/followers","following_url":"https://api.github.com/users/lorengordon/following{/other_user}","gists_url":"https://api.github.com/users/lorengordon/gists{/gist_id}","starred_url":"https://api.github.com/users/lorengordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorengordon/subscriptions","organizations_url":"https://api.github.com/users/lorengordon/orgs","repos_url":"https://api.github.com/users/lorengordon/repos","events_url":"https://api.github.com/users/lorengordon/events{/privacy}","received_events_url":"https://api.github.com/users/lorengordon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Medium%20Severity","name":"Medium Severity","color":"fad8c7"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Windows","name":"Windows","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":1993,"closed_issues":1616,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-03-06T18:45:09Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2015-02-07T18:16:14Z","updated_at":"2015-03-06T23:03:06Z","closed_at":null,"body":"On Windows with Salt v2014.7.1 (masterless), I'm getting a traceback error at the very end of the output when I set the log level to debug. Doesn't seem to impact execution of the states; I'm not sure what exactly is failing...\r\n\r\n```\r\n2015-02-07 12:58:41,254 [salt.loaded.int.module.cmdmod][DEBUG   ] output: File not found - C:\\salt\\var\\cache\\salt\\minion\\highstate.p\r\n2015-02-07 12:58:41,254 [salt.loader      ][DEBUG   ] Failed to import returner :\r\nTraceback (most recent call last):\r\n  File \"salt/loader.py\", line 621, in gen_module\r\nImportError: No module named \r\n```\r\n\r\n*C:\\salt\\salt-call.exe --local --versions*:\r\n\r\n```\r\n           Salt: 2014.7.1\r\n         Python: 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]\r\n         Jinja2: 2.7.1\r\n       M2Crypto: 0.21.1\r\n msgpack-python: 0.4.2\r\n   msgpack-pure: Not Installed\r\n       pycrypto: 2.6\r\n        libnacl: Not Installed\r\n         PyYAML: 3.11\r\n          ioflo: Not Installed\r\n          PyZMQ: 14.1.1\r\n           RAET: Not Installed\r\n            ZMQ: 4.0.4\r\n           Mako: Not Installed\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/77652485","html_url":"https://github.com/saltstack/salt/issues/20494#issuecomment-77652485","issue_url":"https://api.github.com/repos/saltstack/salt/issues/20494","id":77652485,"user":{"login":"lorengordon","id":8457307,"avatar_url":"https://avatars.githubusercontent.com/u/8457307?v=3","gravatar_id":"","url":"https://api.github.com/users/lorengordon","html_url":"https://github.com/lorengordon","followers_url":"https://api.github.com/users/lorengordon/followers","following_url":"https://api.github.com/users/lorengordon/following{/other_user}","gists_url":"https://api.github.com/users/lorengordon/gists{/gist_id}","starred_url":"https://api.github.com/users/lorengordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorengordon/subscriptions","organizations_url":"https://api.github.com/users/lorengordon/orgs","repos_url":"https://api.github.com/users/lorengordon/repos","events_url":"https://api.github.com/users/lorengordon/events{/privacy}","received_events_url":"https://api.github.com/users/lorengordon/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T23:03:06Z","updated_at":"2015-03-06T23:03:06Z","body":"Ok, I added debug statements everywhere in the codebase that `gen_module` was used and traced the calling function to the invocation in the `_load()` function of the `LazyLoader()` class.\r\n\r\nhttps://github.com/saltstack/salt/blob/2014.7/salt/loader.py#L1320\r\n\r\nSo I added another debug statement to get the value of the `key` parameter, and it gave me the value of `.returner`. The line that sets `mod_key` (which is what's passed to `gen_module`) is [this](https://github.com/saltstack/salt/blob/2014.7/salt/loader.py#L1315):\r\n\r\n```python\r\n        mod_key = key.split('.', 1)[0]\r\n```\r\n\r\nThat results in `mod_key = ''`, which gets passed to the `name` parameter of `gen_module()`. And then `gen_module()` attempts to execute `imp.find_module(name)`, which results in the traceback.\r\n\r\nI don't think I've yet found an explanation of why this behavior occurs on Windows and not Linux, though. I can maybe try to debug the execution on a Linux system, as well. My best guess right now is that Linux systems aren't getting to that section of code at [line 624](https://github.com/saltstack/salt/blob/2014.7/salt/loader.py#L624) where it would attempt to execute  `imp.find_module('')`."}}