R
Railway5mo 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
Percy5mo ago
Project ID: a905169b-c3cb-4af1-a24e-5b5fac02d6cb
Brody
Brody5mo ago
node 16 is no longer supported
Dihui
Dihui5mo ago
uh what does that mean and how do i fix this
Brody
Brody5mo 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
Dihui5mo ago
hi sorry for the late reply thjeres no engines.node in package.json
Dihui
Dihui5mo ago
this is the closest thing i have in package-lock.json
No description
Dihui
Dihui5mo ago
and someone told me to set this to 16 and now ive changed it to 18 but it still doesnt work
No description
Brody
Brody5mo ago
add python to the list of providers in your service settings on railway
Dihui
Dihui5mo ago
sorry how exactly do i do that
Dihui
Dihui5mo ago
is it like this?
No description
Brody
Brody5mo ago
not quite, please look into your service settings, you will find a providers option, add python with the dropdown
Dihui
Dihui5mo ago
ok i think got it but its still broken
Dihui
Dihui5mo ago
oh oops the log got cut off
Brody
Brody5mo ago
in the future please use this - https://bookmarklets.up.railway.app/log-downloader/ are you using canvas in your project
Dihui
Dihui5mo ago
i dont think so?
Dihui
Dihui5mo ago
if youre talking about this
No description
Brody
Brody5mo ago
nope, I'm talking about your code
Dihui
Dihui5mo 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
Brody5mo 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
Dihui5mo 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
Brody5mo ago
you have access to the codebase right? can you send me the package.json please
Brody
Brody5mo ago
okay thanks, I have an idea that I will put together when I'm back at the computer
Dihui
Dihui5mo ago
ok ty for your help take your time
Brody
Brody5mo 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
Dihui5mo ago
that also didnt work
Brody
Brody5mo 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
Dihui5mo ago
4th of april
Brody
Brody5mo ago
year?
Dihui
Dihui5mo ago
2024
Brody
Brody5mo ago
thanks, where are you obtaining this date from?
Dihui
Dihui5mo ago
i have a log that tracks when the bot goes online and that was the last one
Brody
Brody5mo ago
im sorry but thats not what i was asking for
Dihui
Dihui5mo ago
oh what did you mean then
Brody
Brody5mo ago
i would like the timestamp for the last railway build that worked
Dihui
Dihui5mo ago
yea i went back to railway and checked it should be the same
No description
Dihui
Dihui5mo ago
also i did notice the bot started failing while it was still running fine if that helps
Brody
Brody5mo 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
Dihui5mo ago
GitHub
GitHub - MX1D/Guild-Bot-Rewrite
Contribute to MX1D/Guild-Bot-Rewrite development by creating an account on GitHub.
Brody
Brody5mo ago
so quick question, where is the railway.json?
Dihui
Dihui5mo ago
oh this is the original one i added it to mine
Brody
Brody5mo ago
whats different about yours?
Dihui
Dihui5mo ago
it should be the same but all the config is filled in and with the railway.json you sent
Brody
Brody5mo ago
okay sounds good, ill try some different approaches to get this repo to deploy
Solution
Brody
Brody5mo 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
Dihui5mo ago
do i just name the file Dockerfile with no extension?
Brody
Brody5mo ago
correct please use the bookmarklet
Dihui
Dihui5mo ago
oh right sorry
Brody
Brody5mo ago
please send your package.json, not the package.json from the repo you sent me
Dihui
Dihui5mo ago
this is the one
Brody
Brody5mo ago
thanks, just needed to be sure copy the package.json and package-lock.json files from this repo into yours
Dihui
Dihui5mo ago
ok now it successsfully deployed but crashed after
Brody
Brody5mo ago
what error?
Brody
Brody5mo ago
interesting, this is proving to be difficult
Dihui
Dihui5mo ago
it used to also spam errors like this in deploy logs but it never affected anything so i just ignored it
Brody
Brody5mo ago
in your dockerfile change node:14-slim to node:16-slim
Dihui
Dihui5mo ago
yooo that worked! tysm for your time
Brody
Brody5mo ago
happy to help
Want results from more Discord servers?
Add your server