The staging site is used by devs to test new features and releases, the live site is used for the final product. We have created a simple contact us form that, when submitted, triggers the submission-created function and emails the customer with a thank you and emails the staff with the detail in the form. This successfully runs on the staging site but not on the live site, even though the codebase is exactly the same, they are both attached to the master branch and I can’t see any other differences on the Netlify UI.
Many thanks for the fast reply. I have checked out the support guide and related topics but they don’t seem to have the same issue as we are facing. The form names are Contact, OverseasTravelRequest and DemoRequest. None work. If you are testing, please use the contact form (as opposed to the other forms) on the live site as we have temporarily redirected hooks to a different email address.
What we have tried/checked
Cleaning cache and redeploying
Simplifying the function so that it just logs a success message
Checked the env vars to see if they differ in any important way
Checked the build logs (both the same/no errors)
Both are running form detection
Both have the same build process
Forms successfully submit, store the form on Netlify UI & trigger email hooks
This is interesting. You’re absolutely correct. You’re receiving the (verified) submissions in the UI, but the function itself is not triggering at all.
What’s interesting is, there are no logs for that function ever being called - it’s as if it just doesn’t exist. For the staging, I can see the logs, not for production. It does seem like someone tried to directly call the function endpoint in the browser on Sep 15. But, that’s about it.
If it’s possible, could you try removing the custom domain from the production website, trigger a re-deploy and check?
Hi @hrishikesh, thanks for the help! We would be very hesitant to remove the custom domain as we have quite a large traffic flow towards the site (around 40 users/h). We could potentially try this as a last resort at 3 AM GMT so that fewer customers are affected, but is there any other avenues we could take beforehand?
Well, you could setup another website from the same repo and add the custom domain to it so that we can check on this one.
Also, if you can deploy another website from the same repo (your staging one seems to be deploying from the same repo, could you deploy it as one more website) and the function works fine on that, it would again make me think it’s something going on with the domain, though I might be wrong.
Hi @hrishikesh, tested it out this morning and it seems to be an issue with the custom domain. I removed the custom domain, cleared cache and redeployed and the function is invoked exactly as expected. Then I try to add the domain name back in and the function isn’t called. I tried redeploying again but to no avail. Is there anything else we could try?
Hi @hrishikesh, sorry for the delayed reply. Over the past couple of nights we have been testing this and it only seems to work when no custom domain is connected. We fixed the issue with the domain and then did the following:
Unlinked the custom domain
Rebuilt the site
Tested - Working
Linked the custom domain
Tested - Failing
Rebuilt the site
Tested - Failing
We also tried the above with two other test domains with no luck. Is there anything else we could try?
Just to try, could you use Netlify DNS to see if it makes a difference?
Personally, I don’t believe it should, but it might not hurt to try. But if there are technical limitations about using Netlify DNS, let us know and we can try to think of some more alternatives, though none come to mind as of now.
Unfortunately a third party manages the DNS config for the domain, so we can’t move it. I could try adding a dummy domain to Netlify, remove the live domain and test it to see? The only issue is that it would be another overnight test, is there anything else we could try?