Diesel does not work on railway

Diesel is a rust ORM, i need to run the migrations on railway before starting the app, but the CLI doesnt start

#15 [stage-0 11/11] RUN --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/git,target=/root/.cargo/git --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/registry,target=/root/.cargo/registry /root/.cargo/bin/diesel migration run
#15 sha256:90fb84cae925ae0d62f883929b2c961ce115e861c0118a1dcf34cc63b250f743

#15 0.478 /root/.cargo/bin/diesel: error while loading shared libraries: libgssapi_krb5.so.2: cannot open shared object file: No such file or directory
#15 ERROR: executor failed running [/bin/bash -ol pipefail -c /root/.cargo/bin/diesel migration run]: exit code: 127

-----
> [stage-0 11/11] RUN --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/git,target=/root/.cargo/git --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/registry,target=/root/.cargo/registry /root/.cargo/bin/diesel migration run:
-----
executor failed running [/bin/bash -ol pipefail -c /root/.cargo/bin/diesel migration run]: exit code: 127

Error: Docker build failed


#15 [stage-0 11/11] RUN --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/git,target=/root/.cargo/git --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/registry,target=/root/.cargo/registry /root/.cargo/bin/diesel migration run
#15 sha256:90fb84cae925ae0d62f883929b2c961ce115e861c0118a1dcf34cc63b250f743

#15 0.478 /root/.cargo/bin/diesel: error while loading shared libraries: libgssapi_krb5.so.2: cannot open shared object file: No such file or directory
#15 ERROR: executor failed running [/bin/bash -ol pipefail -c /root/.cargo/bin/diesel migration run]: exit code: 127

-----
> [stage-0 11/11] RUN --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/git,target=/root/.cargo/git --mount=type=cache,id=s/c95327cd-2bfb-4943-bfb2-23352468f0a4-/root/cargo/registry,target=/root/.cargo/registry /root/.cargo/bin/diesel migration run:
-----
executor failed running [/bin/bash -ol pipefail -c /root/.cargo/bin/diesel migration run]: exit code: 127

Error: Docker build failed

