Rust server fails on railway

I'm trying to host my rust server on railway I use this guy's template https://railway.app/template/4lz789, when project build main panics and throws error about OPENSSL here is full error
#13 1.381 --- stderr
#13 1.381 thread 'main' panicked at '
#13 1.381
#13 1.381 Could not find directory of OpenSSL installation, and this `-sys` crate cannot
#13 1.381 proceed without this knowledge. If OpenSSL is installed and this crate had
#13 1.381 trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
#13 1.381 compilation process.
#13 1.381
#13 1.381 Make sure you also have the development packages of openssl installed.
#13 1.381 For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
#13 1.381
#13 1.381 If you're in a situation where you think the directory *should* be found
#13 1.381 automatically, please open a bug at https://github.com/sfackler/rust-openssl
#13 1.381 and include information about your system as well as this message.
#13 1.381
#13 1.381 $HOST = x86_64-unknown-linux-gnu
#13 1.381 $TARGET = x86_64-unknown-linux-musl
#13 1.381 openssl-sys = 0.9.90
#13 1.381 --- stderr
#13 1.381 thread 'main' panicked at '
#13 1.381
#13 1.381 Could not find directory of OpenSSL installation, and this `-sys` crate cannot
#13 1.381 proceed without this knowledge. If OpenSSL is installed and this crate had
#13 1.381 trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
#13 1.381 compilation process.
#13 1.381
#13 1.381 Make sure you also have the development packages of openssl installed.
#13 1.381 For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
#13 1.381
#13 1.381 If you're in a situation where you think the directory *should* be found
#13 1.381 automatically, please open a bug at https://github.com/sfackler/rust-openssl
#13 1.381 and include information about your system as well as this message.
#13 1.381
#13 1.381 $HOST = x86_64-unknown-linux-gnu
#13 1.381 $TARGET = x86_64-unknown-linux-musl
#13 1.381 openssl-sys = 0.9.90
how can I fix that issue?
Solution:
openssl = {version = "0.10.55", features = ["vendored"]}
openssl = {version = "0.10.55", features = ["vendored"]}
...
Jump to solution
23 Replies
Percy
Percy17mo ago
Project ID: e5ef3329-8973-45aa-85cf-12d7e6349ff7
yaviscoke
yaviscokeOP17mo ago
fe64c2e8-8097-4844-aa29-e89674a68409 project id: fe64c2e8-8097-4844-aa29-e89674a68409
Brody
Brody17mo ago
try adding a nixpacks.toml file with this in it
[phases.setup]
aptPkgs = ["...", "libssl-dev"]
[phases.setup]
aptPkgs = ["...", "libssl-dev"]
yaviscoke
yaviscokeOP17mo ago
Brody
Brody17mo ago
show me your nixpacks.toml file please
yaviscoke
yaviscokeOP17mo ago
I just pasted what u told me 😄
Brody
Brody17mo ago
what's the default root directory for that template?
yaviscoke
yaviscokeOP17mo ago
/app right now I moved nixpacks.toml in app project is building still failed
#14 8.392 error: failed to run custom build command for `openssl-sys v0.9.90`
#14 8.392 error: failed to run custom build command for `openssl-sys v0.9.90`
#14 8.393 --- stderr
#14 8.393 thread 'main' panicked at '
#14 8.393
#14 8.393 Could not find directory of OpenSSL installation, and this `-sys` crate cannot
#14 8.393 proceed without this knowledge. If OpenSSL is installed and this crate had
#14 8.393 trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
#14 8.393 compilation process.
#14 8.393
#14 8.393 Make sure you also have the development packages of openssl installed.
#14 8.393 For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
#14 8.393
#14 8.393 If you're in a situation where you think the directory *should* be found
#14 8.393 automatically, please open a bug at https://github.com/sfackler/rust-openssl
#14 8.393 and include information about your system as well as this message.
#14 8.393
#14 8.393 $HOST = x86_64-unknown-linux-gnu
#14 8.393 $TARGET = x86_64-unknown-linux-musl
#14 8.393 openssl-sys = 0.9.90
#14 8.393
#14 8.393 ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/build/find_normal.rs:190:5
#14 8.393 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#14 8.393 warning: build failed, waiting for other jobs to finish...
#14 8.393 --- stderr
#14 8.393 thread 'main' panicked at '
#14 8.393
#14 8.393 Could not find directory of OpenSSL installation, and this `-sys` crate cannot
#14 8.393 proceed without this knowledge. If OpenSSL is installed and this crate had
#14 8.393 trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
#14 8.393 compilation process.
#14 8.393
#14 8.393 Make sure you also have the development packages of openssl installed.
#14 8.393 For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
#14 8.393
#14 8.393 If you're in a situation where you think the directory *should* be found
#14 8.393 automatically, please open a bug at https://github.com/sfackler/rust-openssl
#14 8.393 and include information about your system as well as this message.
#14 8.393
#14 8.393 $HOST = x86_64-unknown-linux-gnu
#14 8.393 $TARGET = x86_64-unknown-linux-musl
#14 8.393 openssl-sys = 0.9.90
#14 8.393
#14 8.393 ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/build/find_normal.rs:190:5
#14 8.393 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#14 8.393 warning: build failed, waiting for other jobs to finish...
in build logs saw libssl-dev installed
yaviscoke
yaviscokeOP17mo ago
Brody
Brody17mo ago
okay, I will do some testing later and get back to you
yaviscoke
yaviscokeOP17mo ago
thanks i just hosted same template and it worked but when i make some changes in code it fails
Brody
Brody17mo ago
you must have added a crate that relies on openssl please provide me a minimal reproducible repo, or there's not much I can do to help, I was under the impression the unmodified template fails to build
yaviscoke
yaviscokeOP17mo ago
I literally hosted https://github.com/dobecad/actix-sqlx-pg this and it worked when I made changes, it started failing, i just reseted everything as it was default, and now its still failing
Brody
Brody17mo ago
^
yaviscoke
yaviscokeOP17mo ago
found out reqwest package causes that
Brody
Brody17mo ago
I would still need a minimal reproducible repo
yaviscoke
yaviscokeOP17mo ago
okay wait
yaviscoke
yaviscokeOP17mo ago
GitHub
GitHub - callmenikk/Actix
Contribute to callmenikk/Actix development by creating an account on GitHub.
yaviscoke
yaviscokeOP17mo ago
here is in Cargo.toml if i remove reqwest it builds well
Brody
Brody17mo ago
thanks, I will do some tests later
yaviscoke
yaviscokeOP17mo ago
I just fixed it by adding openssl package in cargo
Solution
yaviscoke
yaviscoke17mo ago
openssl = {version = "0.10.55", features = ["vendored"]}
openssl = {version = "0.10.55", features = ["vendored"]}
Brody
Brody17mo ago
ah I'm glad you could solve it!
Want results from more Discord servers?
Add your server