Not a bug

Gateway Timeout

Noah Stephens-Davidowitz vor 6 Jahren aktualisiert von Christian Fritz vor 6 Jahren 8

First of all, thanks for making this awesome tool! :)

Unfortunately, I'm unable to get it to work for my bibtex when I host it on my website. In particular, the file http://noahsd.com/bootstrap_bibbase_test/nsd.bib fails to load, and if I let the import function on your website run long enough on this URL, it eventually just gives a 504 gateway timeout. On the other hand, the exact same file loads fine when it's hosted on github: NoahSD123.github.io/nsd.bib , as you can see here: https://bibbase.org/show?bib=NoahSD123.github.io%2Fnsd.bib&msg=embed . When I try to embed the first file in a website, it just hangs, while the second file works fine.

I guess it's possible that this is an issue of server configurations, but I use In Motion hosting, who presumably know what they're doing, and what could be easier than sending a text file? I thought maybe it was because your script was trying to use SSL/TLS, which I don't have, but I managed to find another bib file hosted on a site without SSL/TLS that works fine (http://shelah.logic.at/listb.bib). So, I'm completely stumped...


When I try to fetch that bib file using curl I get a 406 error:

> curl -i http://noahsd.com/bootstrap_bibbase_test/nsd.bib
HTTP/1.1 406 Not Acceptable
Date: Thu, 31 May 2018 04:15:18 GMT
Server: Apache
Content-Length: 300
Content-Type: text/html; charset=iso-8859-1

<html><head><title>Error 406 - Not Acceptable</title><head><body><h1>Error 406 - Not Acceptable</h1><p>Generally a 406 error is caused because a request has been blocked by Mod Security. If you believe that your request has been blocked by mistake please contact the web site owner.</p></body></html>

This seems to be an issue with the hosting provider.

It seems to work when I provide a user-agent, but that shouldn't be required:

> curl -i -H "User-Agent: testing" http://noahsd.com/bootstrap_bibbase_test/nsd.bib
HTTP/1.1 200 OK


We can try to add that header into the request bibbase makes, but for now I would recommend keeping the bib file on github.

Actually, bibbase already sends a User-Agent header "bibbase", so that's not it. If you can find anything in the documentation of this hosting provider that could be relevant for this, or get help from them regarding this error, please let us know.

Thank you for the quick reply and testing. Given the new info, I tried whitelisting bibbase's IP address and then just turning off Mod Security, but that didn't work. (I'm a little confused about whether "turning off Mod Security" actually means turning it off completely or just turning off certain rules. Some of the provider's docs suggest it's the latter.)

When I run the same curl request, it simply goes through. I've contacted my hosting provider explaining that I got some unexpected 406 errors, but I don't have much info to share with them given that I can't reproduce the issue.

My host and I can't reproduce the bug, so we're stumped...

I also use Inmotion hosting and having the 504 gateway timeout. Might have started when I enabled https on the website. Any suggestions?

Not a bug

I've spent some more time looking into this, but have not been able to get this to work. At the networking level BibBase receives the data, but the host doesn't send all of it, but instead seems to be requesting an upgrade of the connection to HTTP2 (which is something bibbase doesn't yet implement -- HTTP2 not very common yet). Here are the headers BibBase is receiving back from your host:

HTTP/1.1 200 OK
Date: Sat, 09 Jun 2018 04:25:12 GMT
Server: Apache
Upgrade: h2,h2c
Connection: Upgrade, Keep-Alive
Last-Modified: Thu, 31 May 2018 03:22:39 GMT
Accept-Ranges: bytes
Content-Length: 31529
Keep-Alive: timeout=3, max=100

I don't think this will work. So if you can, please keep hosting your bib file from another host.

You've probably seen this before: https://kinsta.com/blog/504-gateway-timeout/ . Obviously, it is a large advert for their own hosting solution but maybe you can find some hints between the lines.

Thanks for the link. However, it's not a 504 that BiIbBase is getting from ecbiz219.inmotionhosting.com, it's a 200 with a request to upgrade the connection. BibBase will eventually send a 504 to you indicating that it was unable to finish the request, but the details I'm sharing above are already one diagnostic layer deeper than that.

You could probably check with inmotion whether there is a way to disable HTTP2 for your site. Alternatively, if they support https that might resolve the issue as well. I already tried https://noahsd.com/bootstrap_bibbase_test/nsd.bib, but that doesn't seem to be supported yet by your host.