4

I've gone through all the troubleshooting steps they provide here. My endpoint is accessible, SSL passes the tests. Webhooks work when I'm testing on my local environment using ngrok but it does not work on staging and production servers hosted on AWS and managed on Laravel Forge. The webhooks post request simply does not hit the server.

I contacted the QuickBooks support about this several times. Their response is, they get a timeout - StatusCode 41 when they post the notification to my endpoint. And they say that the network is restricting traffic in some way. Also contacted forge support and they said they won't help with application-related issues.

I tried disabling the firewall with UFW, reviewed all the logs but I don't see any way how the server is restricting the traffic. I retried several times changing the webhooks URL on sandbox and no luck.

Any help would be greatly appreciated.,

edit: SSL is valid, csrf is turned off, url is publicly accessible, a curl request from another server goes through fine, nothing in logs.

RESOLVED Edit

Webhooks started working again on their own after a recent update they did on the Webhooks functionality. While I'm glad it's working finally, I don't appreciate all the time I wasted debugging this.

Varol
  • 1,798
  • 1
  • 22
  • 30
  • Your issue doesn't seem to be related to quickbooks, but rather how your staging/production servers are setup. Have you tried accessing your app from your browser? Perhaps a testing page or default Laravel welcome page. Is your domain A record configured? Have you configured your [security groups](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) allowing your http port? – sykez Sep 01 '20 at 06:58
  • You first need to make sure the webhook URL is accessible by clients such as browsers. Try to visit your webhook URL in a browser just to see its accessible. – Imran Khan Sep 01 '20 at 09:55
  • Stupid idea, but have you tried connecting to your staging server using ngrok? No idea why that should work but it's something to try. – Thomas Sep 01 '20 at 17:13
  • app is in production. the webhooks URL is publicly accessible. we have other API integrations that work. – Varol Sep 02 '20 at 19:10
  • 1
    what happens when you `curl` the webhook from one of your production servers? Using the `-v` flag will give you details about the connection, maybe a hint where it's failing – konsolenfreddy Sep 03 '20 at 21:57
  • Any chance that you're using WAF? Maybe it's blocking Quickbooks. – sykez Sep 04 '20 at 04:54
  • Hit your webhook from a browser / `curl` and see if it works. – Qumber Sep 04 '20 at 07:33
  • @konsolenfreddy curl request goes through without errors. tried from 2 different servers. – Varol Sep 04 '20 at 15:47
  • Please check if CSRF validation is turned OFF for the webhook. Requests are often rejected while working with webhooks when CSRF validation is ON. – Ankit Singh Sep 08 '20 at 15:44
  • @AnkitSingh CSRF is turned off. – Varol Sep 08 '20 at 17:34
  • I am not really sure about QuickBooks but sometimes webbooks itself times out, they wait for your server to process the request and if you don't send them 2xx response in short time they will eventually timeout. i had similar experience with shopify webhooks, they send multiple requests if you don't send response immediately as they consider first request has failed, to debug this try logging the request and send response immediately without any other server side processing? – ehmad11 Sep 13 '20 at 14:04
  • Could you show your Security Group's incoming traffic configs, please. Also, access & error log of Nginx/Apache2 right after webhook times out. – Qumber Sep 23 '20 at 05:34
  • Does QuickBooks send a `HEAD` request to your app when you add the URL? What does your server response with? – Qumber Sep 23 '20 at 05:37
  • @Qumber All TCP TCP 0 - 65535 0.0.0.0/0 All traffic All All sg-027c341c71db2cda9 All UDP UDP 0 - 65535 0.0.0.0/0 – Varol Sep 24 '20 at 09:55
  • Is there any timeout settings or any settings related to amount data you send/receive? Ask support team about default setting compare what you have, verify if that is what your webhook needs to work or need any changes. – Prafulla Kumar Sahu Sep 30 '20 at 22:23

1 Answers1

1

Just my two cents. There are steps to troubleshoot as follows.

  1. Check your QuickBooks webhook that is behind a login firewall?
  2. Check your endpoint by POSTMAN to get a more detailed report.
  3. Check your endpoint SSL certificate is not a self-signed certificate so make sure the endpoint URL begins with HTTPS. You can check it with https://www.sslshopper.com/ssl-checker.html
  4. Check your webhook entity and action has required permission to post. So deselect and select the entity again and resave.
  5. Make sure your verifier token is correct
  6. If you are using Cloudflare WAF check logs or check firewall.
  7. Open a ticket in QuickBooks so that your production implementation is correct.
Fatih Şennik
  • 1,295
  • 5
  • 12