Hey,
yesterday I deploy test scheduled function, but unfortunately there is no evidence the function to be invoked. As you can see on a screenshot everything looks correctly setuped and if I invoked it locally it works as expected. Do you have any suggestions?
P.S. I tested different function syntax, inline, toml schedules, etc
I’m also facing the same issue, but can’t figure out why my scheduled function isn’t invoked
I tried with a simple scheduled function based on these docs: Scheduled Functions | Netlify Docs
Also this test-scheduled-function seems to get deployed but ultimately not invoked on the published site. My project is setup with turborepo and has two main apps: app & web.
Build settings for app (scheduled function is used only in app):
Base directoy: /
Package directory: apps/app
Build command: turbo run build --filter app
Publish directory: apps/app/.next
Functions directory: netlify/functions
We were able to check within our internal logs, that the scheduled functions are running for your site. Both the schedule functions named scheduled-function and test-scheduled-function.
If you’re looking in the function logs, the scheduled functions will only show if you’ve added console.log() (or other logging) to the scheduled functions.
I made a test site using:
exports.handler = async () => {
console.log("Scheduled Function is running at", new Date().toISOString());
return {
statusCode: 200,
body: "Scheduled Function executed successfully!",
};
};
Thanks for following up. Would you be able to share a minimum reproduction? As I’m unable to replicate an issue, the scheduled function I shared is working and I do see the console.logs in the function logs as well that the functions are being invoked on the function metrics page. So I’m at a lost why it’s not working for you. If you could share a minimum reproduction or make your github repo public that’ll give us a chance to review.
so it seems that my other repository, something is causing the functions not to be triggered, need to debug this further why that’s the case. Can you check if my DNS for the site appsummercamp-nak is correctly setup and has no inactive DNS zones? Thanks
Yep, looks like the DNS is setup correctly. I’m showing that you’re using the Netlify name servers:
dig summercamp-nak.ch NS +trace | tail -n 6
summercamp-nak.ch. 3600 IN NS dns1.p09.nsone.net.
summercamp-nak.ch. 3600 IN NS dns2.p09.nsone.net.
summercamp-nak.ch. 3600 IN NS dns3.p09.nsone.net.
summercamp-nak.ch. 3600 IN NS dns4.p09.nsone.net.
;; Received 135 bytes from 198.51.44.73#53(dns3.p09.nsone.net) in 31 ms
Our Support Guide for inactive DNS zones here:
helps explain the steps you can follow to see if the zone is inactive and how to fix it.