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

Error on creation of a Resource with StillImageFileValue #1268

Closed
gfoo opened this issue Mar 22, 2019 · 5 comments
Closed

Error on creation of a Resource with StillImageFileValue #1268

gfoo opened this issue Mar 22, 2019 · 5 comments
Assignees

Comments

@gfoo
Copy link

gfoo commented Mar 22, 2019

I have a kind of mimetype error when I create a resource related to an uploaded image (see below) in Sipi with /upload?token= endpoint. (following the doc there)

It works with Salsah which uses the thumbnail sipi endpoint.

I suspect that Sipi does not return the correct mimetype in knora.json (see log below)

error:

{"error":"org.knora.webapi.TriplestoreResponseException: Triplestore responded with HTTP code 500: org.eclipse.rdf4j.repository.RepositoryException: org.eclipse.rdf4j.sail.SailException: com.ontotext.trree.consistency.ConsistencyException: Consistency check empty_string_0 failed:\nhttp://rdfh.ch/0113/yvQZ9nEyRGKyUhNeDqUnDA/values/6VCA-236RtSv2I0iO03jVg http://www.knora.org/ontology/knora-base#originalMimeType \"\"^^<http://www.w3.org/2001/XMLSchema#string>\n"}

some logs of stack:

sipi_1     | Sipi: Accepted connection from 172.21.0.3
sipi_1     | Sipi: knora.json created from: /sipi/images/tmp/C/ACPIxZPW7pv-F5B7k0LPQAa.jp2

[...]

graphdb_1  | [INFO ] 2019-03-22 11:18:12,392 [repositories/knora-test | c.o.g.s.StatementsController] POST SPARQL update request to repository
graphdb_1  | [ERROR] 2019-03-22 11:18:12,477 [repositories/knora-test | c.o.t.SailConnectionImpl] Transaction failed. Commit will be rolled back.
graphdb_1  | com.ontotext.trree.consistency.ConsistencyException: Consistency check empty_string_0 failed:
graphdb_1  | http://rdfh.ch/0113/yvQZ9nEyRGKyUhNeDqUnDA/values/6VCA-236RtSv2I0iO03jVg http://www.knora.org/ontology/knora-base#originalMimeType ""^^<http://www.w3.org/2001/XMLSchema#string>
graphdb_1  |
graphdb_1  | 	at com.ontotext.trree.consistency.ConsistencyChecker$2.check(ConsistencyChecker.java:107)

The image: Corcelles_Seigneux_Gabriel_2

@gfoo
Copy link
Author

gfoo commented Mar 27, 2019

To reproduce:

$ curl -X POST -H "Content-Type: application/json" -d '{"email":"[email protected]","password":"test"}' http://localhost:3333/v2/authentication
{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJLbm9yYSIsInN1YiI6Imh0dHA6Ly9yZGZoLmNoL3VzZXJzL3Jvb3QiLCJhdWQiOlsiS25vcmEiLCJTaXBpIl0sImV4cCI6MTU1NjI2Njk2OCwiaWF0IjoxNTUzNjc0OTY4LCJqdGkiOiJTS2FiVm1nRVIzR3FBZjlRX1NNbzdBIn0.acXywznCHs7myN14PiwbapOzyTM6b5H8MxnnvwK6Cyw"}

$ curl -X POST -F 'filename=@54819543-80bd2780-4c9c-11e9-8946-547d6ad3278c.JLbm9yYSIsInN1YiI6Imh0dHA6Ly9yZGZoLmNoL3VzZXJzL3Jvb3QiLCJhdWQiOlsiS25vcmEiLCJTaXBpIl0sImV4cCI6MTU1NjI2Njk2OCwiaWF0IjoxNTUzNjc0OTY4LCJqdGkiOiJTS2FiVm1nRVIzR3FBZjlRX1NNbzdBIn0.acXywznCHs7myN14PiwbapOzyTM6b5H8MxnnvwK6Cyw
{
   "uploadedFiles": [
      {
         "internalFilename": "FDpGqIRv1Ik-GLWvmb2Xcir.jp2",
         "originalFilename": "54819543-80bd2780-4c9c-11e9-8946-547d6ad3278c.JPG",
         "temporaryBaseIIIFUrl": "http://localhost:1024/tmp/FDpGqIRv1Ik-GLWvmb2Xcir.jp2"
      }
   ]

$ curl -s -u [email protected]:test -X POST -d @image.json http://localhost:3333/v2/resources
{"error":"org.knora.webapi.TriplestoreResponseException: Triplestore responded with HTTP code 500: org.eclipse.rdf4j.repository.RepositoryException: org.eclipse.rdf4j.sail.SailException: com.ontotext.trree.consistency.ConsistencyException: Consistency check empty_string_0 failed:\nhttp://rdfh.ch/0001/C0Qjix_mR3WF_tY_p6neIQ/values/50-GGu5hQvqDeyPWtgur_g http://www.knora.org/ontology/knora-base#originalMimeType \"\"^^<http://www.w3.org/2001/XMLSchema#string>\n"}

image.json:

{
  "@type": "anything:ThingPicture",
  "knora-api:hasStillImageFileValue": {
    "@type": "knora-api:StillImageFileValue",
    "knora-api:fileValueHasFilename": "FDpGqIRv1Ik-GLWvmb2Xcir.jp2"
  },
  "knora-api:attachedToProject": {
    "@id": "http://rdfh.ch/projects/0001"
  },
  "rdfs:label": "issue#1268",
  "@context": {
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "knora-api": "http://api.knora.org/ontology/knora-api/v2#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "anything": "http://0.0.0.0:3333/ontology/0001/anything/v2#"
  }
}

@benjamingeer
Copy link

This is a Sipi bug. Moved to dasch-swiss/sipi#287. Made PR #1279 to fix Knora's error-checking of Sipi's response.

@gfoo
Copy link
Author

gfoo commented Sep 25, 2019

@benjamingeer may I re-open this issue to be sure that the corresponding issue in Sipi will be fixed?

@benjamingeer
Copy link

may I re-open this issue to be sure that the corresponding issue in Sipi will be fixed?

I don't think it will help...

@gfoo
Copy link
Author

gfoo commented Sep 25, 2019

ok, I will try to follow correctly the Sipi's issue :)

@gfoo gfoo removed this from the 2019-10 milestone Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants