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
No description
103 Replies
Percy
Percy5mo ago
Project ID: 5efb133f-468d-4d6d-9c13-1d5a8e75426c
Fragly
Fragly5mo ago
Mind sharing your build logs using this? https://bookmarklets.up.railway.app
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
No description
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
the build logs ?
Fragly
Fragly5mo ago
crap, wrong link here: https://bookmarklets.up.railway.app/log-downloader/ if it's failing during build then yes
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
here ya go
Fragly
Fragly5mo ago
Thank you, seems like it's failing because you're missing a start command mind sending your package.json file?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i'll send in dms is that ok ?
Fragly
Fragly5mo ago
all good
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
sent
Fragly
Fragly5mo ago
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:
"scripts": {
"start": "node ./dist/index.js",
"build": "tsc",
},
"scripts": {
"start": "node ./dist/index.js",
"build": "tsc",
},
that way Railway knows what script to run during build and what command to run to actually run your app
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
okay 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" },
Fragly
Fragly5mo ago
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 production
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
so 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
Fragly
Fragly5mo ago
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 yours
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
okay and then add this , push an update and try again
Fragly
Fragly5mo ago
I believe so
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
thank you so much for the help i'll try it out and see from there
Fragly
Fragly5mo ago
Sounds good, happy to help 🙂
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago


[Region: us-west1]

==============

Using Nixpacks

==============


context: 34f8a5434b19b8ba52224297b5ebb77b



╔════════ Nixpacks v1.20.0 ═══════╗

║ setup │ nodejs_18, npm-9_x ║

║─────────────────────────────────║

║ install │ npm ci ║

║─────────────────────────────────║

║ build │ npm run build ║

║─────────────────────────────────║

║ start │ npm run start ║

╚═════════════════════════════════╝





#0 building with "default" instance using docker driver



#1 [internal] load .dockerignore

#1 transferring context: 2B done

#1 DONE 0.1s



#2 [internal] load build definition from Dockerfile

#2 transferring dockerfile: 1.95kB done

#2 DONE 0.1s





#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1702339400



#3 DONE 0.2s



#4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1702339400@sha256:1a9c1eed040aacf8f898be048210ef2d3366b1228373c4e6818362bb75611b32

#4 DONE 0.0s



#5 [internal] load build context



#5 transferring context: 84.85MB 0.5s done

#5 DONE 0.6s



#6 [stage-0 3/10] COPY .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix

#6 CACHED



#7 [stage-0 2/10] WORKDIR /app/

#7 CACHED



#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d

#8 CACHED



#9 [stage-0 5/10] COPY . /app/.



#9 DONE 0.2s



#10 [stage-0 6/10] RUN --mount=type=cache,id=s/26d18227-e790-4690-a20c-89922ed1ca0c-/root/npm,target=/root/.npm npm ci



#10 0.853 npm WARN config production Use `--omit=dev` instead.



#10 6.337 npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser


[Region: us-west1]

==============

Using Nixpacks

==============


context: 34f8a5434b19b8ba52224297b5ebb77b



╔════════ Nixpacks v1.20.0 ═══════╗

║ setup │ nodejs_18, npm-9_x ║

║─────────────────────────────────║

║ install │ npm ci ║

║─────────────────────────────────║

║ build │ npm run build ║

║─────────────────────────────────║

║ start │ npm run start ║

╚═════════════════════════════════╝





#0 building with "default" instance using docker driver



#1 [internal] load .dockerignore

#1 transferring context: 2B done

#1 DONE 0.1s



#2 [internal] load build definition from Dockerfile

#2 transferring dockerfile: 1.95kB done

#2 DONE 0.1s





#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1702339400



#3 DONE 0.2s



#4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1702339400@sha256:1a9c1eed040aacf8f898be048210ef2d3366b1228373c4e6818362bb75611b32

#4 DONE 0.0s



#5 [internal] load build context



#5 transferring context: 84.85MB 0.5s done

#5 DONE 0.6s



#6 [stage-0 3/10] COPY .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix

#6 CACHED



#7 [stage-0 2/10] WORKDIR /app/

#7 CACHED



#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d

#8 CACHED



#9 [stage-0 5/10] COPY . /app/.



#9 DONE 0.2s



