Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud functions cache code and not update in new deploy

Hi, 

I am using Functions to manage the communication between my APP and Stripe. The problem I have is that even though I make changes to the code and then deploy the changes and even see the new code in the "source" tab of project, when I run the function it still runs old code. I've deleted the function and recreated it and nothing, it's still executing old code.

This is the update code:

Captura de pantalla 2022-09-19 a las 19.00.42.png

And this is request in Stripe:

Captura de pantalla 2022-09-19 a las 19.02.11.png

In addition to not being updated, when I receive the webhook from Stripe to update the order status, this gives an error because that parameter was not in the old code, therefore later it does not find the firestore document.

Thanks in advance

0 2 3,998
2 REPLIES 2

JGerman23
Former Googler

It seems to be caused by a missing/inaccessible file in the restore/rollback process.

I was successfully removing the problem by simply:

  1. Deleting functions using the web firebase console.
  2. Deploying normally again >firebase deploy

Review the following documentation of gcloud functions deploy.

Additionally you could also run firebase deploy --only functions again and it deployed successfully.

Also, I found two stackoverflow links that may help you with your issue.

Yes this worked. Thanks

Top Solution Authors