Fork me on GitHub
#xtdb
<
2020-07-25
>
sveri09:07:48

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"))

sveri09:07:07

Should I open an issue for that?

refset09:07:47

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

refset09:07:05

Feel free to open an issue :)

sveri09:07:17

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 .

sveri09:07:53

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

refset09:07:23

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

sveri10:07:12

-.- 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: https://github.com/juxt/crux/commit/fdbff026b745d96ef25e474be3128e131f0a3944#diff-213326f730be85f2c4b81ba31fbe17acR146 which fixes that exact problem. So, If I switch to the yesterday released verison: "20.07-1.10.0-beta-SNAPSHOT" it wokrs.

sveri10:07:05

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 😄

sveri10:07:41

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

refset10:07:17

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

jarohen16:07:52

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:

sveri16:07:09

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.

jarohen17:07:34

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?

sveri18:07:59

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.

sveri18:07:06

Really unfortunate 😄

âž• 3
jarohen09:07:48

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