Getting an error when deploying Flask App

I can run the app in development but getting an error when I try to deploy. No errors message in the log but the deployment status asked me to post it here.
error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on and a staff member will take a look. - 2023-10-07T19:56:56.794Z
Repl link/Link to where the bug appears:
Screenshots, links, or other helpful context:

code snippet

Log Error: hostingpid1: an open port was not detected

I am having same issue and its been happening for days, deployment issues should please be resolved

Also, tried adding the port 5000 or 8080 directly to the .replit file. Doesn’t work for either.


Could you answer the following:

  1. Does their Repl work in the workspace (as stated in the interface)
  2. Is their app using the same run command that it is in the workspace

You can also take a look at our Deployments guide here: for any additional help.

1 Like
  1. Yes, it works in development workspace.
  2. The command in the .replit file is run = "python3", so I believe yes.
    Console shows the following:
* Serving Flask app 'main'
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (
 * Running on
 * Running on

This has been posted for more than a week. No help?


You’ll need to expose to port 80, which is the only open port. Once you do that, it should be OK. Please let us know if you have any further questions.

How do you expose port 80?

Set line 34 to

port = 80

Looks like it’s working now! To address the earlier comments, it is not necessary to listen only on port 80 – any port will do, as long as the listening address is

1 Like

the issue has been resolved

Hey @GRANDS-ROISROIS. It’s great to hear that you’ve fixed your problem, but please provide an explanation to how you did, so that other people who have the same problem know the solution.