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

Modify createPostSyncRunner to handle redirects #69

Closed

Conversation

stvoutsin
Copy link

Description
The Taplint validator produces failed jobs during the QPO stages (synchronous POST queries) for the Rubin TAP service.
The sync POST queries in our case return a 303 redirect to the results, which I think are standard complient, but as far as I can tell are not handled in this stage, as the exception implies that the redirect is not followed.
The headers of a sync POST request using a cli client to our TAP service looks like this:

HTTP/1.1 303 
Connection: keep-alive
Content-Length: 0
Date: Wed, 03 Jul 2024 19:33:59 GMT
Location: https://data-dev.lsst.cloud/api/ssotap/sync/txjaqr26kekv110l/run
Strict-Transport-Security: max-age=31536000; includeSubDomains
server: OpenCADC/cadc-rest
x-vo-authenticated: user
 

Error logs

W-QPO-NOCT-1 No Content-Type header for https://data-dev.lsst.cloud/api/ssotap/sync
I-QPO-VVNL-1 Undeclared VOTable version; assuming v1.2
E-QPO-YJDQ-1 (l.1, c.1): Premature end of file.
E-QPO-QERX-1 TAP query result parse failed [Premature end of file.]
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1251)
	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
	at uk.ac.starlink.ttools.taplint.VotLintTapRunner.readResultDocument(VotLintTapRunner.java:283)
	at uk.ac.starlink.ttools.taplint.VotLintTapRunner.readResultDocument(VotLintTapRunner.java:205)
	at uk.ac.starlink.ttools.taplint.VotLintTapRunner.executeQuery(VotLintTapRunner.java:113)
	at uk.ac.starlink.ttools.taplint.TapRunner.attemptGetResultTable(TapRunner.java:79)
	at uk.ac.starlink.ttools.taplint.TapRunner.getResultTable(TapRunner.java:51)
	at uk.ac.starlink.ttools.taplint.QueryStage$Querier.runCheckedQuery(QueryStage.java:536)
	at uk.ac.starlink.ttools.taplint.QueryStage$Querier.runOneColumn(QueryStage.java:349)
	at uk.ac.starlink.ttools.taplint.QueryStage$Querier.run(QueryStage.java:317)
	at uk.ac.starlink.ttools.taplint.QueryStage.run(QueryStage.java:105)
	at uk.ac.starlink.ttools.taplint.TapLinter$4.execute(TapLinter.java:259)
	at uk.ac.starlink.ttools.task.LineInvoker.invoke(LineInvoker.java:303)
	at uk.ac.starlink.ttools.Stilts.main(Stilts.java:54)
	at uk.ac.starlink.topcat.Driver.runMain(Driver.java:192)
	at uk.ac.starlink.topcat.Driver.main(Driver.java:109)

Fix
The proposed fix adds a check to the Post Sync job handling code to check the headers for a 303, and use the AuthManager if it exists to connect to and return a connection to the location url.

Feel free to ignore PR if you disagree or think this is the wrong approach

@mbtaylor
Copy link
Member

mbtaylor commented Jul 4, 2024

Thanks for tracking down the problem @stvoutsin, the PR is doing the right thing, but a more general fix catches the same problem in at least one other place. In fact it's a regression bug I put in when I thought I was fixing something else a couple of months back (so it didn't appear in a public release). The fix is at f4b2f2c, so I'll close this PR without merging.

@mbtaylor mbtaylor closed this Jul 4, 2024
@stvoutsin stvoutsin deleted the u/stvoutsin/taplint-sync-post branch July 4, 2024 23:18
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

Successfully merging this pull request may close these issues.

2 participants