This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-06
Channels
- # announcements (3)
- # architecture (16)
- # beginners (5)
- # cherry (1)
- # cider (3)
- # cljsrn (2)
- # clojure (54)
- # clojure-dev (11)
- # clojure-europe (14)
- # datalevin (26)
- # emacs (8)
- # helix (5)
- # honeysql (5)
- # hyperfiddle (40)
- # lsp (12)
- # malli (23)
- # missionary (7)
- # nrepl (2)
- # off-topic (18)
- # releases (2)
- # yamlscript (1)
Trying to use Flow Storm to do some debugging, however I keep getting this stacktrace.
Seems to be caused by Flow Storm calling pprint
on some Datalevin internals?
clojure.lang.ExceptionInfo: Fail to get-value: No implementation of method: :put-key of protocol: #'datalevin.lmdb/IBuffer found for class: nil {:dbi "datalevin/meta", :k :last-modified, :k-type :attr, :v-type :long}
Not sure where the nil
is coming from thoughWhere does
Oh, the rtx
come from for this get-value
function?scan
macro :thinking_face:
I did not, no. I've only been able to produce with Flow Storm.
https://github.com/juji-io/datalevin/blob/master/src/datalevin/db.cljc#L278 (`:last-modified (s/last-modified store)` in print-method
defmethod print-method DB`)
Assuming this is expected to work when run later by Flow Storm? Does it need to be within a transaction or something?
I think there's an implicit assumption (by Flow Storm, and likely by others) that print-method
can be called on any variable at any time.
I don't know that that's a stance Flow Storm would agree with. I'd assume the expectation is that an opaque string with minimal information is printed instead of throwing an error.
It definitely makes sense that printing may not be useful or contain much information, but I think it should be fixed to not thrown an error when printed at the wrong time.
Admittedly Flow Storm should also be catching this error when printing a var fails. 🤷
(And seemingly does catch similar errors sometimes. :thinking_face:)
Totally understand; again, I don't think they should print anything useful that contains that stateful data, but I do think they should print an opaque string.
(Even just removing the print-method
would use the default Clojure behavior which does this, and I think would be preferable.)
Not sure what that default behavior looks like on a DB
though. 👀
The error you saw is due to the fact that it tries to print a db that has not been initialized yet,
datalevin.db.DB@9dfe7f52
Gotcha; what would it take to fix?
👍 Thanks 🙂 Will try to get a PR together
Tried bypassing (remove-method print-method datalevin.db.DB)
, and I'm just getting a different stacktrace from Flow Storm, so I think I'm going to punt on this issue for now. 🙂
https://clojurians.slack.com/archives/C03KZ3XT0CF/p1691286079910589
Thanks for reading anyways!