Getting a Database Error on live site built in Gatsby

Netlify app address is https://colormilldesign.netlify.app.
URL is www.colormilldesign.com.

I recently pointed to Netlfy nameservers from Namecheap. I had a wordpress site on another host but built the new site in Gatsby and brought it here. I have no CMS installed so no database, (right?). The page will function normally sometimes and other times I get a database error on the live site. The page just says “Error establishing a database connection”. Console says “Failed to load resource: the server responded with a status of 500 (Internal Server Error)”.

Any idea what’s going on?

hey @Jeremy-Logan, that is indeed very strange. Your logic re: not having a database is correct, but also you shouldn’t really be receiving 500 server errors (as there isn’t really anything in a static site generated by gatsby that should cause an error like that). I don’t think we have heard of this problem before!

The only thing I can think of is that somehow you might be seeing an old cached version of the php/wordpress/database backed site sometimes?

It’s a little hard to debug (when i pull up your site it loads perfectly, i just tried a handful of times) but i’m not saying it’s not happening - can you try and capture some more information for us when this happens? a screenshot? an x-nf-request-id? a Har file? so we can take a closer look?

https://toolbox.googleapps.com/apps/har_analyzer/

It took a while to get it to happen again but sure enough this morning I got the same error. Below is the copy/paste of the two request header that show up for www.colormilldesign.com. Strangely no x-nf-request-id’s were listed.

  1. Cache-Control: no-cache, must-revalidate, max-age=0
  2. Connection: close
  3. Content-Type: text/html; charset=UTF-8
  4. Date: Thu, 09 Jul 2020 14:26:22 GMT
  5. Expires: Wed, 11 Jan 1984 05:00:00 GMT
  6. Referrer-Policy: no-referrer-when-downgrade
  7. Server: Apache
  8. Strict-Transport-Security: max-age=63072000; includeSubdomains; preload
  9. Transfer-Encoding: chunked
  10. Vary: Accept-Encoding
  11. X-Content-Type-Options: nosniff
  12. X-Frame-Options: SAMEORIGIN
  13. X-Powered-By: PHP/7.2.31

  1. Cache-Control: no-cache, must-revalidate, max-age=0
  2. Connection: close
  3. Content-Type: text/html; charset=UTF-8
  4. Date: Thu, 09 Jul 2020 14:26:22 GMT
  5. Expires: Wed, 11 Jan 1984 05:00:00 GMT
  6. Referrer-Policy: no-referrer-when-downgrade
  7. Server: Apache
  8. Strict-Transport-Security: max-age=63072000; includeSubdomains; preload
  9. Transfer-Encoding: chunked
  10. Vary: Accept-Encoding
  11. X-Content-Type-Options: nosniff
  12. X-Frame-Options: SAMEORIGIN
  13. X-Powered-By: PHP/7.2.31

Here’s a link to the .har:

Also attaching screenshots of the headers requests…

!

Second screenshot…

Ok. I think I figured this out. Turns out my old host, who also happens to be my ISP was intercepting and answering the request before it got out to Netlify. They apparently use a shortcut to serve sites to their ISP customers if they also host the site. Maybe that’s common? Anyway, I hope this wasn’t too much of a waste of your time. Thanks for looking into it.

1 Like

thanks for posting the cause - that was sort of what i was expecting. Glad you figured it out - you got some good sleuthing skills :muscle: