{"action":"created","issue":{"url":"https://api.github.com/repos/letsencrypt/lets-encrypt-preview/issues/152","labels_url":"https://api.github.com/repos/letsencrypt/lets-encrypt-preview/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/letsencrypt/lets-encrypt-preview/issues/152/comments","events_url":"https://api.github.com/repos/letsencrypt/lets-encrypt-preview/issues/152/events","html_url":"https://github.com/letsencrypt/lets-encrypt-preview/issues/152","id":53226257,"number":152,"title":"First run of setup.py fails when setting up M2Crypto","user":{"login":"JensErat","id":628441,"avatar_url":"https://avatars.githubusercontent.com/u/628441?v=3","gravatar_id":"","url":"https://api.github.com/users/JensErat","html_url":"https://github.com/JensErat","followers_url":"https://api.github.com/users/JensErat/followers","following_url":"https://api.github.com/users/JensErat/following{/other_user}","gists_url":"https://api.github.com/users/JensErat/gists{/gist_id}","starred_url":"https://api.github.com/users/JensErat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JensErat/subscriptions","organizations_url":"https://api.github.com/users/JensErat/orgs","repos_url":"https://api.github.com/users/JensErat/repos","events_url":"https://api.github.com/users/JensErat/events{/privacy}","received_events_url":"https://api.github.com/users/JensErat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-01T19:09:55Z","updated_at":"2015-01-01T22:57:12Z","closed_at":null,"body":"While constructing a Docker file, I got into trouble while running  `./venv/bin/python setup.py install`, which fails when running the first time (but succeeds on the second run).\r\n\r\nStacktrace of the error:\r\n\r\n    Searching for M2Crypto\r\n    Reading https://pypi.python.org/simple/M2Crypto/\r\n    Best match: M2Crypto 0.22.3\r\n    Downloading https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz#md5=573f21aaac7d5c9549798e72ffcefedd\r\n    Processing M2Crypto-0.22.3.tar.gz\r\n    Writing /tmp/easy_install-KBq_4X/M2Crypto-0.22.3/setup.cfg\r\n    Running M2Crypto-0.22.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-KBq_4X/M2Crypto-0.22.3/egg-dist-tmp-iRNoDy\r\n    Traceback (most recent call last):\r\n      File \"setup.py\", line 57, in <module>\r\n        include_package_data=True,\r\n      File \"/usr/lib/python2.7/distutils/core.py\", line 151, in setup\r\n        dist.run_commands()\r\n      File \"/usr/lib/python2.7/distutils/dist.py\", line 953, in run_commands\r\n        self.run_command(cmd)\r\n      File \"/usr/lib/python2.7/distutils/dist.py\", line 972, in run_command\r\n        cmd_obj.run()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/install.py\", line 74, in run\r\n        self.do_egg_install()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/install.py\", line 97, in do_egg_install\r\n        cmd.run()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 358, in run\r\n        self.easy_install(spec, not self.no_deps)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 574, in easy_install\r\n        return self.install_item(None, spec, tmpdir, deps, True)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 625, in install_item\r\n        self.process_distribution(spec, dist, deps)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 671, in process_distribution\r\n        [requirement], self.local_index, self.easy_install\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/pkg_resources.py\", line 580, in resolve\r\n        dist = best[req.key] = env.best_match(req, ws, installer)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/pkg_resources.py\", line 818, in best_match\r\n        return self.obtain(req, installer) # try and download/install\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/pkg_resources.py\", line 830, in obtain\r\n        return installer(requirement)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 593, in easy_install\r\n        return self.install_item(spec, dist.location, tmpdir, deps)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 623, in install_item\r\n        dists = self.install_eggs(spec, download, tmpdir)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 809, in install_eggs\r\n        return self.build_and_install(setup_script, setup_base)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 1015, in build_and_install\r\n        self.run_setup(setup_script, setup_base, args)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py\", line 1000, in run_setup\r\n        run_setup(setup_script, args)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 50, in run_setup\r\n        lambda: execfile(\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 100, in run\r\n        return func()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/sandbox.py\", line 52, in <lambda>\r\n        {'__file__':setup_script, '__name__':'__main__'}\r\n      File \"setup.py\", line 148, in <module>\r\n        \r\n      File \"/usr/lib/python2.7/distutils/core.py\", line 151, in setup\r\n        dist.run_commands()\r\n      File \"/usr/lib/python2.7/distutils/dist.py\", line 953, in run_commands\r\n        self.run_command(cmd)\r\n      File \"/usr/lib/python2.7/distutils/dist.py\", line 972, in run_command\r\n        cmd_obj.run()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/bdist_egg.py\", line 177, in run\r\n        self.run_command(\"egg_info\")\r\n      File \"/usr/lib/python2.7/distutils/cmd.py\", line 326, in run_command\r\n        self.distribution.run_command(command)\r\n      File \"/usr/lib/python2.7/distutils/dist.py\", line 972, in run_command\r\n        cmd_obj.run()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/egg_info.py\", line 163, in run\r\n        self.find_sources()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/egg_info.py\", line 186, in find_sources\r\n        mm.run()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/egg_info.py\", line 246, in run\r\n        self.add_defaults()\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/egg_info.py\", line 282, in add_defaults\r\n        sdist.add_defaults(self)\r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/sdist.py\", line 179, in add_defaults\r\n        build_ext = self.get_finalized_command('build_ext')\r\n      File \"/usr/lib/python2.7/distutils/cmd.py\", line 312, in get_finalized_command\r\n        cmd_obj.ensure_finalized()\r\n      File \"/usr/lib/python2.7/distutils/cmd.py\", line 109, in ensure_finalized\r\n        self.finalize_options()\r\n      File \"setup.py\", line 69, in finalize_options\r\n        \r\n      File \"/opt/lets-encrypt-preview/venv/local/lib/python2.7/site-packages/setuptools/command/build_ext.py\", line 108, in finalize_options\r\n        _build_ext.finalize_options(self)\r\n      File \"/usr/lib/python2.7/distutils/command/build_ext.py\", line 182, in finalize_options\r\n        if os.name == 'nt':\r\n    AttributeError: 'NoneType' object has no attribute 'name'\r\n\r\nDockerfile used so far (will put it on Github and post on mailing list when finished), as workaround I'm simply running the command twice (when it fails, which is currently always):\r\n\r\n    FROM ubuntu:trusty\r\n    MAINTAINER Jens Erat <email@jenserat.de>\r\n    \r\n    EXPOSE 80 443\r\n    \r\n    ENV DEBIAN_FRONTEND noninteractive\r\n    RUN \\\r\n      apt-get update && \\\r\n      apt-get install --no-install-recommends -y apache2 && \\\r\n      apt-get install --no-install-recommends -y openssl ca-certificates git && \\\r\n      apt-get install --no-install-recommends -y python python-setuptools python-virtualenv python-dev gcc swig dialog libaugeas0 libssl-dev && \\\r\n      apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\r\n    \r\n    # Quick and dirty fix for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696327\r\n    RUN ln -s /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/\r\n    \r\n    RUN cd /opt && git clone https://github.com/letsencrypt/lets-encrypt-preview.git\r\n    WORKDIR /opt/lets-encrypt-preview\r\n    # For some reason, first installation attempt fails\r\n    RUN \\\r\n      virtualenv --no-site-packages -p python2 venv && \\\r\n      ./venv/bin/python setup.py install || \\\r\n      ./venv/bin/python setup.py install\r\n\r\nThe link used is a workaround for a Debian/Ubuntu issue, I don't think letsencrypt is in charge here."},"comment":{"url":"https://api.github.com/repos/letsencrypt/lets-encrypt-preview/issues/comments/68501306","html_url":"https://github.com/letsencrypt/lets-encrypt-preview/issues/152#issuecomment-68501306","issue_url":"https://api.github.com/repos/letsencrypt/lets-encrypt-preview/issues/152","id":68501306,"user":{"login":"JensErat","id":628441,"avatar_url":"https://avatars.githubusercontent.com/u/628441?v=3","gravatar_id":"","url":"https://api.github.com/users/JensErat","html_url":"https://github.com/JensErat","followers_url":"https://api.github.com/users/JensErat/followers","following_url":"https://api.github.com/users/JensErat/following{/other_user}","gists_url":"https://api.github.com/users/JensErat/gists{/gist_id}","starred_url":"https://api.github.com/users/JensErat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JensErat/subscriptions","organizations_url":"https://api.github.com/users/JensErat/orgs","repos_url":"https://api.github.com/users/JensErat/repos","events_url":"https://api.github.com/users/JensErat/events{/privacy}","received_events_url":"https://api.github.com/users/JensErat/received_events","type":"User","site_admin":false},"created_at":"2015-01-01T22:57:12Z","updated_at":"2015-01-01T22:57:12Z","body":"The full Dockerfile is also available on https://github.com/JensErat/docker-lets-encrypt-preview - might be pretty convenient for debugging the issue. I have no idea what's going wrong here."}}