fluree / server

Fluree Server - Operates Fluree in consensus, fault-tolerant, redundant
12 stars 1 forks source link

Introduction ledger create command fails #84

Open SaulMoonves opened 1 month ago

SaulMoonves commented 1 month ago

Attempted to follow the introduction at: https://developers.flur.ee/docs/learn/tutorial/introduction/

Launched server using:

docker run -d -p 58090:8090 --name fluree --mount type=bind,source=/var/lib/fluree/data,target=/opt/fluree-server/data fluree/server:9079322dff5e32d120d1381a4279f7fcbf21176d

I used that version based on this: https://hub.docker.com/r/fluree/server because of a different bug launching fluree/server that I will open a different issue for.

curl --location 'http://localhost:58090/fluree/create' \
--header 'Content-Type: application/json' \
--data '{
  "ledger": "cryptids",
  "insert": {
    "@id": "my-first-cryptid",
    "name": "Freddy the Yeti"
  }
}'
{"error":"JSON document's top level element must be JSON array or object."}

logs:

2024-08-07T10:33:44.614340389Z :post "/fluree/create" => Error in ledger handler
clojure.lang.ExceptionInfo: Error in ledger handler {:response {:status 500, :body {:error "JSON document's top le10:34:08.683 [qtp1970835162-38] DEBUG fluree.server.components.http - Unwrapped credential with did: nil
10:34:08.684 [qtp1970835162-38] DEBUG fluree.server.handlers.create - create body: {"insert" {"@id" "my-first-cryptid", "name" "Freddy the Yeti"}, "ledger" "cryptids"}
Exception in thread "async-dispatch-2" java.lang.NullPointerException: Cannot invoke "Object.toString()" because "s" is null
    at clojure.string$starts_with_QMARK_.invokeStatic(string.clj:365)
    at clojure.string$starts_with_QMARK_.invoke(string.clj:361)
    at fluree.db.json_ld.api$address_QMARK_.invokeStatic(api.cljc:108)
    at fluree.db.json_ld.api$address_QMARK_.invoke(api.cljc:104)
    at fluree.db.json_ld.api$exists_QMARK_$fn__65290$state_machine__14707__auto____65295$fn__65297.invoke(api.cljc:157)
    at fluree.db.json_ld.api$exists_QMARK_$fn__65290$state_machine__14707__auto____65295.invoke(api.cljc:156)
    at clojure.core.async.impl.ioc_macros$run_state_machine.invokeStatic(ioc_macros.clj:972)
    at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:971)
    at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:976)
    at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:974)
    at fluree.db.json_ld.api$exists_QMARK_$fn__65290.invoke(api.cljc:156)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at clojure.core.async.impl.concurrent$counted_thread_factory$reify__9671$fn__9672.invoke(concurrent.clj:29)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.base/java.lang.Thread.run(Unknown Source)

the debug statement kind of looks like it stripped commas? or is that just the way it renders debug statements?

plz halp