Can't open recently created cloud function to edit/update, but functions still trigger successfully

Viewed 1619

We recently pushed a set of our functions into a new project and after deploying we noticed that we cannot access any of the functions through the GCP interface. Whenever we select a function, we get a "Failed to Load." error and then the text:

There was an error while loading /functions/details/us-central1/[function name]?project=[project-id]. Please try again.

These functions are still running successfully upon triggering, but we can't access them to make any changes.

Any suggestions? Should we delete and redeploy?

We are using the in-line editor, & Python 3.7.

EDIT: Additional Details

We have also seen issues when trying to deploy scheduled queries, any click to create sends us right back to the BQ UI. A few of our BQ tables won't load into table preview, but can still be queried.

EDIT: Added photo Cloud Function Failed to Load

1 Answers

This can be a trantient issue.

While the Cloud functions are not editable on the console the work around is is tu use the Cloud Functions API to retrive the code, then you can edit the code on your local host and finally deploy it again with the corrections with the gcloud command.

for this the steps are:

  1. Run teh following command on CloudShell

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" https://cloudfunctions.googleapis.com/v1/projects/<PROJECT_ID>/locations/<LOCATION>/functions/<FUNCTION_ID>:generateDownloadUrl

  1. This will generate a URL where you can download your code on a zipfile. Download it
  2. Uncompress the zipfile and update your code as intended
  3. Update your file as intended
  4. on cloud shell move to an empty folder
  5. Upload the files to Cloud Shell (for this you can go to Options-> Upload File)
  6. use the command to deploy the cloud function: gcloud functions deploy
Related