#10 [stage-0 6/10] RUN --mount=type=cache,id=s/26d18227-e790-4690-a20c-89922ed1ca0c-/root/npm,target=/root/.npm npm ci



#10 0.853 npm WARN config production Use `--omit=dev` instead.



#10 6.337 npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
No description
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i pushed the front-end alone tried modifying a bunch of stuff but failing got any idea why
Brody
Brody5mo ago
please use the bookmarklet to send the logs
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
oh ok mb 1 sec
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i haven't yet, was a lil confusion on how to make it work
Brody
Brody5mo ago
simply copy those two files from the linked repo into yours
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
the jason files ?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
No description
Brody
Brody5mo ago
please read the message
No description
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
let me try
Brody
Brody5mo ago
okay progress, you have a lot of warnings, did you want to fix them, or ignore them?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
fix would be better if possible
Brody
Brody5mo ago
okay go ahead and fix them
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i don't get why it doesn't respond now
No description
No description
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
fixed all there is to be fixed
Brody
Brody5mo ago
build logs again please
Brody
Brody5mo ago
send your package.json please
Brody
Brody5mo ago
this is a completely different app
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
huh ? literally the backend literally the json file in my github repo that i pushed
Brody
Brody5mo ago
before we where talking about a frontend
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
No description
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
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
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
ok ty okay back end all done and good, front-end now is confusion again
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
it runs perfectly locally but not sure why its failing to run in railway
Brody
Brody5mo ago
because the warnings are being treated as errors, do you want to fix the warnings or ignore them?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i want to ignore them, how can i do it
Brody
Brody5mo ago
set a service variable CI to false
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
can you tell me where can i do it, i have no idea
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
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.
No description
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
getting this error when running my program ( btw i'm using python and node.js in the back-end)
Brody
Brody5mo ago
please use the bookmarklet
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
tried didn't want to
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
No description
Brody
Brody5mo ago
do you have a service open?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
occasionally, i'm slightly stupid
Brody
Brody5mo ago
add a nixpacks.toml with this in it
[phases.setup]
nixPkgs = ['...', 'python3']
[phases.setup]
nixPkgs = ['...', 'python3']
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
like this ?
No description
Brody
Brody5mo ago
looks good
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
it failed entirely now
Brody
Brody5mo ago
providers = ['node']

[phases.setup]
nixPkgs = ['...', 'python3']
providers = ['node']

[phases.setup]
nixPkgs = ['...', 'python3']
try with this now
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
just about the same thing again
Brody
Brody5mo ago
can you deploy your code into a new service?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
yeah 1 sec
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
do you think i should add python here ?
No description
Brody
Brody5mo ago
no you shouldn’t
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
okay same thing
Brody
Brody5mo ago
build logs please
Brody
Brody5mo ago
do you have the nixpacks toml file in your repo?
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
no i do not
Brody
Brody5mo ago
put it back please
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i have these in my python file, pretty sure smth is missing
No description
Brody
Brody5mo ago
is moviepy something from pypi?
Adam
Adam5mo ago
If they’re underlined locally it means you don’t have them installed locally
Brody
Brody5mo ago
true but these logs are coming from railway
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
i installed them locally but that's irrelevant
Adam
Adam5mo ago
they should be in your requirements.txt
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
like this ?
No description
Brody
Brody5mo ago
they need to be on a different lines
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
okay
Brody
Brody5mo ago
and now since you need to get nixpacks to install python modules you will need this nixpacks.toml file instead
providers = ['node']

[phases.setup]
nixPkgs = ['...', 'python3', 'python311Packages.pip']

[phases.python_install]
dependsOn = ['setup']
cmds = ['pip install -r requirements.txt']
providers = ['node']

[phases.setup]
nixPkgs = ['...', 'python3', 'python311Packages.pip']

[phases.python_install]
dependsOn = ['setup']
cmds = ['pip install -r requirements.txt']
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
again it fails
Brody
Brody5mo ago
updated
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
alr
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
😫
Brody
Brody5mo ago
updated
Brody
Brody5mo ago
I still we should move to a Dockerfile based build
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
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
Brody
Brody5mo ago
frontend and backends still have to be separate
᲼᲼᲼᲼
᲼᲼᲼᲼5mo ago
okay thank you for the help i'll try it out