nixpacks.toml:
[phase.name]
nixOverlays = ['https://github.com/oxalica/rust-overlay/archive/master.tar.gz']
[phases.setup]
nixPkgs = ['nodejs', "rust-bin.nightly.latest.default", "gcc", "glibc"]
aptPkgs = ['libpq-dev', 'libgssapi-krb5-2']
[phases.build]
cmds = [
'cargo install diesel_cli --no-default-features -F postgres',
'cargo build -r',
'cd marketplace && npm install && node_modules/.bin/vite build',
'/root/.cargo/bin/diesel migration run'
]
[start]
cmd = "./target/release/server"
[phase.name]
nixOverlays = ['https://github.com/oxalica/rust-overlay/archive/master.tar.gz']
[phases.setup]
nixPkgs = ['nodejs', "rust-bin.nightly.latest.default", "gcc", "glibc"]
aptPkgs = ['libpq-dev', 'libgssapi-krb5-2']
[phases.build]
cmds = [
'cargo install diesel_cli --no-default-features -F postgres',
'cargo build -r',
'cd marketplace && npm install && node_modules/.bin/vite build',
'/root/.cargo/bin/diesel migration run'
]
[start]
cmd = "./target/release/server"
154 Replies
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
@IgnisDa
nebula
nebulaβ€’3y ago
don’t ping random people lol
nebula
nebulaβ€’3y ago
ah alright
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
but can you help me
nebula
nebulaβ€’3y ago
can you send the full build logs ideally the diesel binary should be statically linked
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
how do i do that
nebula
nebulaβ€’3y ago
oh hold on whats in marketplace
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
its a svelte app
nebula
nebulaβ€’3y ago
why is that bundled with rust?
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
its the frontend
nebula
nebulaβ€’3y ago
you should deploy those as two different services ideally
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i want the frontend and api to have the same origin bcs otherwise it can generate CORS problems
nebula
nebulaβ€’3y ago
the issue is nixpacks rn does not support multiple providers (its in the works) we can probably monkeypatch it tho
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
no i just build the svelte app into static html and rocket serves it
nebula
nebulaβ€’3y ago
yeah, but nixpacks doesnt support node + rust for autodetect we need to manually tell it that
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
but the that's not the problem the problem is that diesel_cli doesnt start
nebula
nebulaβ€’3y ago
ye one sec
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
it needs a library that idk how to install i tried everything i could other question, does railway sync the DATABASE_URL and REDIS_URL variables from the database services?
nebula
nebulaβ€’3y ago
[phases.setup]
nixOverlays = ['...', 'https://github.com/oxalica/rust-overlay/archive/master.tar.gz']
nixPkgs = ['...', 'diesel-cli', 'nodejs', "rust-bin.nightly.latest.default", "gcc", "glibc"]
[phases.svelte-install]
dependsOn = ["...", "setup"]
cacheDirectories = ['marketplace/node_modules/.cache']
cmds = [
'cd marketplace && npm ci'
]
[phases.svelte-build]
dependsOn = ["...", "svelte-install"]
cmds = [
'cd marketplace && node_modules/.bin/vite build',
]
[phases.build]
cacheDirectories = ['...', '~/.cargo/git', '~/.cargo/registry', 'target']
dependsOn = ["...", "svelte-build"]
cmds = [
'cargo build -r',
'diesel migration run'
]
[start]
cmd = "./target/release/server"
[phases.setup]
nixOverlays = ['...', 'https://github.com/oxalica/rust-overlay/archive/master.tar.gz']
nixPkgs = ['...', 'diesel-cli', 'nodejs', "rust-bin.nightly.latest.default", "gcc", "glibc"]
[phases.svelte-install]
dependsOn = ["...", "setup"]
cacheDirectories = ['marketplace/node_modules/.cache']
cmds = [
'cd marketplace && npm ci'
]
[phases.svelte-build]
dependsOn = ["...", "svelte-install"]
cmds = [
'cd marketplace && node_modules/.bin/vite build',
]
[phases.build]
cacheDirectories = ['...', '~/.cargo/git', '~/.cargo/registry', 'target']
dependsOn = ["...", "svelte-build"]
cmds = [
'cargo build -r',
'diesel migration run'
]
[start]
cmd = "./target/release/server"
try that for nixpacks.toml
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
... means what? thought it was a place holder
nebula
nebulaβ€’3y ago
wdym
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
"..." on the packages
nebula
nebulaβ€’3y ago
oh that means extend the existing nixpacks config so nixpacks automatically detects stuff and we want to add to that
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
they should definitely change that
nebula
nebulaβ€’3y ago
i agree
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i really thought it was a place holder
nebula
nebulaβ€’3y ago
GitHub
GitHub - railwayapp/nixpacks: App source + Nix packages + Docker = ...
App source + Nix packages + Docker = Image. Contribute to railwayapp/nixpacks development by creating an account on GitHub.
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
like , keep what you had and add this
nebula
nebulaβ€’3y ago
i'll pick it up sometime today
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
they can add a property like, disable-default-packages that would make much more sense
nebula
nebulaβ€’3y ago
ye, would be great if you can leave your feedback on an issue in the repo that way its tracked and can be implemented
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
it would break a lot of projects though or maybe not it can just print ... is deprecated, default packages are on by default, you can disable the default packages by enabling X property
nebula
nebulaβ€’3y ago
could be an additional syntax
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
🀞lets hope this works
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
wtf
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
/app/.nixpacks/rust-toolchain.toml: No such file or directory
Finn
Finnβ€’3y ago
oh we are here
Finn
Finnβ€’3y ago
Finn
Finnβ€’3y ago
did you guys fix le issue?
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
Finn
Finnβ€’3y ago
is is unfortunately very relatable
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
#8 25.81 error: opening file '/app/.nixpacks/rust-toolchain': No such file or directory
nebula
nebulaβ€’3y ago
diesel is so bad idk why people still use it πŸ’€
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
what are the alternatives i can migrate now my project is not that big
nebula
nebulaβ€’3y ago
[phases.name]
nixOverlays = ['https://github.com/oxalica/rust-overlay/archive/master.tar.gz']
[phases.setup]
nixPkgs = ['...', 'diesel-cli', 'nodejs', "rust-bin.nightly.latest.default", "gcc", "glibc"]
[phases.svelte-install]
dependsOn = ["...", "setup"]
cacheDirectories = ['marketplace/node_modules/.cache']
cmds = [
'cd marketplace && npm ci'
]
[phases.svelte-build]
dependsOn = ["...", "svelte-install"]
cmds = [
'cd marketplace && node_modules/.bin/vite build',
]
[phases.build]
cacheDirectories = ['...', '~/.cargo/git', '~/.cargo/registry', 'target']
dependsOn = ["...", "svelte-build"]
cmds = [
'cargo build -r',
'diesel migration run'
]
[start]
cmd = "./target/release/server"
[phases.name]
nixOverlays = ['https://github.com/oxalica/rust-overlay/archive/master.tar.gz']
[phases.setup]
nixPkgs = ['...', 'diesel-cli', 'nodejs', "rust-bin.nightly.latest.default", "gcc", "glibc"]
[phases.svelte-install]
dependsOn = ["...", "setup"]
cacheDirectories = ['marketplace/node_modules/.cache']
cmds = [
'cd marketplace && npm ci'
]
[phases.svelte-build]
dependsOn = ["...", "svelte-install"]
cmds = [
'cd marketplace && node_modules/.bin/vite build',
]
[phases.build]
cacheDirectories = ['...', '~/.cargo/git', '~/.cargo/registry', 'target']
dependsOn = ["...", "svelte-build"]
cmds = [
'cargo build -r',
'diesel migration run'
]
[start]
cmd = "./target/release/server"
try that lol prisma-client-rust wayyyy better
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i only have 2 tables so shoudnt be too hard
nebula
nebulaβ€’3y ago
actually its like super easy just run cargo prisma db pull it wil autogen the schema from ur db
Finn
Finnβ€’3y ago
rust prisma
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
documentation url?
nebula
nebulaβ€’3y ago
Prisma Client Rust
Introduction | Prisma Client Rust
Type-safe database access for Rust
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i though prisma only worked on js
nebula
nebulaβ€’3y ago
theres a rust version
Finn
Finnβ€’3y ago
i actually acidently spoke to him this week, i had no idea skull1 . nice guy
Finn
Finnβ€’3y ago
Finn
Finnβ€’3y ago
he likedhubert
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
how do you have that theme? is it a mod?
Finn
Finnβ€’3y ago
nu amoled dark theme on mobile you should turn it on RN
nebula
nebulaβ€’3y ago
smh android user
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i like that more
Finn
Finnβ€’3y ago
like what more?
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
the theme
Finn
Finnβ€’3y ago
ohh yea turn it on!
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i hate gray backgrounds
Finn
Finnβ€’3y ago
me to the sky is always grey over here
nebula
nebulaβ€’3y ago
ur wifi icon reminded me i need to call xfinity and yell at them scammers
Finn
Finnβ€’3y ago
record the phonecall
nebula
nebulaβ€’3y ago
nah imma get doxxed πŸ’€
Finn
Finnβ€’3y ago
skull1
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
lol
Finn
Finnβ€’3y ago
already happend your hoodie is on its way πŸ˜‰
nebula
nebulaβ€’3y ago
😳
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
just block the f*cking number
Finn
Finnβ€’3y ago
LOOOL
nebula
nebulaβ€’3y ago
nono you see i pay for 300mbps they give me 100
Finn
Finnβ€’3y ago
sucker sucks to suck
nebula
nebulaβ€’3y ago
they refuse to run a fiber line down here anguish
Finn
Finnβ€’3y ago
Waaa
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
on portugal you can have a 1gbps internet by 38€ on WOO
nebula
nebulaβ€’3y ago
meanwhile the neighbors with their fancy synchronous gigabit fiber im so mad
Finn
Finnβ€’3y ago
portuagal is chill stay mad + ratio + no hoodie
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i'm literally in the end of the world i still have fiber
Finn
Finnβ€’3y ago
same literally same
nebula
nebulaβ€’3y ago
BRUH THATS WHAT I MEAN literally everyone and their mother has fiber
Finn
Finnβ€’3y ago
the gov pays massive subsidys to do rural areas beacuse otherwise it will never get done so they leave the citys alone
nebula
nebulaβ€’3y ago
common american L
Finn
Finnβ€’3y ago
common neb W
nebula
nebulaβ€’3y ago
the cities have fiber, the cows have fiber, i dont have fiber
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
Android is not that bad cmon
nebula
nebulaβ€’3y ago
nah i was trolling android is chill
Finn
Finnβ€’3y ago
the words look funny? how do you read it lanterna why not just say light or torch
nebula
nebulaβ€’3y ago
πŸ’€
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
flash light
nebula
nebulaβ€’3y ago
british people being british
Finn
Finnβ€’3y ago
somone get the gif of the blue man in the apple store
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
its in portuguese i'm from portugal
Finn
Finnβ€’3y ago
henery the navigator 😎 lool
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i didnt see bcs it was still loading
Finn
Finnβ€’3y ago
common portugeess internet
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i'm using wifi
Finn
Finnβ€’3y ago
the speeds may be fast but the ping
nebula
nebulaβ€’3y ago
finn.
Finn
Finnβ€’3y ago
yes
nebula
nebulaβ€’3y ago
you live across the sea
Finn
Finnβ€’3y ago
the English channel
nebula
nebulaβ€’3y ago
the Atlantic Ocean
Finn
Finnβ€’3y ago
oh com on, we own that aswell
nebula
nebulaβ€’3y ago
me when the brits decide to dig under the ocean πŸ’€
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
we killed the topic and put it off
Finn
Finnβ€’3y ago
sorry my bad
nebula
nebulaβ€’3y ago
yeah just use prisma it fixes everything
Finn
Finnβ€’3y ago
so yea use prisma rut
nebula
nebulaβ€’3y ago
tbh
Finn
Finnβ€’3y ago
also are you running embeded migrations or manually running them?
nebula
nebulaβ€’3y ago
hes running migrate on deploy
Finn
Finnβ€’3y ago
ahh i see eventuall migrations like that will take down your app though at a big enough scale ig
nebula
nebulaβ€’3y ago
why
Finn
Finnβ€’3y ago
who table lock to apply the migrations whole
nebula
nebulaβ€’3y ago
oh thats a problem for like massive apps he has two tables
Finn
Finnβ€’3y ago
ye
nebula
nebulaβ€’3y ago
idt we have a problem
Finn
Finnβ€’3y ago
your correct but what iff giving a presentation on oline schema migrations on tuseday very cool online* i havent even started it tho skull1
nebula
nebulaβ€’3y ago
what a bozo
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
whyyy
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
i really have to create a cli bin on purpose
nebula
nebulaβ€’3y ago
yeah its weird
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
does prisma use libpq-dev? i'm using postgres
milo
miloβ€’3y ago
That is really unclear We should. Aka it automatically inherit and then have an opinion to remove Option
nebula
nebulaβ€’3y ago
no its native rust
milo
miloβ€’3y ago
Does this work for diesel neb?
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
@Finn is it bad to commit the prisma.rs file?
Finn
Finnβ€’3y ago
ughh whats in it? @Tiaguinho
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
It's generated by Prisma, it's like diesel's schema.rs, the difference is that is generated from a Prisma file instead of the migrations
milo
miloβ€’3y ago
You need to
nebula
nebulaβ€’3y ago
no you run cargo prisma generate on deployment you dont commit it
milo
miloβ€’3y ago
Bro what are you talking about??? You depend on the things it generates in your code How you gonna do that unless you commit it? Smart one
nebula
nebulaβ€’3y ago
my boy do you commit node_modules on nodejs
milo
miloβ€’3y ago
that is completely different? CI will fail unless you commit it or generate it in CI, thats stupid
nebula
nebulaβ€’3y ago
you generate it in CI yeah thats how it works in js as well you never commit generated code thats stupid
milo
miloβ€’3y ago
not true
nebula
nebulaβ€’3y ago
???
milo
miloβ€’3y ago
where on the docs does it say gitignore it
nebula
nebulaβ€’3y ago
GitHub
prisma-client-rust/examples/rocket at main Β· Brendonovich/prisma-cl...
Type-safe database access for Rust. Contribute to Brendonovich/prisma-client-rust development by creating an account on GitHub.
nebula
nebulaβ€’3y ago
i dont see one on any of the examples
milo
miloβ€’3y ago
where is gitignore ?
nebula
nebulaβ€’3y ago
GitHub
prisma-client-rust/ci.yaml at main Β· Brendonovich/prisma-client-rust
Type-safe database access for Rust. Contribute to Brendonovich/prisma-client-rust development by creating an account on GitHub.
nebula
nebulaβ€’3y ago
look its generated in CI
milo
miloβ€’3y ago
i see no generate
nebula
nebulaβ€’3y ago
prisma db push runs generate
milo
miloβ€’3y ago
mmm i mean it can be useful to not gitignore some times
Tiago Uabeiro
Tiago Uabeiroβ€’3y ago
How do I do a create or update in Prisma? I want to create if it doesn't not exist, but if it exists I want to update
nebula
nebulaβ€’3y ago
upsert
nebula
nebulaβ€’3y ago
Want results from more Discord servers?
Add your server