Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DavidFichtmueller opened this issue Aug 11, 2020 · 9 comments
Closed

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

DavidFichtmueller opened this issue Aug 11, 2020 · 9 comments

Comments

@DavidFichtmueller
Copy link

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?

@MattBlissett MattBlissett transferred this issue from tdwg/infrastructure Aug 11, 2020
@baskaufs
Copy link

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.

@MattBlissett
Copy link
Member

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'

@baskaufs
Copy link

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.

@baskaufs
Copy link

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.

@mdoering
Copy link
Collaborator

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

@baskaufs
Copy link

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

@MattBlissett
Copy link
Member

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.

@DavidFichtmueller
Copy link
Author

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.

@baskaufs
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants