2

When I try to deploy a Google Cloud Function using the gcloud CLI I'm getting the following error:

ERROR: (gcloud.functions.deploy) EOF occurred in violation of protocol (_ssl.c:727)
This may be due to network connectivity issues. Please check your network settings, and the status of the service you are trying to reach.

I reinstalled the gcloud command-line tool and also ran brew upgrade to update brew packages, but did not work for me. Why am I getting this error?

1
  • Can you give more informations regarding what you are trying to update? You should also check the packages you update with brew maybe something was not installed or updated properly and it might be the reason you cannot deploy. You could try: brew list | xargs brew reinstall Commented Dec 30, 2019 at 13:57

1 Answer 1

2

The error is in the TLS|SSL negotiation between your machine and the service. It could be your machine, an intermediary or Google.

Are you behind a proxy? If there's a proxy, it may be intercepting the call.

Can you do anything else with gcloud perhaps gcloud functions list? If you can issue other commands particularly against Cloud Functions, this adds to the suspicion that it's Google's problem. If you can't, then it's more likely to be your client (and|or proxy) that are in error

If you append --log-http to the deployment (or any gcloud) command you will receive more detailed logging and this may identify the error.

Update (Python)

I tried to repro the error by creating a new project without enabling billing. I used the hello-world sample (link) and was able to deploy and test without issue. I suspect the problem was either an intermittent issue with the server (or perhaps the region). Or, more probably, an issue with the configuration on your machine.

def hello_world(request):
        return "Hello World"

and requirements.txt:

flask==1.1.1

Then:

PROJECT=[[YOUR-PROJECT-ID]]
REGION=us-east1

gcloud projects create ${PROJECT}

gcloud services enable cloudfunctions.googleapis.com \
--project=${PROJECT}

gcloud functions deploy hello_world \
--region=${REGION} \
--project=${PROJECT} \
--entry-point=hello_world \
--runtime=python37 \
--source=${PWD} \
--trigger-http

After deploying successfully, I can:

URL=$(\
  gcloud functions describe hello_world \
  --region=${REGION} \
  --project=${PROJECT} \
  --format="value(httpsTrigger.url)")
curl \
--silent \
--request GET \
"${URL}"
Hello World

Update (Node.JS)

Sorry about that ;-)

exports.helloWorld = (req, res) => {
    res.status(200).send("Hello World");
};

package.json:

{
    "name": "hello-world",
    "version": "0.0.1",
    "dependencies": {}
}

And:

gcloud functions deploy hello_world \
--region=${REGION} \
--project=${PROJECT} \
--entry-point=helloWorld \
--runtime=nodejs10 \
--source=${PWD} \
--trigger-http

Otherwise as before w/ Python.

Works.

Sign up to request clarification or add additional context in comments.

6 Comments

Yes, It works when I run gcloud functions list . But deploy command is not woking.
Interesting It's probably not your local configuration. Did you try adding --log-http to the deploy too? That may provide additional details
What kind of application are you trying to deploy? It's a Python one? The issue seems to be with the SSL installation. If you're using Python I suggest to pip install pyopenssl or if not try to upgrade your version of openssl with homebrew.
No bro it's not python function. It's nodejs function.
Apologies. Revised the Answer to include a Node.JS example. This also works.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.