R
Railway•2y ago
Peaky

Rust + OpenSSL

Hi, i am traying to deploy an rust api to railway. But i always get a openssl error
30 Replies
Percy
Percy•2y ago
Project ID: 3e64c14a-faca-43cd-954b-1d0d7e1ce767
Peaky
PeakyOP•2y ago
3e64c14a-faca-43cd-954b-1d0d7e1ce767
Brody
Brody•2y ago
are you trying to start an https server?
Peaky
PeakyOP•2y ago
No But i have a depency "reqwest" that uses openssl-sys
Brody
Brody•2y ago
show me the full error logs please
Brody
Brody•2y ago
try adding this as a nixpacks.toml file to your project
[phases.setup]
nixPkgs = ["...","openssl"]
[phases.setup]
nixPkgs = ["...","openssl"]
Peaky
PeakyOP•2y ago
Same errror
Brody
Brody•2y ago
try this instead
[phases.setup]
aptPkgs = ["...","libssl-dev"]
[phases.setup]
aptPkgs = ["...","libssl-dev"]
Brody
Brody•2y ago
[phases.setup]
nixPkgs = ["...","librust-openssl-dev"]
[phases.setup]
nixPkgs = ["...","librust-openssl-dev"]
Brody
Brody•2y ago
oops
[phases.setup]
aptPkgs = ["...","librust-openssl-dev"]
[phases.setup]
aptPkgs = ["...","librust-openssl-dev"]
if this doesn't work, try disabling default imports for that reqwests package and only import the things you use from it, and then hopefully you aren't using something with openssl
Peaky
PeakyOP•2y ago
The problem is that i need the tls-native feature
Brody
Brody•2y ago
I'm out of ideas, sorry
Peaky
PeakyOP•2y ago
what i should do then?
Brody
Brody•2y ago
Google?
Peaky
PeakyOP•2y ago
I tried everything, but nothing 😢
Brody
Brody•2y ago
try moving to a Dockerfile based deployment
Peaky
PeakyOP•2y ago
It's working fine now!
Peaky
PeakyOP•2y ago
Thank you!
Brody
Brody•2y ago
you are using a dockerfile now?
db20
db20•17mo ago
For anyone looking here, I had this same issue and with these dependencies, was able to get it right. Main thing that worked for me was the openssl dependency. [dependencies] axum = "0.5.11" tokio = { version = "1.0", features = ["full"] } tracing = "0.1.35" tracing-subscriber = "0.3.14" serde = { version = "1.0.138", features = ["derive"] } serde_json = "1.0" postgrest = "1.0" env_logger = "0.9.0" tower = "0.4.13" tower-http = { version = "0.3.4", features = ["full", "cors"] } dotenv = "0.15.0" http = "0.2.8" reqwest = { version = "0.11", features = ["json", "rustls-tls"] } chrono = { version = "0.4.26", features = ["serde"] } jsonwebtoken = "8.3.0" anyhow = "1.0.71" uuid = { version = "1.4.0", features = ["serde"] } aws-config = "0.55.3" aws-sdk-secretsmanager = "0.28.0" sqlx = { version = "0.7", features = [ "runtime-tokio", "tls-rustls", "postgres", "mysql", "macros", "uuid", "chrono", "bigdecimal"] } reqwest-retry = "0.2.2" reqwest-middleware = "0.2.2" serde_yaml = "0.9.23" neo4rs = "0.6.2" maplit = "1.0.2" futures = "0.3.28" regex = "1.9.1" bigdecimal = "0.4.1" openssl = { version = "0.10", features = ["vendored"] }
BigLung
BigLung•14mo ago
interesting I tried this as well but no dice Ill let you know if I discover an alternative sollution
Want results from more Discord servers?
Add your server