{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/18419","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/18419/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/18419/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/18419/events","html_url":"https://github.com/saltstack/salt/issues/18419","id":49815688,"number":18419,"title":"salt-cloud fails to run as non-root user","user":{"login":"jasonrm","id":39949,"avatar_url":"https://avatars.githubusercontent.com/u/39949?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonrm","html_url":"https://github.com/jasonrm","followers_url":"https://api.github.com/users/jasonrm/followers","following_url":"https://api.github.com/users/jasonrm/following{/other_user}","gists_url":"https://api.github.com/users/jasonrm/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonrm/subscriptions","organizations_url":"https://api.github.com/users/jasonrm/orgs","repos_url":"https://api.github.com/users/jasonrm/repos","events_url":"https://api.github.com/users/jasonrm/events{/privacy}","received_events_url":"https://api.github.com/users/jasonrm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/2016.3.3","name":"2016.3.3","color":"fbca04"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77"},{"url":"https://api.github.com/repos/saltstack/salt/labels/RIoT","name":"RIoT","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Salt-Cloud","name":"Salt-Cloud","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"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":3076,"closed_issues":3851,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-07-15T18:25:48Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2014-11-23T05:44:46Z","updated_at":"2016-07-15T19:18:52Z","closed_at":null,"body":"Post e85e2c2 (Add Salt Cloud roster) I am having the following issue with running salt-cloud as a non-root user.\r\n\r\n```\r\n# on develop (2db74b1)\r\n$ salt-cloud -m cloud.maps.d/dev.conf\r\n[INFO    ] salt-cloud starting\r\n[INFO    ] Applying map from 'cloud.maps.d/dev.conf'.\r\nThe following virtual machines are set to be created:\r\n  alex\r\n\r\nProceed? [N/y] y\r\n... proceeding\r\n[INFO    ] Calculating dependencies for alex\r\n[ERROR   ] There was a query error: [Errno 13] Permission denied: '/var/cache'\r\n```\r\n\r\nI'm not sure why it's trying to write to `/var`, as my config should be overriding the root directory to the current directory.\r\n \r\nIf I checkout a commit before e85e2c2 I can run the above just fine. When I go back to develop, the destroy is successful despite the error message.\r\n\r\n```\r\n# ... ran successfully on older commit.\r\n\r\n# and now back on develop (2db74b1)\r\n$ salt-cloud -m cloud.maps.d/dev.conf -d\r\n[INFO    ] salt-cloud starting\r\n[INFO    ] Applying map from 'cloud.maps.d/dev.conf'.\r\nThe following virtual machines are set to be destroyed:\r\n  ec2:\r\n    ec2:\r\n      alex\r\n\r\nProceed? [N/y] y\r\n... proceeding\r\n[INFO    ] Destroying in non-parallel mode.\r\n[INFO    ] [{'instanceId': 'i-4e894aa7', 'currentState': {'code': '32', 'name': 'shutting-down'}, 'previousState': {'code': '16', 'name': 'running'}}]\r\n[ERROR   ] There was an error destroying machines: [Errno 13] Permission denied: '/var/cache'\r\n```\r\n\r\nI'm suspicious of how `salt.syspaths` doesn't seem to be aware of the config in `Saltfile` and `cloud` config files, but that's all I've got at the moment.\r\n\r\n## Config Files\r\n\r\n### Saltfile\r\n```\r\nsalt:\r\n  config_dir: .\r\nsalt-ssh:\r\n  config_dir: .\r\nsalt-key:\r\n  config_dir: .\r\nsalt-cloud:\r\n  config_dir: .\r\nsalt-master:\r\n  config_dir: .\r\n```\r\n\r\n### cloud\r\n```\r\nminion:\r\n    master: salt-master\r\nroot_dir: ./\r\n```\r\n\r\n## Versions\r\n```\r\n# develop branch\r\n$ salt --versions\r\n           Salt: 2014.7.0-1758-g2db74b1\r\n         Python: 2.7.8 (default, Oct  3 2014, 20:39:45)\r\n         Jinja2: 2.7.3\r\n       M2Crypto: 0.22\r\n msgpack-python: 0.4.2\r\n   msgpack-pure: Not Installed\r\n       pycrypto: 2.6.1\r\n        libnacl: Not Installed\r\n         PyYAML: 3.11\r\n          ioflo: Not Installed\r\n          PyZMQ: 14.4.1\r\n           RAET: Not Installed\r\n            ZMQ: 4.0.5\r\n           Mako: Not Installed\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/233046229","html_url":"https://github.com/saltstack/salt/issues/18419#issuecomment-233046229","issue_url":"https://api.github.com/repos/saltstack/salt/issues/18419","id":233046229,"user":{"login":"techhat","id":287147,"avatar_url":"https://avatars.githubusercontent.com/u/287147?v=3","gravatar_id":"","url":"https://api.github.com/users/techhat","html_url":"https://github.com/techhat","followers_url":"https://api.github.com/users/techhat/followers","following_url":"https://api.github.com/users/techhat/following{/other_user}","gists_url":"https://api.github.com/users/techhat/gists{/gist_id}","starred_url":"https://api.github.com/users/techhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techhat/subscriptions","organizations_url":"https://api.github.com/users/techhat/orgs","repos_url":"https://api.github.com/users/techhat/repos","events_url":"https://api.github.com/users/techhat/events{/privacy}","received_events_url":"https://api.github.com/users/techhat/received_events","type":"User","site_admin":false},"created_at":"2016-07-15T19:18:52Z","updated_at":"2016-07-15T19:18:52Z","body":"As with other components of Salt, Salt Cloud uses `syspaths.CACHE_DIR`, which defaults to `os.path.join(ROOT_DIR, 'var', 'cache', 'salt')`. This can be seen in the `init_cachedir()` function inside `salt.utils.cloud`.\r\n\r\n@cro, do you have any insight as to how other subsystems write to the cache directory as a non-root user?\r\n\r\nIn the meantime, creating `/var/cache/salt/cloud` and changing the user/group to whatever no-root user you're using should help."}}
{"actor":{"display_login":"techhat"}}