#ERROR: Error loading ASGI app. Could not import module "main".

29 messages · Page 1 of 1 (latest)

next idolBOT
#

Project ID: ec32bf36-5c45-4445-a18f-b49ee929acf2

maiden leaf
#

ec32bf36-5c45-4445-a18f-b49ee929acf2

inland cloud
#

do you have a repo I could look at

maiden leaf
inland cloud
#

what start command do you use when running this locally

maiden leaf
#
poetry run dev
inland cloud
#

you should not be running anything in dev mode on railway

maiden leaf
#

so in the dockerfile i should change

CMD poetry run dev
#

So i changed the previous line for the following one and it still returns the same error

CMD poetry shell
CMD uvicorn main:app --host 0.0.0.0 --port 8000
inland cloud
#

in your dockerfile you cd into the ta-lib folder, but never leave it, therefor uvicorn cant find your main.py file

#

also you should be using $PORT not 8000, you also dont need an EXPOSE keyword in your dockerfile

#

and you have a railway.json file with a defined start command, that start command overrides the CMD command in your dockerfile

#

let me know when these changes are done and ill take a look at your repo again

maiden leaf
#

I did the changes you suggested and now I'm getting the error "$PORT is not a valid integer"

inland cloud
#

do you get the error in railway logs?

maiden leaf
#

yes

inland cloud
#

show me your service variables please

maiden leaf
inland cloud
#

just go back to using 8000 then

#

that will require you to add a service variable PORT = 8000

maiden leaf
#

should i change $PORT for 8000 in railway.json too?

inland cloud
#

lol where else do you have $PORT

maiden leaf
#

nowhere

inland cloud
#

bruh

maiden leaf
#

but i thought you meant creating a service variable PORT = 8000

#

my bad

inland cloud
#

and i also said use 8000 instead of $PORT in the railway.json

maiden leaf
#

back to "ERROR: Error loading ASGI app. Could not import module "main"."