R
Railway6mo ago
Dihui

build failed without changes

not very good at coding im just hosting this bot but it suddenly stopped working without changes project id: a905169b-c3cb-4af1-a24e-5b5fac02d6cb
Solution:
i was able to get the repo to deploy. Remove the railway.json and Procfile, add a Dockerfile with this in it - ```dockerfile FROM node:16-slim...
Jump to solution
63 Replies
Percy
Percy6mo ago
Project ID: a905169b-c3cb-4af1-a24e-5b5fac02d6cb
Brody
Brody6mo ago
node 16 is no longer supported
Dihui
DihuiOP6mo ago
uh what does that mean and how do i fix this
Brody
Brody6mo ago
uh what does that mean
I'm sorry but I'm not sure how I could clarify further.
how do i fix this
set your engines.node to 18 in the package.json
Dihui
DihuiOP6mo ago
hi sorry for the late reply thjeres no engines.node in package.json
Dihui
DihuiOP6mo ago
this is the closest thing i have in package-lock.json
No description
Dihui
DihuiOP6mo ago
and someone told me to set this to 16 and now ive changed it to 18 but it still doesnt work
No description
Dihui
DihuiOP6mo ago
Brody
Brody6mo ago
add python to the list of providers in your service settings on railway
Dihui
DihuiOP6mo ago
sorry how exactly do i do that
Dihui
DihuiOP6mo ago
is it like this?
No description
Brody
Brody6mo ago
not quite, please look into your service settings, you will find a providers option, add python with the dropdown
Dihui
DihuiOP6mo ago
ok i think got it but its still broken
Dihui
DihuiOP6mo ago
oh oops the log got cut off
Brody
Brody6mo ago
in the future please use this - https://bookmarklets.up.railway.app/log-downloader/ are you using canvas in your project
Dihui
DihuiOP6mo ago
i dont think so?
Dihui
DihuiOP6mo ago
if youre talking about this
No description
Brody
Brody6mo ago
nope, I'm talking about your code
Dihui
DihuiOP6mo ago
uhhh i didnt code this im just hosting it so i really dont know also the bookmarklet doesnt seem to be working for me it just opens a blank page
Brody
Brody6mo ago
follow the steps I'll be brutally honest, it's going to be hard to host a project you don't know anything about, and by extension even harder for me to help you
Dihui
DihuiOP6mo ago
yea sorry its just that its been working for like 2 years and just randomly stopped i could asked the person that coded it if you want
Brody
Brody6mo ago
you have access to the codebase right? can you send me the package.json please
Dihui
DihuiOP6mo ago
Brody
Brody6mo ago
okay thanks, I have an idea that I will put together when I'm back at the computer
Dihui
DihuiOP6mo ago
ok ty for your help take your time
Brody
Brody6mo ago
try adding this as a railway.json file to your project -
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"nixPkgs": ["...", "python3", "gcc"],
"aptPkgs": ["...", "build-essential", "libcairo2-dev", "libpango1.0-dev", "libjpeg-dev", "libgif-dev", "librsvg2-dev"]
}
}
}
},
"deploy": {
"startCommand": "node index.js "
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"nixPkgs": ["...", "python3", "gcc"],
"aptPkgs": ["...", "build-essential", "libcairo2-dev", "libpango1.0-dev", "libjpeg-dev", "libgif-dev", "librsvg2-dev"]
}
}
}
},
"deploy": {
"startCommand": "node index.js "
}
}
Dihui
DihuiOP6mo ago
that also didnt work
Brody
Brody6mo ago
im guessing you really do need node 14, but nixpacks no longer supports node 14 please tell me the timestamp of the last build that did work
Dihui
DihuiOP6mo ago
4th of april
Brody
Brody6mo ago
year?
Dihui
DihuiOP6mo ago
2024
Brody
Brody6mo ago
thanks, where are you obtaining this date from?
Dihui
DihuiOP6mo ago
i have a log that tracks when the bot goes online and that was the last one
Brody
Brody6mo ago
im sorry but thats not what i was asking for
Dihui
DihuiOP6mo ago
oh what did you mean then
Brody
Brody6mo ago
i would like the timestamp for the last railway build that worked
Dihui
DihuiOP6mo ago
yea i went back to railway and checked it should be the same
No description
Dihui
DihuiOP6mo ago
also i did notice the bot started failing while it was still running fine if that helps
Brody
Brody6mo ago
okay thank you, just needed to be sure the date was from railway are you able to share a link to the repo?
Dihui
DihuiOP6mo ago
GitHub
GitHub - MX1D/Guild-Bot-Rewrite
Contribute to MX1D/Guild-Bot-Rewrite development by creating an account on GitHub.
Brody
Brody6mo ago
so quick question, where is the railway.json?
Dihui
DihuiOP6mo ago
oh this is the original one i added it to mine
Brody
Brody6mo ago
whats different about yours?
Dihui
DihuiOP6mo ago
it should be the same but all the config is filled in and with the railway.json you sent
Brody
Brody6mo ago
okay sounds good, ill try some different approaches to get this repo to deploy
Solution
Brody
Brody6mo ago
i was able to get the repo to deploy. Remove the railway.json and Procfile, add a Dockerfile with this in it -
FROM node:16-slim

ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . ./

CMD ["node", "index.js"]
FROM node:16-slim

ENV NPM_CONFIG_UPDATE_NOTIFIER=false
ENV NPM_CONFIG_FUND=false

WORKDIR /app

COPY package*.json ./

RUN npm ci

COPY . ./

CMD ["node", "index.js"]
Dihui
DihuiOP6mo ago
do i just name the file Dockerfile with no extension?
Dihui
DihuiOP6mo ago
Brody
Brody6mo ago
correct please use the bookmarklet
Dihui
DihuiOP6mo ago
oh right sorry
Brody
Brody6mo ago
please send your package.json, not the package.json from the repo you sent me
Dihui
DihuiOP6mo ago
this is the one
Brody
Brody6mo ago
thanks, just needed to be sure copy the package.json and package-lock.json files from this repo into yours
Dihui
DihuiOP6mo ago
ok now it successsfully deployed but crashed after
Brody
Brody6mo ago
what error?
Brody
Brody6mo ago
interesting, this is proving to be difficult
Dihui
DihuiOP6mo ago
it used to also spam errors like this in deploy logs but it never affected anything so i just ignored it
Brody
Brody6mo ago
in your dockerfile change node:14-slim to node:16-slim
Dihui
DihuiOP6mo ago
yooo that worked! tysm for your time
Brody
Brody6mo ago
happy to help
Want results from more Discord servers?
Add your server