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

Introduction ledger create command fails #84

Open
SaulMoonves opened this issue Aug 7, 2024 · 0 comments
Open

Introduction ledger create command fails #84

SaulMoonves opened this issue Aug 7, 2024 · 0 comments

Comments

@SaulMoonves
Copy link

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

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

No branches or pull requests

1 participant