Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file "file_path" not found #955

Closed
habin201291 opened this issue Feb 28, 2024 · 3 comments
Closed

Configuration file "file_path" not found #955

habin201291 opened this issue Feb 28, 2024 · 3 comments

Comments

@habin201291
Copy link

habin201291 commented Feb 28, 2024

Hi,

I created a TOML file named Settings in the /warpgate-protocol-ssh/src/server directory and used config-rs to get the values from that file.

I ran it with the debug build and it worked fine, but when I built the release build and ran it on Production, I got the following error:
called Result::unwrap() on an Err value: configuration file "warpgate-protocol-ssh/src/server/Settings" not found.

Hope this help!

@Eugeny
Copy link
Member

Eugeny commented Feb 28, 2024

Can you explain what you're trying to do?

@habin201291
Copy link
Author

I am building from source step by step following the Contributing/building from source guide and also adding some of my own features. I have created an additional file named Settings.toml in the warpgate-protocol-ssh/src/server directory. I used config-rs to get the values in the Settings.toml file from the warpgate-protocol-ssh/src/server/session.rs file.

My code is as follows:
let settings = Config::builder()
.add_source(config::File::with_name("warpgate-protocol-ssh/src/server/Settings"))
.add_source(config::Environment::with_prefix("APP"))
.build()
.unwrap();

I am not sure if I need to deploy the source code to the Production server.

@Eugeny
Copy link
Member

Eugeny commented Feb 29, 2024

Yes, if you're reading warpgate-protocol-ssh/src/server/Settings, warpgate-protocol-ssh/src/server/Settings has to exist in the place where you're reading it from.

@Eugeny Eugeny closed this as completed Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants