tdwg/rs.tdwg.org

rs.tdwg.org doesn't forward to ABCD 3 terms properly

DavidFichtmueller opened this issue · 9 comments

There must have recently (?) been a change to the server setup of rs.tdwg.org that broke the redirects for the ABCD 3 terms. The rules specified in httpd/rs.tdwg.org.conf are ignored.

For instance http://rs.tdwg.org/abcd/terms/Unit should redirect to https://abcd.tdwg.org/terms/#Unit but instead it shows an empty page with a 404 redirect. The redirects for the ABCD 2 terms still work, they forward to the TDWG Terms Wiki (e.g. http://rs.tdwg.org/abcd2/terms/Unit -> https://terms.tdwg.org/wiki/abcd2:Unit ) and so does DwC.

I know this has worked after tdwg/infrastructure#91 . Has the server infrastructure changed (and do the redirects need to be rewritten) or is this simply an issue of the wrong config file being loaded that can be fixed by checking out the files from this repository and restarting the server?

Earlier this year the server setup was changed to enable dereferencing all TDWG terms with content negotiation. So the redirects aren't being handled by that configuration file any more. The patterns for all of the ABCD variants are here now.

Before we switched over to the new system I did some pretty thorough testing of the dereferencing of different URL patterns and all of the ABCD patterns were working. So I'm not sure what the cause is of the current problem. I will investigate ASAP. The pattern you described for text/html seems to be correct, but I'll investigate.

This fails, and is a cut-down version of what Firefox sends:

curl -i 'http://rs.tdwg.org/abcd/terms/Unit' -H 'Accept: text/html,application/xhtml+xml;q=0.9'

This succeeds:

curl -i 'http://rs.tdwg.org/abcd/terms/Unit' -H 'Accept: text/html;q=0.9'

OK, well that makes sense. I think the script I tested with probably sent only "text/html" as the accept header. I will come up with a fix.

I have fixed the server script (restxq.xqm) in this commit. The only two URI patterns that were dependent on exact matching to an Accept header of text/html were two idiosyncratic ABCD ones that implemented content negotiation. The rest of the URI patterns were either handled by the systematic pattern matching, or had fixed redirects regardless of the content type.

I was able to replicate the problem on my localhost instance of the server and the fix that I just pushed solved the problem. So @MattBlissett, I think that your database loader script automatically reloads the server script, so I think just running that script should fix the problem.

Should we not remove the old httpd config files if they are unused?

I don't see why not since they would remain in the Git history if they ever needed to be resurrected.

Deployed. This is done by making a release on Github, which deploys to rs.tdwg.org.

All commits on the master branch deploy to rs-test.tdwg.org.

Thank you @baskaufs and @MattBlissett for finding the source of this issue and fixing it so quickly. It has been a while since I last properly coded in XQuery but if you ever need an additional pair of eyes to look for an issue etc, just drop me a line.

@DavidFichtmueller Good to know that you've done XQuery. Thanks for the offer!