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
Percy11mo ago
Project ID: 5efb133f-468d-4d6d-9c13-1d5a8e75426c
Fragly
Fragly11mo ago
Mind sharing your build logs using this? https://bookmarklets.up.railway.app
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
No description
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
the build logs ?
Fragly
Fragly11mo ago
crap, wrong link here: https://bookmarklets.up.railway.app/log-downloader/ if it's failing during build then yes
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
here ya go
Fragly
Fragly11mo ago
Thank you, seems like it's failing because you're missing a start command mind sending your package.json file?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i'll send in dms is that ok ?
Fragly
Fragly11mo ago
all good
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
sent
Fragly
Fragly11mo 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
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo 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
Fragly11mo 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
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo 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
Fragly11mo 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
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
okay and then add this , push an update and try again
Fragly
Fragly11mo ago
I believe so
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
thank you so much for the help i'll try it out and see from there
Fragly
Fragly11mo ago
Sounds good, happy to help 🙂
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo 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 [email protected]: 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 [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
No description
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i pushed the front-end alone tried modifying a bunch of stuff but failing got any idea why
Brody
Brody11mo ago
please use the bookmarklet to send the logs
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
oh ok mb 1 sec
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i haven't yet, was a lil confusion on how to make it work
Brody
Brody11mo ago
simply copy those two files from the linked repo into yours
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
the jason files ?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
No description
Brody
Brody11mo ago
please read the message
No description
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
let me try
Brody
Brody11mo ago
okay progress, you have a lot of warnings, did you want to fix them, or ignore them?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
fix would be better if possible
Brody
Brody11mo ago
okay go ahead and fix them
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i don't get why it doesn't respond now
No description
No description
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
fixed all there is to be fixed
Brody
Brody11mo ago
build logs again please
Brody
Brody11mo ago
send your package.json please
Brody
Brody11mo ago
this is a completely different app
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
huh ? literally the backend literally the json file in my github repo that i pushed
Brody
Brody11mo ago
before we where talking about a frontend
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
No description
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo 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
Brody
Brody11mo ago
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
ok ty okay back end all done and good, front-end now is confusion again
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
it runs perfectly locally but not sure why its failing to run in railway
Brody
Brody11mo ago
because the warnings are being treated as errors, do you want to fix the warnings or ignore them?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i want to ignore them, how can i do it
Brody
Brody11mo ago
set a service variable CI to false
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
can you tell me where can i do it, i have no idea
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo 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
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
getting this error when running my program ( btw i'm using python and node.js in the back-end)
Brody
Brody11mo ago
please use the bookmarklet
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
tried didn't want to
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
No description
Brody
Brody11mo ago
do you have a service open?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
occasionally, i'm slightly stupid
Brody
Brody11mo ago
add a nixpacks.toml with this in it
[phases.setup]
nixPkgs = ['...', 'python3']
[phases.setup]
nixPkgs = ['...', 'python3']
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
like this ?
No description
Brody
Brody11mo ago
looks good
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
it failed entirely now
Brody
Brody11mo ago
providers = ['node']

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

[phases.setup]
nixPkgs = ['...', 'python3']
try with this now
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
just about the same thing again
Brody
Brody11mo ago
can you deploy your code into a new service?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
yeah 1 sec
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
do you think i should add python here ?
No description
Brody
Brody11mo ago
no you shouldn’t
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
okay same thing
Brody
Brody11mo ago
build logs please
Brody
Brody11mo ago
do you have the nixpacks toml file in your repo?
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
no i do not
Brody
Brody11mo ago
put it back please
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i have these in my python file, pretty sure smth is missing
No description
Brody
Brody11mo ago
is moviepy something from pypi?
Adam
Adam11mo ago
If they’re underlined locally it means you don’t have them installed locally
Brody
Brody11mo ago
true but these logs are coming from railway
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
i installed them locally but that's irrelevant
Adam
Adam11mo ago
they should be in your requirements.txt
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
like this ?
No description
Brody
Brody11mo ago
they need to be on a different lines
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
okay
Brody
Brody11mo 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']
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
again it fails
Brody
Brody11mo ago
updated
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
alr
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
😫
Brody
Brody11mo ago
updated
Brody
Brody11mo ago
I still we should move to a Dockerfile based build
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo 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
Brody11mo ago
frontend and backends still have to be separate
᲼᲼᲼᲼
᲼᲼᲼᲼OP11mo ago
okay thank you for the help i'll try it out
Want results from more Discord servers?
Add your server