Python
AWS
CircleCI
ElasticBeanstalk

CircleCIでawsebcliを入れる場合はpythonのバージョンを指定しよう

More than 1 year has passed since last update.


問題

awsebcli 3.7.5からCircleCI上でのインストールでエラーが発生するようになった。


circle.yml

dependencies:

pre:
- sudo pip install awsebcli


circleci_error

$ sudo pip install awsebcli

The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '
/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting awsebcli
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning


原因

InsecurePlatformWarning

Python 2.7.9未満だとurllib3で使えるssl moduleの設定が制限されてるのでHTTPSが通らなくなる。恐らくawsebcli 3.7.5でコレ関連の修正が入った事が原因。

そしてなんとCircleciのdefault Python version2.7.6 (2016/04/12現在)


解決

awsebcliのバージョンを固定する方法もあるが個人的にはpythonを上げた方が良いと思ってる。せっかくなので最近よく使ってるaws lambdaのpython 2.7.9と合せておく。(sudoも不要になった)


circle.yml

machine:

python:
version: 2.7.9
dependencies:
pre:
- pip install awsebcli


関連

http://qiita.com/testnin2/items/97ddb749879415b23e18

http://qiita.com/tknzk/items/36b04d337f772908d5c6