Reputation: 41
Deploying cloud function with gcloud
failed with below message,
ERROR: (gcloud.beta.functions.deploy) OperationError: code=13, message=Failure in the execution environment
Couldn`t find much information about the error in the cloud function logs.
Running deploy with --verbose debug
traces the functions called in the Cloud SDK directory and ends with displaying the below error,
FunctionsError: OperationError: code=13, message=Failure in the execution environment ERROR: (gcloud.beta.functions.deploy) OperationError: code=13, message=Failure in the execution environment
Upvotes: 4
Views: 7483
Reputation: 173
The problem with Node.js environments that they store dependencies locally in your project's directory.
Basically, before deploying your function, you will need to first delete the node_modules directory and then deploying the function to the cloud.
Upvotes: 0
Reputation: 3441
For my case, it was a python environment, and the culprit was a dependency yarl==1.5.1
.
As there are no logs, I couldn't tell exactly why yarl
was causing the breakage, but downgrading to yarl==1.3.0
fixed the issue for me.
Upvotes: 1
Reputation: 6131
Some of the GCP errors are broad.
The solution to this for me was my go.mod
file had go 1.14
while the GCP only supports go 1.11
or go 1.13
Upvotes: 0
Reputation: 8367
Just sharing our experience here, with the hope it helps someone in the future.
In our case we got a similar error:
ERROR: (gcloud.beta.functions.deploy) OperationError: code=13, message=Error setting up the execution environment for your function. Please try deploying again after a few minutes.
This was caused by an import of package.json
in the code to read out the version. I.e.:
import { version } from '../package.json';
Transpilation and local invocation of the generated JS code worked as expected with the above line in our code base. After we removed the import, we were able to deploy the function agian.
Upvotes: 0
Reputation: 562
The status of firebase can be found under: https://status.firebase.google.com/
Upvotes: 0
Reputation: 591
Per this Google Public Issue Tracker, the error is due to a very large package.json file hitting an internal restriction. Possible workarounds:
1- Installing your dependencies locally (through 'npm install') and deploying with --include-ignored-files
flag.
2- Reduce your package.json to less than 4000 characters
This is an ongoing issue and you can follow the discussion on this thread for related updates.
Upvotes: 4