Deployment to Appengine Fails: PyOpenSSL not Available

I have a Java/Maven multi module project which builds already successful on circleci.

I’ve used following commands to deploy to appengine:

develop:
# automatically deploy the develop branch to appengine version “develop”
branch: develop
commands:
# this produces an error: “you do not have permission to modify the Google Cloud SDK installation directory [/opt/google-cloud-sdk].”
#- gcloud --quiet components update
- gcloud auth activate-service-account eaternity-app@appspot.gserviceaccount.com --key-file ${HOME}/client-secret.json
- gcloud config set project $GCLOUD_PROJECT
- gcloud -q preview app deploy app.yaml --promote --version=develop

I’m getting following Error from CircleCI:

gcloud auth activate-service-account eaternity-app@appspot.gserviceaccount.com --key-file ${HOME}/client-secret.json returned exit code 1

ERROR: (gcloud.auth.activate-service-account) PyOpenSSL is not available. See https://developers.google.com/cloud/sdk/crypto for details. Action failed: gcloud auth activate-service-account eaternity-app@appspot.gserviceaccount.com --key-file ${HOME}/client-secret.json

I expected PyOpenSSL to be included in the pre-installed Appengine SDK bundle on CircleCI.

I’ve saved the client secret in the pre-dependency phase:

  • echo $CLIENT_SECRET | base64 --decode > ${HOME}/client-secret.json

Any ideas on how to proceed? Is the error misleading?

thnx for help and best regards
Aurelian

Anyone any news regarding this topic? Someone else experiencing the same or is this somewhat connected to my configuration?

I am running into this same issue, I have tried installing PyOpenSSL with pip, apt-get for both python2 and python3 with no luck, I will post here if I find a work-a-round…

not sure if your still having this issue or if others are but I found a work around.

if you do the following in your build or deploy stage you can get a working google cloud sdk…

sudo apt-get remove python-virtualenv python-openssl python3-openssl
sudo apt-get update
sudo apt-get install python-openssl python3-openssl
sudo rm -rf /opt/google-cloud-sdk/
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
export CLOUDSDK_PYTHON_SITEPACKAGES=1
curl https://sdk.cloud.google.com | bash
source ~/.bashrc
export CLOUDSDK_CORE_DISABLE_PROMPTS=0

Then use gcloud as normal and I don’t run into the PyOpenssl errors.

Edit: In the post below I’ve just set the variable wrongly…

However, this (of course [ACCOUNT] is replaced with my account email)

    - echo $GCLOUD_CLIENT_SECRET | base64 --decode > ${HOME}/client-secret.json
    - gcloud auth activate-service-account --key-file ${HOME}/client-secret.json [ACCOUNT]
    - gcloud config set project $GCLOUD_PROJECT
    - gcloud -q preview app deploy ${HOME}/.../WEB-INF/appengine-web.xml --promote --version=circle-test

does not have the pyOpenSSL problem.
(But another one like this:
File [/home/.../appengine-web.xml] is not a valid deployable yaml file
)

I am working with a Java-Appengine project.

Old:
Thanks for your workaround idea.

However, when circle tried to execute the line
curl https://sdk.cloud.google.com | bash
it stopped, uttering
Installation directory (this will create a google-cloud-sdk subdirectory) (/home/ubuntu):
It wants some input here, but the circle build does not supply any…

How did you get pass this step?

@CircleCI-Employees any official word on this ?