I am running into a serverless function crash on one of my deployments that is repeatedly resulting in the following error in the Netlify logs:
Apr 24, 01:50:15 PM: [ERROR] Function logs are currently unavailable. We are working on resolving the issue.
It’s an API endpoint for a POST request. The request does successfully return 400 with a data validation error. That’s what I am trying to debug, but without any logs I can’t debug the issue.
Thanks for reaching out, and sorry about the trouble!
I’m not able to replicate the issue as it appears that the function logs are working. Going to the function log and invoking the function I am seeing logs and not getting the error. I’ve tested Real-time, Last Hour, Last 2 hours, and Last day. Are you still seeing the error:
[ERROR] Function logs are currently unavailable. We are working on resolving the issue.
It may have been a temporary issue, could you let us know if you’re still seeing this issue and if you are, how to replicate?
I found the bug in my code. I had forgotten to add middleware to extract the json from the post body. Once I added the middleware the logs stopped crashing.
I’m still confused why this would cause the logs to crash. Is that expected?
It’s the next day now and it’s happening, somewhat intermittently. At first it happened, then it cleared up for a couple of requests, now it’s happening again.
I deployed successfully:
Production Published
5:33 AM: No deploy message
Then after the post request:
Apr 26, 05:41:33 AM: [ERROR] Function logs are currently unavailable. We are working on resolving the issue.
It’s virtually impossible to do anything when the system is behaving so erratically. I’m completely blocked. What’s going on?
Hi @mjgs thanks for reaching out. I don’t think this is a Netlify issue…
Can you try logging in and out of the UI. Are you running any plugins? And check that your browser is not blocking required API calls as this could be what’s causing the problem.
I doubt connectivity (good, bad, or otherwise) between the browser and the environment running the function has anything to do with the logs not working.
Does the function send/receive data from another service? Then perhaps there is an issue in that call which is not caught by the function you have implemented that causes the crash. Without knowing what the function does, without seeing the code, all anyone can do is make guesses.
Without knowing what the function does, without seeing the code, all anyone can do is make guesses.
That seems weird to me. Surely you shouldn’t be able to crash the logs from inside the function. At worst it should just not print anything except memory usage etc.
It would be useful to know if bad internet connectivity could crash the logs. Based on what was mentioned earlier about API calls being blocked, it seems as though that could be a possibility right?
Incidentally, it’s been working fine the past few hours.
I’m not sure if internet connectivity could crash the logs, however, I have checked and I’m not seeing reports of others having this issue.
The next best step for troubleshooting would be if you are able to provide a HAR recording of the issue happening. Please be aware that HAR files capture all HTTP headers and cookies, we recommend removing any sensitive details in the HAR file (he HAR file can be edited - it’s JSON formatted text - to XXXX out the value of your Authorization header if you use http basic auth, for instance).
If you don’t want to share the file publicly (as the file could contain sensitive information), you can share the file privately.
I’m not able to provide the extra details you asked for at this time.
I’m going to have to assume the logs are crashing because of my poor internet connectivity. My internet connection is being massively throttled at times. It’s been happening for a few weeks now and coincides roughly with when the logs started crashing.
That’s what’s blocking me.
Today it happened a few times, but after reloading the logs page a few times (which takes up to 30-45 seconds at times) the issue cleared up.