Code Monkey home page Code Monkey logo

Comments (6)

ViViDboarder avatar ViViDboarder commented on May 26, 2024

No need to apologize. 😄

It seems like you're running in a container but that the path you're providing in the env variable is actually the absolute path on the host, not the path from within the container. When you spun up the container and added a volume for the config file, where did you mount it?

When using Docker, you can just mount the config file to the default location directly. That way you don't have to set the env variable at all. Here's what I typically do in the example compose file. https://github.com/ViViDboarder/bitwarden_rs_ldap/blob/master/docker-compose.yml#L8

If you're running on the command line, it'd be something more like:

docker run -d -v $(pwd)/config.toml:/usr/src/bitwarden_rs_ldap/config.toml:ro vividboarder/bitwarden_rs_ldap

If you don't like that location in the container, you can pass anything and set the env var. Eg.

docker run -d -v $(pwd)/config.toml:/container/path/config.toml:ro -e CONFIG_FILE=/container/path/config.toml vividboarder/bitwarden_rs_ldap

Key being that the destination path matches the env var, not the source path.

from vaultwarden_ldap.

trentnbauer avatar trentnbauer commented on May 26, 2024

Hi mate,
Thanks heaps for the fast reply and being understanding! I'm still a little bit confused though, I'm unsure what to put in for the container, or does it not matter as long as the config_path variable matches?
https://pasteboard.co/IGyJqO6.png

Edit:
Just tried /config:/mnt/nfs/synology/bitwardenldap and CONFIG_FILE=/config/config.toml and same error;

note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.,
thread 'main' panicked at 'Failed to open config file at config.toml', src/config.rs:25:9

from vaultwarden_ldap.

trentnbauer avatar trentnbauer commented on May 26, 2024

Enabled backtrace;

2019-11-15T02:17:09.741965803Z   14: _start


2019-11-15T02:17:13.546717783Z thread 'main' panicked at 'Failed to open config file at config.toml', src/config.rs:25:9


2019-11-15T02:17:13.554265864Z stack backtrace:


2019-11-15T02:17:13.554345228Z    0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace


2019-11-15T02:17:13.570052717Z              at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39


2019-11-15T02:17:13.570074374Z    1: std::sys_common::backtrace::_print


2019-11-15T02:17:13.570082600Z              at src/libstd/sys_common/backtrace.rs:70


2019-11-15T02:17:13.570089905Z    2: std::panicking::default_hook::{{closure}}


2019-11-15T02:17:13.570098971Z              at src/libstd/sys_common/backtrace.rs:58


2019-11-15T02:17:13.570106266Z              at src/libstd/panicking.rs:200


2019-11-15T02:17:13.570113197Z    3: std::panicking::default_hook


2019-11-15T02:17:13.570120953Z              at src/libstd/panicking.rs:215


2019-11-15T02:17:13.570127987Z    4: std::panicking::rust_panic_with_hook


2019-11-15T02:17:13.570135833Z              at src/libstd/panicking.rs:478


2019-11-15T02:17:13.570143726Z    5: std::panicking::continue_panic_fmt


2019-11-15T02:17:13.570176715Z              at src/libstd/panicking.rs:385


2019-11-15T02:17:13.570205002Z    6: std::panicking::begin_panic_fmt


2019-11-15T02:17:13.570215521Z              at src/libstd/panicking.rs:340


2019-11-15T02:17:13.570222928Z    7: bitwarden_rs_ldap::main


2019-11-15T02:17:13.570267459Z    8: std::rt::lang_start::{{closure}}


2019-11-15T02:17:13.570278074Z    9: std::panicking::try::do_call


2019-11-15T02:17:13.570285261Z              at src/libstd/rt.rs:49


2019-11-15T02:17:13.570292264Z              at src/libstd/panicking.rs:297


2019-11-15T02:17:13.570315887Z   10: __rust_maybe_catch_panic


2019-11-15T02:17:13.570427953Z              at src/libpanic_unwind/lib.rs:92


2019-11-15T02:17:13.570440740Z   11: std::rt::lang_start_internal


2019-11-15T02:17:13.570448210Z              at src/libstd/panicking.rs:276


2019-11-15T02:17:13.570455214Z              at src/libstd/panic.rs:388


2019-11-15T02:17:13.570472186Z              at src/libstd/rt.rs:48


2019-11-15T02:17:13.570480283Z   12: main


2019-11-15T02:17:13.570487295Z   13: __libc_start_main

from vaultwarden_ldap.

ViViDboarder avatar ViViDboarder commented on May 26, 2024

Yea. Make sure path in container matches the variable that you set.

from vaultwarden_ldap.

trentnbauer avatar trentnbauer commented on May 26, 2024

Hi mate,
I tried this;
docker run -d -v /config.toml:/mnt/nfs/synology/bitwardenldap/config.toml:ro vividboarder/bitwarden_rs_ldap
and I'm still getting the "failed to open config.toml" error :(

from vaultwarden_ldap.

ViViDboarder avatar ViViDboarder commented on May 26, 2024

You have your source and destination swapped. I'm assuming the file is actually sitting at /mnt/nfs/synology/bitwardenldap/config.toml. If so, you'll want to do:

docker run -d -v /mnt/nfs/synology/bitwardenldap/config.toml:/usr/src/bitwarden_rs_ldap/config.toml:ro vividboarder/bitwarden_rs_ldap

from vaultwarden_ldap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.