I’m hitting issues where for some deploys, our Netlify Function works in production (i.e. the /.netlify/functions/crowdin endpoint returns a 200) but for other deploys, it doesn’t (the endpoint returns a 404).
Running netlify dev locally & accessing the /languages page, the function endpoint (http://localhost:8888/.netlify/functions/crowdin) works as expected. It also was working in production. One recent production deploy, the endpoint (https://ethereum.org/.netlify/functions/crowdin) started 404ing. I tried the “Trigger deploy” → “Clear cache and deploy site” as an experiment & it started working again. Now after each deploy it seems to be a roll of the dice.
Logs from a recent deploy. It seems to consistently build the endpoint:
Equivalent logs of an unsuccessful deploy (triggering another deploy on same exact branch & commit history):
1:22:06 PM: Function Dir: /opt/build/repo/docs/.vuepress/dist/lambda
1:22:06 PM: Skipping functions preparation step: /opt/build/repo/docs/.vuepress/dist/lambda not found
Hi @samajammin and sorry to be slow to get back to you. Seems like we might have had a bug in serving that function. I can’t be sure from our internal logs but I see some 404’s back when you wrote in, but none since soon after that.
Have you seen that happen again since? In the future if you see this, we’d likely have to help resolve it from our side BUT there is a quick workaround for you in that you could rename the function and redeploy (after updating your code references to point to the new function) and it would likely avoid the issue with the new name.
This seems to be consistently failing on deploys now until I trigger a “Clear cache and deploy site”. @fool have any other users notices caching issues around Netlify functions?
Not specifically, no. The failure mode we’ve seen is around our CDN caching software caching pointers to old functions, rather than anything to do with how you build. Clearing cache during build will have no effects on function runtime, unless the function itself is built differently with and without cache. Can you try outputting a checksum of the function file as the last step during your build, for a build with cache and one without, to see if they differ?
If they do, we’ll suggest you debug on the build side; if they don’t, then it might be a bug on our side.
Figured out the issue - it was a bone-headed setup on my end , sorry for taking up your time.
My build steps were running in parallel & outputting to the same /dist directory, so occasionally my app build was overwriting my lambda build output. The solution was to run them sequentially:
@futuregerald@fool I am experiencing inconsistent uptime from Netlify functions. For context, I have a browser extension that hits my Netlify functions endpoint. If I stop testing it for awhile, it will start working again. Running Netlify functions locally work well, so that has deduced the error to uptime on Netlify. Please let me know what you need / how I can resolve this.
Thanks!
hey @jsl15c - this might be related/similar, it might not. I would suggest you create a new post with more information for us - such as, your netlify name, what you have already tried, some code code we can look at, etc etc. You can include a link that references this thread if you want.
Sounds like you are maybe hitting a timeout of some kind - hard to say with the information provided.