URGENT: Live Function is NOT updating from latest deploy (stuck on old code)

Hi Netlify Team,

I have a critical issue. My Netlify Function named “paypal-webhook.js” is not updating. It is stuck executing old code, which causes a persistent “unsupported_grant_type” error when it tries to authenticate with the Netlify API.

  • My Site Name: goatify.app
  • Function with the issue: paypal-webhook.js

I need your urgent help because I have already tried all possible troubleshooting steps without success:

  1. I have verified the corrected code is in my GitHub main branch.
  2. I have used the “Clear cache and deploy site” option multiple times.
  3. I have completely deleted and regenerated new NETLIFY_OAUTH_CLIENT_ID and SECRET credentials and updated them in my site’s environment variables.
  4. I even downloaded the deploy ZIP file from a “Published” deploy, and I can confirm that the corrected paypal-webhook.js file IS inside the downloaded build.

Despite all this, the live function continues to execute the old code and fails, as you can see in the attached log from Jul 21, 12:40:57 PM.

This strongly suggests a persistent server-side caching or environment variable propagation issue on your platform. Please investigate the build and function execution environment for my site and force a refresh.

Thank you.

Hi, @danielortegac. The logs do not contain enough detail to determine what the root cause is. To debug this issue, we recommend using console.log() (likely just temporarily to debug this) to log the values of the environment variables you are using to the function logs. If those environment variable are sensitive information, then logging just the start or end the full string can be used to debug what value is set in the function.

If the function logs do show the wrong values being used, please let us know.