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

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

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