Gravity Forms won't submit in production

Hello Wizards,
I have been running Bedrock and Sage for a project using shared hosting for awhile (1.5 years).
(I know, not ideal.) But it worked, and there wasn’t a need for a better server / deployment scheme.
But I finally took the plunge after running some tests with php 7. http2, and nginx (holy moly). Plus, I had the opportunity to come on board with the client in a more full time role.

So, now, I am running Bedrock (with Sage) on a DO droplet , using Trellis (most recent version, I do believe).
I love it. Really amazing work building this for performance and security.

This morning I noticed that my Gravity forms are not working. I use a couple of forms that were working just fine before I Switched to DO and Trellis.

When you fill in fields and click submit, the connection just hangs. The wheel starts spinning, but no connection. After a few minutes you get a 504 ‘Bad Gateway’ message.

Interestingly, they are working just fine in staging:


The form is also working as expected in Dev.

I have read the posts about JS being loaded in the footer vs. the header.
But I am sad to say that is not my issue, I am not using Soil to force scripts to the footer. I have confirmed that GF scripts are being loaded in the head, and the behavior persists whether using AJAX or not.

Many thanks for someone pointing me in the right direction on this. And apologies in advance if I’ve left something out.


1 Like

I’m going to guess that you have notifications off on staging, but have them turned on for production.

If this is the case, the 504 is probably the smtp gateway timing out. Check credentials and/or whether you’ve added the production IP to the gateway’s whitelist.

That’s totally it. I turned off Notifications and it works just fine. (Can’t believe I didn’t try that). I’m going to have to re deploy with an eye on SMTP. I think something is not configured correctly.
Many thanks for your help.

@Foxaii or @Zachary_Brewer Can you guys explain more what “Notifications” is? I’m having a 504 gateway error on an AJAX request only in Production.

Ah yea I’m not using Gravitiy Forms, but getting that 504 on a custom plugin with AJAX. Thanks! If you have any ideas for my 504 let me know. Only getting it in Prod… not local, dev or staging.

Just to add in case it helps someone. My problem was that my AJAX call kicked off a fairly big data transfer from an API into the database, and it took well over a couple of minutes. Had to update max_execution_time found in roles/php/defaults/main.yml