first time railway user, running into an error when deploying my project from github to railway
my project id is : 5efb133f-468d-4d6d-9c13-1d5a8e75426c
so i pushed my little saas to a github repo of mine, a private one, then connected my accounts together and gave railway access to said repo, when i wait for things to finish setting up i get this message and i honestly am not sure of the origin of the problem, i'm sure its something i did, more like i didn't do, i would greatly appreciate a little assistance
103 Replies
Project ID:
5efb133f-468d-4d6d-9c13-1d5a8e75426c
Mind sharing your build logs using this?
https://bookmarklets.up.railway.app
the build logs ?
crap, wrong link
here:
https://bookmarklets.up.railway.app/log-downloader/
if it's failing during build then yes
here ya go
Thank you, seems like it's failing because you're missing a start command
mind sending your
package.json
file?i'll send in dms is that ok ?
all good
sent
awesome, yea it seems you're just missing all your
scripts
info on your package.json
you'd want to go and add your start and build script in your package.json
file
example:
that way Railway knows what script to run during build and what command to run to actually run your appokay so should i do it to both the front and back-end
because in the back-end i have
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server",
"dev": "nodemon server"
},
and front end
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
That would be correct if you weren't running a development server
react-scripts start
starts a development server as far as I know
You wouldn't want to this since development servers are not meant to be used in productionso if i understand correctly i'm running a development server, which i must not, to be able to use it in railway, could like recommend me and or show me changes that i will need to make, to be able to run, because as far as i understand, i will need to deploy the front-end and back-end seperatly to railway ?
the package.json file i showed you isn't for the front nor backend
i can show you the one for front end
if that would help you help me
You can technically run one on Railway, but it's very not recommended
you can stop running a development server by going to this repo
https://github.com/brody192/create-react-app-starter
and then copying the
Caddyfile
and nixpacks.toml
file from that repo into yoursokay and then add this , push an update and try again
I believe so
thank you so much for the help i'll try it out and see from there
Sounds good, happy to help 🙂
i pushed the front-end alone tried modifying a bunch of stuff but failing
got any idea why
please use the bookmarklet to send the logs
oh ok mb
1 sec
have you taken fragly's advice here https://discord.com/channels/713503345364697088/1198271530770120705/1198288658495713461
i haven't yet, was a lil confusion on how to make it work
simply copy those two files from the linked repo into yours
the jason files ?
please read the message
let me try
okay progress, you have a lot of warnings, did you want to fix them, or ignore them?
fix would be better if possible
okay go ahead and fix them
i don't get why it doesn't respond now
fixed all there is to be fixed
build logs again please
send your package.json please
this is a completely different app
huh ?
literally the backend literally the json file in my github repo that i pushed
before we where talking about a frontend
moved to the back end connected everything with the db, will go back to the front after i manage to fix this
so i can changes the api connection n stuff
please read this docs page https://docs.railway.app/guides/fixing-common-errors
ok
ty
okay back end all done and good, front-end now is confusion again
it runs perfectly locally but not sure why its failing to run in railway
because the warnings are being treated as errors, do you want to fix the warnings or ignore them?
i want to ignore them, how can i do it
set a service variable
CI
to false
can you tell me where can i do it, i have no idea
Error: spawn python ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn python',
path: 'python',
spawnargs: [ 'transcribe.py', '7c193069-2f89-40d4-9cef-d89f1dceeb7e', 'komika' ]
}
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at new NodeError (node:internal/errors:405:5)
at ServerResponse.setHeader (node:_http_outgoing:648:11)
at ServerResponse.header (/app/node_modules/express/lib/response.js:794:10)
at ServerResponse.send (/app/node_modules/express/lib/response.js:174:12)
at ChildProcess.<anonymous> (/app/server.js:79:32)
at ChildProcess.emit (node:events:517:28)
at maybeClose (node:internal/child_process:1098:16)
at Socket.<anonymous> (node:internal/child_process:450:11)
at Socket.emit (node:events:517:28)
at Pipe.<anonymous> (node:net:350:12) {
code: 'ERR_HTTP_HEADERS_SENT'
}
Node.js v18.18.2
npm WARN config production Use
--omit=dev
instead.getting this error when running my program ( btw i'm using python and node.js in the back-end)
please use the bookmarklet
tried
didn't want to
do you have a service open?
occasionally, i'm slightly stupid
add a nixpacks.toml with this in it
like this ?
looks good
it failed entirely now
try with this now
just about the same thing again
can you deploy your code into a new service?
yeah 1 sec
do you think i should add python here ?
no you shouldn’t
okay
same thing
build logs please
do you have the nixpacks toml file in your repo?
no i do not
put it back please
i have these in my python file, pretty sure smth is missing
is moviepy something from pypi?
If they’re underlined locally it means you don’t have them installed locally
true but these logs are coming from railway
i installed them locally but that's irrelevant
they should be in your requirements.txt
like this ?
they need to be on a different lines
okay
and now since you need to get nixpacks to install python modules you will need this nixpacks.toml file instead
again it fails
updated
alr
😫
updated
I still we should move to a Dockerfile based build
okay so, i'll need to go learn how to make a docker file n stuff, put my front-end and back-end in it
and try it that way
frontend and backends still have to be separate
okay
thank you for the help i'll try it out