valeriansaliou / sonic

🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
https://crates.io/crates/sonic-server
Mozilla Public License 2.0
20.11k stars 578 forks source link

Docker run throws an error #303

Closed djcaesar9114 closed 2 years ago

djcaesar9114 commented 2 years ago

Hello, First of all merci for your work, it seems great! I've not been able to test it, though, because although I follow step by step what is written in the README ("Install from Docker Hub"), I keep encountering this error:

thread 'main' panicked at 'cannot read config file: Os { code: 21, kind: IsADirectory, message: "Is a directory" }', src/config/reader.rs:23:14
stack backtrace:
   0:     0x5639e009d557 - <unknown>
   1:     0x5639dff6962c - <unknown>
   2:     0x5639e007b840 - <unknown>
   3:     0x5639e009e135 - <unknown>
   4:     0x5639e009efd8 - <unknown>
   5:     0x5639e009eb52 - <unknown>
   6:     0x5639e009eac6 - <unknown>
   7:     0x5639e009ea82 - <unknown>
   8:     0x5639dfe9e932 - <unknown>
   9:     0x5639dfe9ebb2 - <unknown>
  10:     0x5639e005ac6b - <unknown>
  11:     0x5639dfea5369 - <unknown>
  12:     0x5639e0015ebc - <unknown>
  13:     0x5639e00168a3 - <unknown>
  14:     0x5639e0014dc6 - <unknown>
  15:     0x7f80dcadad0a - __libc_start_main
  16:     0x5639dfeef94a - <unknown>
  17:                0x0 - <unknown>

I run docker run -p 1491:1491 -e "RUST_BACKTRACE=full" -v /home/cesar/tmp/sonic/config.cfg:/etc/sonic.cfg -v /home/cesar/tmp/sonic/store/:/var/lib/sonic/store/ valeriansaliou/sonic:v1.4.0 and I have edited the sonic.cfg correctly.

What did I do wrong?

If it helps, I tried to follow the 1.2.0 version tutorial on the blog (https://journal.valeriansaliou.name/announcing-sonic-a-super-light-alternative-to-elasticsearch/), and I got this error:

thread 'main' panicked at 'cannot read config file: Os { code: 21, kind: Other, message: "Is a directory" }', src/libcore/result.rs:997:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:70
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   2: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:215
             at src/libstd/panicking.rs:478
   3: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   4: rust_begin_unwind
             at src/libstd/panicking.rs:312
   5: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   6: core::result::unwrap_failed
   7: std::sync::once::Once::call_once::{{closure}}
   8: std::sync::once::Once::call_inner
             at src/libstd/sync/once.rs:387
   9: sonic::main
  10: std::rt::lang_start::{{closure}}
  11: main
  12: __libc_start_main
  13: _start
valeriansaliou commented 2 years ago

Given the error message (Is a directory), it sees a directory instead of a file at /etc/sonic.cfg ; are you running on Windows?

djcaesar9114 commented 2 years ago

No, Linux, but it was actually my mistake: my file was called sonic.cfg and not config.cfg. That is what happens when you code instead of sleeping the night! Thanks for your fast answer, as fast as Sonic!