{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/19869","labels_url":"https://api.github.com/repos/saltstack/salt/issues/19869/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/19869/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/19869/events","html_url":"https://github.com/saltstack/salt/issues/19869","id":54884450,"number":19869,"title":"Salt don't seem to set $HOME when issuing commands","user":{"login":"chdeliens","id":991003,"avatar_url":"https://avatars.githubusercontent.com/u/991003?v=3","gravatar_id":"","url":"https://api.github.com/users/chdeliens","html_url":"https://github.com/chdeliens","followers_url":"https://api.github.com/users/chdeliens/followers","following_url":"https://api.github.com/users/chdeliens/following{/other_user}","gists_url":"https://api.github.com/users/chdeliens/gists{/gist_id}","starred_url":"https://api.github.com/users/chdeliens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chdeliens/subscriptions","organizations_url":"https://api.github.com/users/chdeliens/orgs","repos_url":"https://api.github.com/users/chdeliens/repos","events_url":"https://api.github.com/users/chdeliens/events{/privacy}","received_events_url":"https://api.github.com/users/chdeliens/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/State%20Module","name":"State Module","color":"006b75"}],"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":2101,"closed_issues":1752,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-04-03T00:06:57Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-01-20T13:45:51Z","updated_at":"2015-04-03T13:33:56Z","closed_at":null,"body":"Hi,\r\n\r\nI'm using the following state:\r\n```yaml\r\ngit-fileMode-disable:\r\n  git.config:\r\n    - name: core.fileMode\r\n    - value: false\r\n    - is_global: true\r\n    - require:\r\n      - pkg: git\r\n```\r\n\r\nThis results is after requesting a highstate:\r\n```\r\n          ID: git-fileMode-disable\r\n    Function: git.config\r\n        Name: core.fileMode\r\n      Result: False\r\n     Comment: An exception occurred in this state: Traceback (most recent call last):\r\n                File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 1533, in call\r\n                  **cdata['kwargs'])\r\n                File \"/usr/lib/python2.7/dist-packages/salt/states/git.py\", line 547, in config\r\n                  is_global=is_global)\r\n                File \"/usr/lib/python2.7/dist-packages/salt/modules/git.py\", line 844, in config_set\r\n                  cwd=cwd, runas=user)\r\n                File \"/usr/lib/python2.7/dist-packages/salt/modules/git.py\", line 75, in _git_run\r\n                  raise CommandExecutionError(result['stderr'])\r\n              CommandExecutionError: fatal: $HOME not set\r\n     Started: 13:28:48.289532\r\n    Duration: 13.95 ms\r\n     Changes:   \r\n```\r\n\r\nIssuing equivalent command ```git config --global core.filemode false``` through cmd.run salt call also results in the \"$HOME not set\" error.\r\nIssuing equivalent command ```export HOME=/root;git config --global core.filemode false``` through cmd.run salt call works.\r\n\r\nConnecting to the node and issuing the same command (without explicit HOME definition) directly on the command line works.\r\n\r\n```\r\n# salt --versions\r\n           Salt: 2014.7.0\r\n         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)\r\n         Jinja2: 2.7.2\r\n       M2Crypto: 0.21.1\r\n msgpack-python: 0.3.0\r\n   msgpack-pure: Not Installed\r\n       pycrypto: 2.6.1\r\n        libnacl: Not Installed\r\n         PyYAML: 3.10\r\n          ioflo: Not Installed\r\n          PyZMQ: 14.0.1\r\n           RAET: Not Installed\r\n            ZMQ: 4.0.4\r\n           Mako: Not Installed\r\n````\r\n\r\nIs there something wrong in my setup or salt bug?"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/89289030","html_url":"https://github.com/saltstack/salt/issues/19869#issuecomment-89289030","issue_url":"https://api.github.com/repos/saltstack/salt/issues/19869","id":89289030,"user":{"login":"yesteph","id":1999342,"avatar_url":"https://avatars.githubusercontent.com/u/1999342?v=3","gravatar_id":"","url":"https://api.github.com/users/yesteph","html_url":"https://github.com/yesteph","followers_url":"https://api.github.com/users/yesteph/followers","following_url":"https://api.github.com/users/yesteph/following{/other_user}","gists_url":"https://api.github.com/users/yesteph/gists{/gist_id}","starred_url":"https://api.github.com/users/yesteph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yesteph/subscriptions","organizations_url":"https://api.github.com/users/yesteph/orgs","repos_url":"https://api.github.com/users/yesteph/repos","events_url":"https://api.github.com/users/yesteph/events{/privacy}","received_events_url":"https://api.github.com/users/yesteph/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T13:33:56Z","updated_at":"2015-04-03T13:33:56Z","body":"Hi, in our case, we solved the same problem (git.config ok runned from the minion (salt-call) but KO from the master) setting the 'user' :\r\n\r\n{%- if pillar['http_proxy'] is defined %}\r\ngit-http-proxy:\r\n  git.config:\r\n    - name: http.proxy\r\n    - value: http://{{ pillar['http_proxy'] }}\r\n    - user: root\r\n    - is_global: True\r\n"}}