Help for a hacakthon
kiankyars
HOBBYOP

6 months ago

I'm in hackathon ending very soon, and railway is not working!
https://github.com/kiankyars/ned
is the repo, I'm getting this error:
Please let me know what other information you need to help me.

Solved$10 Bounty

30 Replies

kiankyars
HOBBYOP

6 months ago

af4f16fe-2a73-4c35-bc22-faa9139ab764


brody
EMPLOYEE

6 months ago

Help for a hacakthon


kiankyars
HOBBYOP

6 months ago

It's literally just fastapi, I use
cd backend
uv sync
uv run uvicorn app:app --reload

to run it locally, but it's not working to deploy

1401579965601808400


adam
MODERATOR

6 months ago

Your app is not responding to the healthcheck. Is it listening on the PORT environment variable?


kiankyars
HOBBYOP

6 months ago

How could I check?


adam
MODERATOR

6 months ago

Railway has docs for FastAPI here


kiankyars
HOBBYOP

6 months ago

I followed this

>
Deploy From a GitHub Repo

To deploy a FastAPI app on Railway directly from GitHub, follow the steps below:

Fork the basic FastAPI GitHub repo.
If you already have a GitHub repo you want to deploy, you can skip this step.
Create a New Project.
Click Deploy from GitHub repo.
Select the fastapi or your own GitHub repo.
Railway requires a valid GitHub account to be linked. If your Railway account isn't associated with one, you will be prompted to link it.
Click Deploy Now.


kiankyars
HOBBYOP

6 months ago

no avail


adam
MODERATOR

6 months ago

The best way forward here would be to clone the template repo and compare your setup and configuration. Copying over the railway.json should fix your issue


kiankyars
HOBBYOP

6 months ago

@Adam I have a backend directory though, I assume I have to use that as the root directory of the repository. And is it okay if I have a py project toml instead of a requirement txt? and does it have to be in backend?


kiankyars
HOBBYOP

6 months ago

someone keeps deleting my message in chit chat


adam
MODERATOR

6 months ago

Put the config files in whichever folder your app is served from. If it's backend, then put the files in the backend folder. You will need to change your root folder setting in Railway to ensure your project is deployed from the backend folder


kiankyars
HOBBYOP

6 months ago

so pyproject toml as well? or just railway.json?


adam
MODERATOR

6 months ago

both


kiankyars
HOBBYOP

6 months ago

this repo is much different than mine, can you please look at my backend directory?


adam
MODERATOR

6 months ago

Please create a PORT environment variable with a value of 8000


kiankyars
HOBBYOP

6 months ago

done thanks, trying now


kiankyars
HOBBYOP

6 months ago

@Adam no luck

1401587429239947500


kiankyars
HOBBYOP

6 months ago

with this json file

{
  "$schema": "https://railway.com/railway.schema.json",
  "build": {
    "builder": "NIXPACKS"
  },
  "deploy": {
    "runtime": "V2",
    "numReplicas": 1,
    "startCommand": "uv run uvicorn app:app --host 0.0.0.0 --port 8000",
    "healthcheckPath": "/health",
    "sleepApplication": false,
    "multiRegionConfig": {
      "us-west2": {
        "numReplicas": 1
      }
    },
    "restartPolicyType": "ON_FAILURE",
    "healthcheckTimeout": 300,
    "restartPolicyMaxRetries": 1
  }
}

adam
MODERATOR

6 months ago

Please remove your pyproject.toml and replace it with a requirements.txt, then use the Railway.json in the template with no changes


adam
MODERATOR

6 months ago

Add hypercorn to the requirements.txt as well:

hypercorn==0.14.4


kiankyars
HOBBYOP

6 months ago

thanks, doing now


kiankyars
HOBBYOP

6 months ago

🤞


kiankyars
HOBBYOP

6 months ago

I got everything escept main:app, I changed it to app:app, since I have app.py wrapper


kiankyars
HOBBYOP

6 months ago

I'm praying to god this works


kiankyars
HOBBYOP

6 months ago

@Adam now' im getting errors on deploy side, it's werid since running it locally takes 1 second


kiankyars
HOBBYOP

6 months ago

hold on!


kiankyars
HOBBYOP

6 months ago

I think it's fixed


adam
MODERATOR

6 months ago

Glad to hear it!


adam
MODERATOR

6 months ago

!s


Status changed to Solved adam 6 months ago


Loading...