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

Problem in SPARQL converter #120

Open
jnehring opened this issue Jan 23, 2017 · 3 comments
Open

Problem in SPARQL converter #120

jnehring opened this issue Jan 23, 2017 · 3 comments
Labels

Comments

@jnehring
Copy link
Member

curl -X OPTIONS -H "Cache-Control: no-cache" -H "Postman-Token: 4c7fecdb-4ee7-743c-2d96-cea6c8fb0c90" -d 'Show me the source of knowledge' "http://rv1443.1blu.de/current/e-translation/tilde?input=Hello%2C%20world!&informat=text&outformat=csv&source-lang=en&target-lang=de&filter=extract-entities-only"

produces

{
  "exception": "eu.freme.common.exception.FREMEHttpException",
  "path": "/toolbox/convert/documents/extract-entities-only",
  "error": "Internal Server Error",
  "status": 500,
  "timestamp": 1485174312968
}

and log file

ERROR   2017-01-23 13:25:12,966 [http-nio-8089-exec-10] eu.freme.common.exception.ExceptionHandlerService  - Request: http://rv1443.1blu.de:8089/toolbox/convert/documents/extract-entities-only raised
eu.freme.common.exception.FREMEHttpException
        at eu.freme.bservices.controllers.sparqlconverters.SparqlConverterController.filter(SparqlConverterController.java:187)
...

happens in all api endpoints that use the sparql converter. This leads to freme-project/freme-project.github.io#332

@jnehring jnehring added the bug label Jan 23, 2017
@jnehring jnehring self-assigned this Jan 23, 2017
@jnehring
Copy link
Member Author

The problem happens only when executing the OPTIONS http method, it works fine when I use POST, GET, ...

So the CORS pre-flight request fails when using this filter. Possible solution:

When the request is a pre-flight request, then it should not execute the filter because the request has no body anyways. This should be handled by the CORS filter which needs to move up in the filter hierarchy.

I wonder why this bug was not mentioned earlier because I think it exists for a long time, maybe 6 month or longer.

jnehring added a commit to freme-project/freme-parent that referenced this issue Jan 23, 2017
version of sparql converter controller
@jnehring
Copy link
Member Author

The bug is fixed on rv1443.1blu.de . I switched off the postprocessing filter for HTTP OPTIONS requests. We should include this bugfix in the ADAPT installation.

@jnehring
Copy link
Member Author

this bugfix introduced problems. i will roll it back.

@jnehring jnehring removed their assignment Feb 13, 2017
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

1 participant