Denzel
Denzel

Reputation: 358

Unable to deploy google cloud functions

I tried to deploy a cloud function on the google cloud platform using the my console. The command I used was,

gcloud functions deploy function_name --runtime=python37 --memory=1024MB --region=asia-northeast1 --allow-unauthenticated --trigger-http

But I am getting this error,

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed: could not resolve storage source: googleapi: Error 404: Not Found, notFound

I tried googling around but it seems like no one had faced this error message before. I have also tried changing project and deployment is working fine.

gcloud config set project another_project

Appreciate it if anyone have any idea on what is causing this error and how I can solve it. Thanks!

Upvotes: 4

Views: 3468

Answers (3)

AgentFog
AgentFog

Reputation: 11

Update:

https://issuetracker.google.com/175866925


Update from GCP Support: That does not resolve my problem at all.

First they said they need to recreate that bucket. Meanwhile they said that does not resolve the problem and they are still investigating the problem.

Just for testing I created that Bucket my self as Oru said.

Still the same error. I will update this tread when I got new information.

Upvotes: 0

Oru
Oru

Reputation: 131

As per the documentation here - https://cloud.google.com/functions/docs/building it says that : Because Cloud Storage is used directly in your project, the source code directory for your functions is visible, in a bucket named:

gcf-sources-<PROJECT_NUMBER>-<REGION>

Therefore, if you delete the bucket in cloud storage, then you need to re create this bucket. For example if your project number is 123456789 running on asia-south1 then the bucket name should be: gcf-sources-123456789-asia-south1

Once you re create the bucket then you can use gcloud or firebase cli to deploy and it should work normally.

Hope this helps. It worked for me!

Enjoy!

Upvotes: 5

AgentFog
AgentFog

Reputation: 11

Please check if a bucket named gcf-sources-**** is available. If not, you will need to contact gcloud support to request that particular bucket to be rebuiled.

Upvotes: 1

Related Questions