I'm a newcomer to Google Functions, and today I encountered an unfamiliar problem. I have two functions (both of which I've been running and successfully using for just over a month). Today, I needed to update one of them. I made the changes, and locally everything works fine.
During deployment (using the command gcloud functions deploy FUNCTION_NAME --gen2 --runtime=nodejs20 --region=europe-north1 --source=. --entry-point=FUNCTION_NAME --trigger-http --allow-unauthenticated), I encountered an issue - the command started running, and nothing happened at all. No matter how long I waited. No errors or anything else. It just hung there. No matter how long I waited, nothing changed.
I tried deploying the second function (which is in a separate project) - everything went as usual, everything worked. I returned to the first one, added --log-http to the command, and saw the following.
=======================
==== request start ====
uri: https://cloudfunctions.googleapis.com/v2/projects/gc-get-session-key/locations/europe-north1/functio...
method: GET
== headers start ==
b'accept': b'application/json'
b'accept-encoding': b'gzip, deflate'
b'authorization': --- Token Redacted ---
b'content-length': b'0'
b'user-agent': b'google-cloud-sdk gcloud/467.0.0 command/gcloud.functions.deploy invocation-id/0ef201269b1f49cab6aee6eb49e2cd2f environment/None environment-version/None client-os/WINDOWS client-os-ver/10.0.22631 client-pltf-arch/x86_64 interactive/True from-script/False python/3.11.6 term/ (Windows NT 10.0.22631)'
b'x-goog-api-client': b'cred-type/u'
== headers end ==
== body start ==
== body end ==
==== request end ====
---- response start ----
status: 200
-- headers start --
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Cache-Control: private
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Date: Tue, 05 Mar 2024 20:40:19 GMT
Server: ESF
Transfer-Encoding: chunked
Vary: Origin, X-Origin, Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
-- headers end --
-- body start --
{
"name": "projects/gc-get-session-key/locations/europe-north1/functions/FUNCTION_NAME",
"buildConfig": {
"build": "projects/405817565296/locations/europe-north1/builds/d6ac0ca0-4402-475f-988e-3d02b736122b",
"runtime": "nodejs20",
"entryPoint": "FUNCTION_NAME",
"source": {
"storageSource": {
"bucket": "gcf-v2-sources-405817565296-europe-north1",
"object": "FUNCTION_NAME/function-source.zip",
"generation": "1707511299621378"
}
},
"dockerRepository": "projects/gc-get-session-key/locations/europe-north1/repositories/gcf-artifacts",
"sourceProvenance": {
"resolvedStorageSource": {
"bucket": "gcf-v2-sources-405817565296-europe-north1",
"object": "FUNCTION_NAME/function-source.zip",
"generation": "1707511299621378"
}
},
"dockerRegistry": "ARTIFACT_REGISTRY"
},
"serviceConfig": {
"service": "projects/gc-get-session-key/locations/europe-north1/services/FUNCTION_NAME",
"timeoutSeconds": 60,
"maxInstanceCount": 6,
"ingressSettings": "ALLOW_ALL",
"uri": "https://FUNCTION_NAME-6pewld2lxq-lz.a.run.app",
"serviceAccountEmail": "405817565296-compute@developer.gserviceaccount.com",
"availableMemory": "1Gi",
"allTrafficOnLatestRevision": true,
"revision": "FUNCTION_NAME-00036-vuz",
"maxInstanceRequestConcurrency": 1,
"availableCpu": "1000m"
},
"state": "ACTIVE",
"updateTime": "2024-02-09T20:44:10.064191403Z",
"labels": {
"deployment-tool": "cli-gcloud"
},
"environment": "GEN_2",
"url": "https://europe-north1-gc-get-session-key.cloudfunctions.net/FUNCTION_NAME",
"createTime": "2024-01-13T20:53:52.337982209Z"
}
-- body end --
total round trip time (request+response): 1.029 secs
---- response end ----
Then, after waiting 10-15 seconds, incredibly meaningless messages started coming in at an INCREDIBLE SPEED.
?_?=???Z?????e??]??Wg??↔?YG??F~???p?T∟Ro??????8s??#??w
g/=????V?r?;?????CY?Fg???G?????Y??%?,???.?↕??.???;?%'??Y????Y"
?x???n↨gIL0??E?'??ar?X???? v?XO??d‼?????x??
No matter how long I waited, nothing changed. These messages continued to come in at an incredible speed.
I tried the following, but it didn't help:
I don't know what to do; I'll be grateful for any hints, thank you.
Hi @arogonov,
Welcome to Google Cloud Community!'
I wasn't able to replicate the issue using sample code and by changing some of the following values when using gcloud functions deploy
:
--allow-unauthenticated
flagTry deploying sample code by following this documentation on creating a Cloud Function by using the Google Cloud CLI.
If the aforementioned steps didn't work, you may file a bug so that our engineers could take a look at this. We don't have a specific ETA but you can keep track of its progress once the ticket has been created.
Hope this helps.