{"action":"created","issue":{"url":"https://api.github.com/repos/zalando/patroni/issues/652","repository_url":"https://api.github.com/repos/zalando/patroni","labels_url":"https://api.github.com/repos/zalando/patroni/issues/652/labels{/name}","comments_url":"https://api.github.com/repos/zalando/patroni/issues/652/comments","events_url":"https://api.github.com/repos/zalando/patroni/issues/652/events","html_url":"https://github.com/zalando/patroni/issues/652","id":309686183,"number":652,"title":"File \"./patroni.py\", line 6, in <module> main ()","user":{"login":"tschmidt82","id":11042643,"avatar_url":"https://avatars2.githubusercontent.com/u/11042643?v=4","gravatar_id":"","url":"https://api.github.com/users/tschmidt82","html_url":"https://github.com/tschmidt82","followers_url":"https://api.github.com/users/tschmidt82/followers","following_url":"https://api.github.com/users/tschmidt82/following{/other_user}","gists_url":"https://api.github.com/users/tschmidt82/gists{/gist_id}","starred_url":"https://api.github.com/users/tschmidt82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschmidt82/subscriptions","organizations_url":"https://api.github.com/users/tschmidt82/orgs","repos_url":"https://api.github.com/users/tschmidt82/repos","events_url":"https://api.github.com/users/tschmidt82/events{/privacy}","received_events_url":"https://api.github.com/users/tschmidt82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-29T09:37:43Z","updated_at":"2018-03-29T18:33:32Z","closed_at":null,"author_association":"NONE","body":"Hi, is there a known issue with python on patroni?\r\n\r\ni get this error by starting the most current patroni on my Ubuntu LTS 16.04 VM\r\n\r\nroot@myDocker1:/opt/patroni# ./patroni.py postgres0.yml\r\nTraceback (most recent call last):\r\n  File \"./patroni.py\", line 6, in <module>\r\n    main()\r\n  File \"/opt/patroni/patroni/__init__.py\", line 176, in main\r\n    return patroni_main()\r\n  File \"/opt/patroni/patroni/__init__.py\", line 143, in patroni_main\r\n    patroni = Patroni()\r\n  File \"/opt/patroni/patroni/__init__.py\", line 25, in __init__\r\n    self.dcs = get_dcs(self.config)\r\n  File \"/opt/patroni/patroni/dcs/__init__.py\", line 58, in get_dcs\r\n    module = importlib.import_module(module_name)\r\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\r\n    __import__(name)\r\n  File \"/opt/patroni/patroni/dcs/etcd.py\", line 81, in <module>\r\n    class Client(etcd.Client):\r\nAttributeError: 'module' object has no attribute 'Client'\r\nroot@myDocker1:/opt/patroni# python --version\r\nPython 2.7.12\r\nroot@myDocker1:/opt/patroni# psql --version\r\npsql (PostgreSQL) 10.3 (Ubuntu 10.3-1.pgdg16.04+1)\r\n\r\nroot@myDocker1:/opt/patroni# sudo pip install -r requirements.txt\r\nRequirement already satisfied: urllib3!=1.21,>=1.19.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))\r\nRequirement already satisfied: boto in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2))\r\nRequirement already satisfied: psycopg2>=2.5.4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 3))\r\nRequirement already satisfied: PyYAML in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 4))\r\nRequirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5))\r\nRequirement already satisfied: six>=1.7 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 6))\r\nRequirement already satisfied: kazoo>=1.3.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 7))\r\nRequirement already satisfied: python-etcd<0.5,>=0.4.3 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 8))\r\nRequirement already satisfied: python-consul>=0.7.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 9))\r\nRequirement already satisfied: click>=4.1 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 10))\r\nRequirement already satisfied: prettytable>=0.7 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 11))\r\nRequirement already satisfied: tzlocal in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 12))\r\nRequirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 13))\r\nRequirement already satisfied: psutil in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 14))\r\nRequirement already satisfied: cdiff in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 15))\r\nRequirement already satisfied: kubernetes==3.0.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 16))\r\nRequirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests->-r requirements.txt (line 5))\r\nRequirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests->-r requirements.txt (line 5))\r\nRequirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests->-r requirements.txt (line 5))\r\nRequirement already satisfied: dnspython>=1.13.0 in /usr/local/lib/python2.7/dist-packages (from python-etcd<0.5,>=0.4.3->-r requirements.txt (line 8))\r\nRequirement already satisfied: pytz in /usr/local/lib/python2.7/dist-packages (from tzlocal->-r requirements.txt (line 12))\r\nRequirement already satisfied: ipaddress>=1.0.17 in /usr/local/lib/python2.7/dist-packages (from kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: websocket-client<=0.40.0,>=0.32.0 in /usr/local/lib/python2.7/dist-packages (from kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: google-auth>=1.0.1 in /usr/local/lib/python2.7/dist-packages (from kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: setuptools>=21.0.0 in /usr/local/lib/python2.7/dist-packages (from kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python2.7/dist-packages (from google-auth>=1.0.1->kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: cachetools>=2.0.0 in /usr/local/lib/python2.7/dist-packages (from google-auth>=1.0.1->kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python2.7/dist-packages (from google-auth>=1.0.1->kubernetes==3.0.0->-r requirements.txt (line 16))\r\nRequirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python2.7/dist-packages (from rsa>=3.1.4->google-auth>=1.0.1->kubernetes==3.0.0->-r requirements.txt (line 16)\r\n"},"comment":{"url":"https://api.github.com/repos/zalando/patroni/issues/comments/377330504","html_url":"https://github.com/zalando/patroni/issues/652#issuecomment-377330504","issue_url":"https://api.github.com/repos/zalando/patroni/issues/652","id":377330504,"user":{"login":"tschmidt82","id":11042643,"avatar_url":"https://avatars2.githubusercontent.com/u/11042643?v=4","gravatar_id":"","url":"https://api.github.com/users/tschmidt82","html_url":"https://github.com/tschmidt82","followers_url":"https://api.github.com/users/tschmidt82/followers","following_url":"https://api.github.com/users/tschmidt82/following{/other_user}","gists_url":"https://api.github.com/users/tschmidt82/gists{/gist_id}","starred_url":"https://api.github.com/users/tschmidt82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschmidt82/subscriptions","organizations_url":"https://api.github.com/users/tschmidt82/orgs","repos_url":"https://api.github.com/users/tschmidt82/repos","events_url":"https://api.github.com/users/tschmidt82/events{/privacy}","received_events_url":"https://api.github.com/users/tschmidt82/received_events","type":"User","site_admin":false},"created_at":"2018-03-29T18:32:29Z","updated_at":"2018-03-29T18:33:32Z","author_association":"NONE","body":"```\r\nroot@0310e3221f75:/tmp/patroni# su user -c \"cd /tmp/patroni/ && ./patroni.py postgres0.yml \"\r\n2018-03-29 18:30:26,975 INFO: Selected new etcd server http://127.0.0.1:2379\r\n2018-03-29 18:30:26,980 INFO: Lock owner: None; I am postgresql0\r\n2018-03-29 18:30:26,981 INFO: trying to bootstrap a new cluster\r\n2018-03-29 18:30:26,986 ERROR: Exception during execution of long running task bootstrap\r\nTraceback (most recent call last):\r\n  File \"/tmp/patroni/patroni/async_executor.py\", line 97, in run\r\n    wakeup = func(*args) if args else func()\r\n  File \"/tmp/patroni/patroni/postgresql.py\", line 1556, in bootstrap\r\n    return do_initialize(config) and self.write_pg_hba(pg_hba) and self.save_configuration_files() \\\r\n  File \"/tmp/patroni/patroni/postgresql.py\", line 537, in _initdb\r\n    ret = self.pg_ctl('initdb', *options)\r\n  File \"/tmp/patroni/patroni/postgresql.py\", line 283, in pg_ctl\r\n    return subprocess.call(pg_ctl + ['-D', self._data_dir] + list(args), **kwargs) == 0\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 523, in call\r\n    return Popen(*popenargs, **kwargs).wait()\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 711, in __init__\r\n    errread, errwrite)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 1343, in _execute_child\r\n    raise child_exception\r\nOSError: [Errno 2] No such file or directory\r\n2018-03-29 18:30:26,990 INFO: removing initialize key after failed attempt to bootstrap the cluster\r\n2018-03-29 18:30:27,480 INFO: Lock owner: None; I am postgresql0\r\nTraceback (most recent call last):\r\n  File \"./patroni.py\", line 6, in <module>\r\n    main()\r\n  File \"/tmp/patroni/patroni/__init__.py\", line 176, in main\r\n    return patroni_main()\r\n  File \"/tmp/patroni/patroni/__init__.py\", line 145, in patroni_main\r\n    patroni.run()\r\n  File \"/tmp/patroni/patroni/__init__.py\", line 114, in run\r\n    logger.info(self.ha.run_cycle())\r\n  File \"/tmp/patroni/patroni/ha.py\", line 1134, in run_cycle\r\n    info = self._run_cycle()\r\n  File \"/tmp/patroni/patroni/ha.py\", line 1058, in _run_cycle\r\n    return self.post_bootstrap()\r\n  File \"/tmp/patroni/patroni/ha.py\", line 962, in post_bootstrap\r\n    self.cancel_initialization()\r\n  File \"/tmp/patroni/patroni/ha.py\", line 957, in cancel_initialization\r\n    raise PatroniException('Failed to bootstrap cluster')\r\npatroni.exceptions.PatroniException: 'Failed to bootstrap cluster'\r\nroot@0310e3221f75:/tmp/patroni# ps -aux\r\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\r\nroot         1  0.0  0.1  18248  3232 pts/0    Ss   18:16   0:00 bash\r\nroot      4133  0.1  0.8 160976 17496 pts/0    Sl   18:19   0:00 etcd --data-dir=data/etcd\r\nroot      7281  0.0  0.1  34424  2868 pts/0    R+   18:30   0:00 ps -aux\r\nroot@0310e3221f75:/tmp/patroni# su user -c echo $PATH\r\n\r\nroot@0310e3221f75:/tmp/patroni# su user -c \"echo $PATH\"\r\n/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin/\r\nroot@0310e3221f75:/tmp/patroni#\r\n\r\n```"}}
{"actor":{"display_login":"tschmidt82"}}