{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/25492","labels_url":"https://api.github.com/repos/saltstack/salt/issues/25492/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/25492/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/25492/events","html_url":"https://github.com/saltstack/salt/issues/25492","id":95475466,"number":25492,"title":"\"docker-py mem_limit has been moved to host_config in API version 1.19\" error","user":{"login":"hernanc","id":216205,"avatar_url":"https://avatars.githubusercontent.com/u/216205?v=3","gravatar_id":"","url":"https://api.github.com/users/hernanc","html_url":"https://github.com/hernanc","followers_url":"https://api.github.com/users/hernanc/followers","following_url":"https://api.github.com/users/hernanc/following{/other_user}","gists_url":"https://api.github.com/users/hernanc/gists{/gist_id}","starred_url":"https://api.github.com/users/hernanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernanc/subscriptions","organizations_url":"https://api.github.com/users/hernanc/orgs","repos_url":"https://api.github.com/users/hernanc/repos","events_url":"https://api.github.com/users/hernanc/events{/privacy}","received_events_url":"https://api.github.com/users/hernanc/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/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Low-Hanging%20Fruit","name":"Low-Hanging Fruit","color":"f7c6c7"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","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":2528,"closed_issues":2565,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-09-08T22:43:16Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-07-16T16:40:13Z","updated_at":"2015-09-09T00:00:39Z","closed_at":null,"body":"Hello,\r\nI'm trying to set up a Docker container in a Minion and getting this error on docker.installed\r\n```\r\nComment: We did not get any expected answer from docker\r\n              Traceback (most recent call last):\r\n                File \"/usr/lib/python2.7/dist-packages/salt/modules/dockerio.py\", line 640, in create_container\r\n                  cpuset=cpuset\r\n                File \"/usr/local/lib/python2.7/dist-packages/docker/client.py\", line 237, in create_container\r\n                  volume_driver\r\n                File \"/usr/local/lib/python2.7/dist-packages/docker/utils/utils.py\", line 546, in create_container_config\r\n                  'mem_limit has been moved to host_config in API version 1.19'\r\n              InvalidVersion: mem_limit has been moved to host_config in API version 1.19\r\n```\r\n\r\nThe error is being triggered in https://github.com/docker/docker-py/blob/master/docker/utils/utils.py#L544\r\n```\r\n        if mem_limit is not None:\r\n            raise errors.InvalidVersion(\r\n                'mem_limit has been moved to host_config in API version 1.19'\r\n            )\r\n```\r\nSo I got around it by adding \"mem_limit: !!null\" to my docker.installed:\r\n```\r\napp-container:\r\n  docker.installed:\r\n    ...\r\n    - mem_limit: !!null\r\n```\r\nHowever, it'd be great to have this fixed. Thanks!\r\n\r\nThe minion has docker-py==1.3.0 installed and this is my master's versions report\r\n```bash\r\n$ salt --versions-report\r\n                  Salt: 2015.5.2\r\n                Python: 2.7.6 (default, Jun 22 2015, 17:58:13)\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: 0.9.1\r\n Debian source package: 2015.5.2+ds-1trusty1\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/138735071","html_url":"https://github.com/saltstack/salt/issues/25492#issuecomment-138735071","issue_url":"https://api.github.com/repos/saltstack/salt/issues/25492","id":138735071,"user":{"login":"brasslock","id":23254,"avatar_url":"https://avatars.githubusercontent.com/u/23254?v=3","gravatar_id":"","url":"https://api.github.com/users/brasslock","html_url":"https://github.com/brasslock","followers_url":"https://api.github.com/users/brasslock/followers","following_url":"https://api.github.com/users/brasslock/following{/other_user}","gists_url":"https://api.github.com/users/brasslock/gists{/gist_id}","starred_url":"https://api.github.com/users/brasslock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brasslock/subscriptions","organizations_url":"https://api.github.com/users/brasslock/orgs","repos_url":"https://api.github.com/users/brasslock/repos","events_url":"https://api.github.com/users/brasslock/events{/privacy}","received_events_url":"https://api.github.com/users/brasslock/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T00:00:39Z","updated_at":"2015-09-09T00:00:39Z","body":"Using v2015.8.0rc4, I get the following failure when I attempt to get a container running.\r\n\r\n\"Failed to create new container: create_host_config() got an unexpected keyword argument 'mem_limit'\"\r\n\r\nI don't specify mem limit in my state file.\r\n\r\nMy state file is:\r\n--\r\ndummy.sls\r\n--\r\ndummylaunch:\r\n  dockerng.running:\r\n    - name: dockerserver\r\n    - image: myregistry/dummyserver:V123\r\n    - command: -m test\r\n    - network_mode: host\r\n    - restart_policy: on-failure:1\r\n--\r\n\r\nHere is the output from \"sudo salt '*' dockerng.version\"\r\n\r\nvagrant-ubuntu-trusty-64:\r\n    ----------\r\n    ApiVersion:\r\n        1.19\r\n    ApiVersionInfo:\r\n        - 1\r\n        - 19\r\n    Arch:\r\n        amd64\r\n    GitCommit:\r\n        786b29d\r\n    GoVersion:\r\n        go1.4.2\r\n    KernelVersion:\r\n        3.13.0-62-generic\r\n    Os:\r\n        linux\r\n    Version:\r\n        1.7.1\r\n    VersionInfo:\r\n        - 1\r\n        - 7\r\n        - 1\r\n\r\nand the direct output from 'docker version'\r\nClient version: 1.7.1\r\nClient API version: 1.19\r\nGo version (client): go1.4.2\r\nGit commit (client): 786b29d\r\nOS/Arch (client): linux/amd64\r\nServer version: 1.7.1\r\nServer API version: 1.19\r\nGo version (server): go1.4.2\r\nGit commit (server): 786b29d\r\nOS/Arch (server): linux/amd64\r\n\r\n\r\nOutput from 'salt --versions-report'\r\nSalt Version:\r\n           Salt: 2015.8.0rc4\r\n \r\nDependency Versions:\r\n         Jinja2: 2.7.2\r\n       M2Crypto: 0.21.1\r\n           Mako: 0.9.1\r\n         PyYAML: 3.10\r\n          PyZMQ: 14.0.1\r\n         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)\r\n           RAET: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.0.4\r\n           cffi: Not Installed\r\n       cherrypy: Not Installed\r\n       dateutil: 1.5\r\n          gitdb: 0.5.4\r\n      gitpython: Not Installed\r\n          ioflo: Not Installed\r\n        libnacl: Not Installed\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.3.0\r\n   mysql-python: Not Installed\r\n      pycparser: Not Installed\r\n       pycrypto: 2.6.1\r\n         pygit2: Not Installed\r\n   python-gnupg: Not Installed\r\n          smmap: 0.8.2\r\n        timelib: Not Installed\r\n \r\nSystem Versions:\r\n           dist: Ubuntu 14.04 trusty\r\n        machine: x86_64\r\n        release: 3.13.0-62-generic\r\n         system: Ubuntu 14.04 trusty\r\n\r\n\r\nThe deployment works fine if I disable the version line in module dockerng.py\r\n   if salt.utils.version_cmp(version()['ApiVersion'], '1.18') == 1:\r\nhacked to\r\n   if salt.utils.version_cmp(version()['ApiVersion'], '1.99') == 1:\r\n\r\n"}}