Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function does not exist error #90

Open
kospol opened this issue Nov 8, 2017 · 4 comments
Open

Function does not exist error #90

kospol opened this issue Nov 8, 2017 · 4 comments

Comments

@kospol
Copy link

kospol commented Nov 8, 2017

Serverless deploy creates this error. It looks like something is wrong on the google side. This behavior is happening after I remove a function that used to be there, but the error names my current function.

For example I had two functions, FUNCTIONNAME1, FUNCTIONNAME2. Both of them are deployed. I remove FUNCTIONNAME1 and deploy again. I get this error:

Serverless: Checking deployment update progress... 
  Error --------------------------------------------------
  Deployment failed: RESOURCE_ERROR
     {"ResourceType":"cloudfunctions.v1beta2.function","ResourceErrorCode":"404","ResourceErrorMessage":{"code":404,"message":"Function FUNCTIONNAME2 in region us-central1 in project PROJECTNAME does not exist","status":"NOT_FOUND","details":[],"statusMessage":"Not Found","requestPath":"https://cloudfunctions.googleapis.com/v1beta2/projects/PROJECTNAME/locations/us-central1/functions/FUNCTIONNAME2","httpMethod":"GET"}}
@thucnc
Copy link

thucnc commented Nov 21, 2018

Hey, i got the same issue, anyone can advise ?

@sketchthat
Copy link

This happened to me in my staging environment, so I was able to delete some resources to clear the error.

I removed my Storage Buckets and also my Deployment Manager > Deployments and then was able to re-deploy without any issues.

@dylanbathurst
Copy link

Just ran into this as well. I think it has to do with weird Google caching. Don't delete the storage bucket as serverless will still expect it to exists and throw a Not Found error, just delete everything inside the bucket, run serverless remove and then serverless deploy. That should kind of reset things for you.

@per-garden
Copy link

Using serverless-google-cloudfunctions v3.1.1 i encountered this problem over and over again.
In node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js, from line 34 and onwards, I changed from:

const deployment = response.deployments.find((dep) => dep.name === deploymentName);

// if actions is "remove" and deployment disappeared then set to "DONE"
if (!deployment && action === 'remove') {
  deploymentStatus = 'DONE';
  callback();
}

throwErrorIfDeploymentFails(deployment);

to:

const deployment = response.deployments.find((dep) => dep.name === deploymentName);

if (!deployment) {
// if actions is "remove" and deployment disappeared then set to "DONE"
  if (action === 'remove') {
    deploymentStatus = 'DONE';
    callback();
  }
  else {
    throwErrorIfDeploymentFails(deployment);
  }
}

After that everything was OK. Non-existent deployment not only when action === 'remove' apparently. I wonder if this is a bug, or a symptom of some other problem.

bnwhco added a commit to Pioneera/serverless-google-cloudfunctions that referenced this issue May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment