MarkLogicUniversity / Geophoto

Sample MarkLogic application with binary, JSON, and RDF triple data
MIT License
12 stars 13 forks source link

Import failed with code 500 #8

Closed ouyi closed 8 years ago

ouyi commented 8 years ago

Hi,

I got this error when trying to import a photo:

$ node import.js ../data/photos/01.JPG
Installed module: /ext/countrysemantics.sjs
Inserted document with URI /image/01.JPG.json
Inserted image with URI /binary/01.JPG
{ [Error: SPARQL graph query: cannot process response with 500 status]
  message: 'SPARQL graph query: cannot process response with 500 status',
  statusCode: 500,
  body:
   { errorResponse:
      { statusCode: 500,
        status: 'Internal Server Error',
        messageCode: 'INTERNAL ERROR',
        message: 'XDMP-TRPLIDXNOTFOUND: xdmp:security-assert("http://marklogic.com/xdmp/privileges/rest-reader", "execute"), let $rule := conf:get-sparql-protocol-rule() let $params := rest:process-request($rule) let $headers := eput:get-request-headers() let $method := eput:get-request-method($headers) let $env := map:map() let $params := local:validate-params($rule, $env, $params) let $body := switch ($method) case "GET" return text { fn:head((map:get($params, "query"), map:get($params, "update"))) } case "POST" return xdmp:get-request-body(eput:get-content-format($headers, $params))/node() default return fn:error((), "REST-UNSUPPORTEDMETHOD", $method) let $result := semmod:sparql-query($headers, $params, $body) let $response := if ($result instance of xs:string and $result = ("EMPTY-CONSTRUCT", "EMPTY-DESCRIBE")) then semmod:empty-construct($headers, $params, local:sparql-callback#2) else if ($result instance of xs:string and $result eq "EMPTY-SELECT") then semmod:empty-select($headers, $params, local:sparql-callback#2) else semmod:results-payload($headers, $params, $result, local:sparql-callback#2) return if ($response instance of node() and $response/self::semmod:malformed-query) then (xdmp:set-response-code(400, "Malformed Query"), $response) else $response -- Triple index not enabled . See the MarkLogic server error log for further detail.' } } }

My setup:

Is this an issue or sth is wrong in my setup?

Thanks! Yi Ou

dmcassel commented 8 years ago

The error XDMP-TRPLIDXNOTFOUND says that the code attempted to run a query that requires the triples index, but that index was turned off. Did you run the setup script in the ml-setup directory? That script not only creates the application server and database, it also turns on a few indexes that are needed.

ouyi commented 8 years ago

Hi David,

Thanks for the quick reply! Yes I followed the README step by step and was stopped by the import failure. The same error occurs even after a "node setup.js wipe && node setup.js bootstrap".

Thanks, Yi Ou

tpiros commented 8 years ago

Hi @ouyi - are you still having this issue? You can also manually verify whether you have the Triple Index switched on by opening the MarkLogic Admin Interface (host/ip:8001) - select the database that you're using and verify that the 'triple index' is set to 'true'. Thanks.

ouyi commented 8 years ago

Hi Tamas, yes I am still having this issue. The Triple Index is enabled according to the Admin Interface, for the "App Services" database. Thanks!

ouyi commented 8 years ago

Manually enabled Triple Index for ALL databased in the Admin Interface and the import works now! Thanks!

tpiros commented 8 years ago

Hi @ouyi - thank you for reporting back. It seems that for whatever reason the setup script did not enable the appropriate index but you got around this issue manually.