Unable to start my python app after a successful build

Hello,
I’m new to render and I tried to deploy a simple todo app to test it. The source code is here.
I create a new web service using the UI and I got this from the log (this is just the end)

Oct 2 08:45:13 PM    • Installing asyncpg (0.26.0)
Oct 2 08:45:13 PM    • Installing fastapi (0.85.0)
Oct 2 08:45:13 PM    • Installing httpie (3.2.1)
Oct 2 08:45:13 PM    • Installing hypercorn (0.14.3)
Oct 2 08:45:13 PM    • Installing tortoise-orm (0.19.2)
Oct 2 08:45:14 PM  
Oct 2 08:45:14 PM  Installing the current project: render_demo (0.1.0)
Oct 2 08:45:14 PM  ==> Generating container image from build. This may take a few minutes...
Oct 2 08:46:58 PM  ==> Uploading build...
Oct 2 08:47:46 PM  ==> Starting service with 'hypercorn render_demo.main:app'
Oct 2 08:47:56 PM  [2022-10-02 18:47:56 +0000] [54] [INFO] Running on http://127.0.0.1:8000 (CTRL + C to quit)

My start command is hypercorn render_demo.main:app and it works on my local machine.

I have any idea what goes wrong here, if somebody can help me, it will be great.

Also, I tried to run the web service in Oregon and Ohio regions without success.

Maybe it seems to be trying to run on localhost: ‘Running on http://127.0.0.1:8000

It should be running on the render domain

Maybe try configuring the --bind in your start command (Configuring — Hypercorn 0.13.2+dev documentation)

Hi @julian, thanks for the help.
Do you know which host and port I should bind?

Try 443:

‘Only HTTPS requests (port 443) are accepted. HTTP requests (port 80) are automatically redirected to HTTPS’.- Web Services | Render · Cloud Hosting for Developers

Thanks @julian for the suggestion but I have a permission error

Oct 4 11:58:11 AM  PermissionError: [Errno 13] Permission denied

Also I saw this message

Waiting for health check to return a successful response code at: http://kevintodo.onrender.com:10000/health

And I tried the port 10000 but again, I have the same issue :confused:

Hi there,
You can’t use port 443 or 80. You don’t need to specify a port as we should locate the port it runs on when it first boots - can you try without specifying a port?

John B

Hi @John_B thanks for the contribution but I don’t understand what you mean. Even if I don’t specify a port, hypercorn by default will run on port 8000.

Honestly, I didn’t imagine it would be so complicated to deploy a python application, I’m disappointed.
There should be examples of async frameworks in the documentation

Hi there,
If it runs on port 8000 then we should find that as part of the deployment process and wire it up correctly, if all else fails run it on 10000 and set an environment variable PORT=10000 to prevent any detection taking place,

Regards,

John B

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.