Fork me on GitHub

So I am trying to run crux with rocksdb on windows. When I start it in WSL I get this error: No implementation of method: :as-file of protocol: #' found for class: sun.nio.fs.UnixPath And when I run it in windows I get this error: java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #' found for class: sun.nio.fs.WindowsPath which is basically the same error, just with a different class. It fails at crux.kv.rocksdb line 144 with this code:

(RocksDB/open opts (.getAbsolutePath (doto (io/file db-dir) (.mkdirs))))
where db-dir is of type WindowsPath although I pass in a string as db-dir option:
:crux.kv/db-dir        (str (io/file storage-dir "db"))


Should I open an issue for that?


Does it work if you don't have the (str ...) ? We don't officially want to support Windows just yet but I am surprised WSL isn't working either and it would be good to understand why


Feel free to open an issue :)


Without the (str ...) it does not work either. I am currently debugging this and am stuck in crux.topology/parse-opts I see that it takes the path as str as it should and then calls (s/conform v type) where type is :crux.config/path. So I think while conforming it turns the path into one of these classes. I just cannot find the type definition for crux.config/path .


Ah, of course it's defined in crux.config


Thanks! One more thought from me, does the directory already exist? If not, what happens if you have created it manually first?


-.- I used rocksdb version "20.07-1.9.2-beta" Now I just checked some more sources and saw that there was a commit regarding paths: which fixes that exact problem. So, If I switch to the yesterday released verison: "20.07-1.10.0-beta-SNAPSHOT" it wokrs.


I will close the ticket then, Thanks for listening. I mean, I am happy that it was fixed already, but feel like I wasted a few peoples time now 😄


Nonetheless, I learned something interesting (io/file) does not work with java.nio.file.Path.


Oh, nice! That's convenient timing! Sorry I didn't make the connection 😊


Thanks for reporting this, @U0677JTQX 🙂 As you discovered, this was part of a change between 1.9.2 and 1.10.0-SNAPSHOT - in theory, though, 1.9.2 should still have been using :crux.config/string for :crux.kv/db-dir, so I'm a little confused as to why you saw this issue :thinking_face:


Initially :crux.kv/db-dir was a string, but then it got coerced to a Path, which was then passed into (io/file which lead to the described error.


Yes - although that change was only introduced in 1.10.0 - if you were using 1.9.2 it shouldn't have been being coerced?


Interesting. I just had another look, so I had crux-core in version: "20.07-1.10.0-beta-SNAPSHOT" and crux-rocksdb in version "20.07-1.9.2-beta" which explains the difference I guess? I upgraded the core version yesterday after the anouncement in this channel and picked up rocksdb today according to the docs, where the 1.92. version was still linked.


Really unfortunate 😄


Ah, yep, that'd do it - thanks for letting us know 🙂