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

Fuseki query endpoint stopped working on jena-fuseki-main upgrade #2488

Closed
tgreenwood opened this issue May 21, 2024 · 6 comments
Closed

Fuseki query endpoint stopped working on jena-fuseki-main upgrade #2488

tgreenwood opened this issue May 21, 2024 · 6 comments
Labels

Comments

@tgreenwood
Copy link

Version

4.6.0

Question

Hi, I would greatly appreciate any help!

We have a configured query endpoint in FusekiServer which worked fine with jena-fuseki-main of version 4.3.1. Recently we upgraded the dependency and suddenly the query endpoint (HTTP POST) stopped working. I tried other versions and found out that it still works with version 4.5.0, but does not work with 4.6.0 and older. I checked the release notes and see nothing what could affect it. Any ideas what could break it?

The way it is configured is below:

var operationRegistry = OperationRegistry.createStd();
operationRegistry.register(
                Operation.Query,
                WebContent.contentTypeSPARQLQuery,
                <custom SPARQL_QueryDataset>);
FusekiServer.create(operationRegistry)
                .securityHandler(<custom handler>)
                .add("/api/rdf", <custom DatasetGraphFilteredView>, false)
                .port(<custom port>);
@afs
Copy link
Member

afs commented May 22, 2024

Hi @tgreenwood -- There is nothing I can see in the code history that suggests a change except a fix around digest auth but that was a bug fix. Dependencies may have been updated.

A mock up of your description seems to work (5.1.0 development codebase).

What does stop working cover? Is there anything in the server log file?

    public static void main2488() {
        FusekiLogging.setLogging();
        SPARQL_QueryDataset custom = new SPARQL_QueryDataset() {
            @Override
            protected void validateRequest(HttpAction action) {
                System.err.println("EXT::validateRequest");
                super.validateRequest(action);
            }
            @Override
            protected void executeWithParameter(HttpAction action) {
                System.err.println("EXT::executeWithParameter");
                super.executeWithParameter(action);
            }
            @Override
            protected void executeBody(HttpAction action) {
                System.err.println("EXT::executeBody");
                super.executeBody(action);
            }
        };

        DatasetGraph dsg = DatasetGraphFactory.createTxnMem();

        var operationRegistry = OperationRegistry.createStd();
        operationRegistry.register(
                        Operation.Query,
                        WebContent.contentTypeSPARQLQuery,
                        custom /*<custom SPARQL_QueryDataset>*/);
        FusekiServer server = FusekiServer.create(operationRegistry)
                        .verbose(true)
                        //.securityHandler(<custom handler>)
                        .add("/api/rdf", dsg /*<custom DatasetGraphFilteredView>*/, false)
                        .port(0)
                        .start();
        try {
            try ( QueryExec qExec =
                    QueryExecHTTP.service("http://localhost:"+server.getPort()+"/api/rdf")
                    .query("ASK{}")
                    //.urlGetLimit(0)
                    .build();
                    ) {
                qExec.ask();
            }
        } finally { server.stop() ; }
    }

@tgreenwood
Copy link
Author

Hi @afs ,
many thanks for quick reply. My bad, I shared not full config, I missed also .addFilter() method adding custom endpoints which, as turned out, was the root cause of the problem.

It is still strange to me as it works just fine if I add a pretty simple filter which just pass the request. But with the production used filters it does not work. In the production code we pass the a group of endpoints implemented via javaspark framework, and the issue emerges in exception handling. I added there a logic to skip the endpoint for SPARQL query and it works just fine. The thing I am still confused about is that we did't change the version of JavaSpark, the issue is reproduced only when I upgrade Jena version. I guess that something has changed in Jetty, like filters priority or something like that. Any ideas?

Off-topic (let me know if I should raise a separate question for that): we are using DatasetGraphMonitor in our app having a lot of logic to perform post-actions within transaction. It's being removed, what should be used instead?

@afs
Copy link
Member

afs commented May 22, 2024

Off-topic (let me know if I should raise a separate question for that)

Yes please. We can close this issue if it's addressed.

@afs
Copy link
Member

afs commented May 23, 2024

I guess that something has changed in Jetty, like filters priority or something like that. Any ideas?

Sorry - no. Jetty was updated 10.0.9 to 10.010 from Jena 4.50 to Jena 4.6.0 - that's unlikely to have an effect.

@afs afs changed the title Fuseki query endpoint stopped woking on jena-fuseki-main upgrade Fuseki query endpoint stopped working on jena-fuseki-main upgrade May 23, 2024
@tgreenwood
Copy link
Author

Hm, then I am confused. But many-many thanks anyway, the question can be closed

@afs
Copy link
Member

afs commented May 23, 2024

If you find a reason, do let us know. I'm curious as to what changed.

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

No branches or pull requests

2 participants