Autoscale deployment failing - healthcheck probing wrong port (1104)

My app (Python/Flask/Gunicorn) has been failing to deploy for 24+ hours. The healthcheck keeps trying port 1104, which I never configured. My .replit has no [[ports]] section, app binds to $PORT correctly, /health returns 200. This was deploying fine before. Support ticket [WER9G4-4JXLP] was escalated but no response yet. My app needs updates and I’m totally stuck.

Has anyone gotten around this? seems like a replit infra issue?? thank you

2 Likes

I found this in my deployment logs: forwarding local port 5000 to external port 80 (mapped as 1104). This came from the old [[ports]] section which has since
been removed. It appears Replit’s deployment has cached this stale port mapping. I’ve asked if engineering clear/reprovision the deployment to flush this cached config. I am getting no replies tho. this has not been a fun 24 hours.

1 Like

@ZergGirl is going to be your best bet at bumping this forward friend.

Sounds like a job for support engineering.

Until then check your port configuration files and see if you can’t fix it manually.

  1. Save a safe copy
  2. Update all packages via shell just in case
  3. Manually make port configuration changes
  4. Test changes
  5. Apply patches
  6. Keep safe copy and version control it labeled with the bug if you ever need to reproduce it and isolate the issue

Sloppy Joe says:

“Most likely, this is a Replit infra change combined with a missing [[ports]] section. In older deployments, $PORT binding may have been enough. Now the platform seems to require explicit port mapping in .replit for healthchecks.“

### 1. Add a `[[ports]]` section to your `.replit`

Even if your app already binds to `$PORT`, Replit sometimes needs this explicit mapping for healthchecks. Your `.replit` could look like this:

```toml

run = “gunicorn main:app --bind 0.0.0.0:$PORT”

[[ports]]

port = 0

protocol = “http”

```

**Explanation:**

- `port = 0` tells Replit to automatically assign the correct runtime port (usually what `$PORT` provides).

- `protocol = “http”` ensures the healthcheck knows it’s HTTP, so it checks `/health`.

- Your `run` line stays the same, using `$PORT`.

-–

### 2. Optional: specify the healthcheck endpoint

If you want to be extra explicit, you can also add:

```toml

[healthcheck]

path = “/health”

```

This makes sure Replit checks the correct route instead of guessing.

-–

### 3. Redeploy

- Save the `.replit` changes.

- Stop the current deployment (if running).

- Start a fresh deploy.

- The healthcheck should now hit the correct port instead of `1104`.

-–

:light_bulb: **Why this works:**

Replit’s new deployment system sometimes defaults to a “random” port for healthchecks if there’s no `[[ports]]` section. Adding it aligns the container port with your app’s `$PORT`.

-–

Trial and error

Wait for @ZergGirl or @FranciscoCM

Blow up the thread with frustration if you must.

Welcome to the forum by the way!

thanks so much! hoping to hear back. Its frustrating to have support just go silent . Quinn is so responsive at the start but on escalation it goes dead

1 Like

i just logged a new fresh ticket with what action is required in the hope support can help and not wait for escalation. :frowning:

1 Like

That’s a valid reflection of how bottlenecks function in the industry.

Ping to one person and wait for the next.

it’s funny I keep saying it’s like, “we want things on NY time lines. Replits delivering on, southern time and at best west coast time.”

This is why I see the need for an additional human layer and think in the next few years there might be a pop in demand for mid tier to almost senior tier engineers and developers.

Humans to man the machine.

Human make machine go boom.

This doesn’t help you at all. I’m just deflecting in hopes that it helps you de-escalate your anxiety and frustration.

One of them will come and help you push it to the top

ok so I remixed to a brand new repl and the same port 1104 error occurs,
proving this is a platform-level issue, not a cached config problem. (i think )

Did you pull out all the port configuration files and see if they had any janky code?

It might be worth a few bucks to ask the agent to make a document of your entire codebase and make the prompt specific enough around port and caching.

Before spending money on the agent though.

1.) Spend time thinking the prompt out.

2.) Ask your outside Sloppy Joe (AI) to make the prompt the way it would want it.

3.) refine it more and make sure it’s explicitly designed to give you a solid audit on your configuration files.

After this I’d take that prompt and load it in the agent.

The Replit Md is my worst enemy. It justs like to do whatever and changes adds things it shouldn’t and the agent just does not care or seem to address it even when asked.

You always have to manually sift the codebase and make sure the Sloppy Joe knows exactly what you want. Then tripple check the Replit Md and why the AI decided to use what it used in th Replit Md sometimes it’s on drugs. Sometimes you get Elon musk.

It depends

If this fails then ask it to wipe out all port configuration and rewire it. Caution this could become expensive.

If time is an issue and money is not then give it a whack. It’s hard to know without access to your projects. I don’t have the authority to do that safely.

@ZergGirl or @FranciscoCM are the best options for finding the ones with the authority to flag the right staff reiterate your work order number in your next comment for them to grab quicker

thanks - there is no code hidden anywhere. quinn has replied again agreeing its likley platfomr level but same answer of they have high demand please be patient.

1 Like

Yeah I expected an influx of distraught people with the new upgrade.

If you need to vent or throw out ideas and spit ball while you wait feel free to tag me or anyone else that’s typically online

You caught me on a small down period where I was reading forum posts and gather some documentation lol

makes sense. must be bigger fires elsewhere

1 Like

Yeah somewhere out there is someone with an enterprise account really flexing lol jk jk jk you know what I mean though.

I find taking a screenshot of the apps landing page and blowing it up with the animation feature helps to deflect from the pain.

Mind you that could still cost .5-3 bucks lol

i’m coding with claude opus right now (in replit shell) on max plan. its been amazing and 80% cheaper. pretty sure replit use 4.5 too ? that may have changed yesterday

Their agent employs a combination of models and selects based on the specific task at hand. Each model possesses unique capabilities; some excel in tasks like Excel, while others, such as Claude, are more adept at handling different tasks.

The Replit agent emerges as the culmination of engineering teams, seamlessly integrating their agent services into a single cohesive entity, which is the Replit agent, in essence. If that makes sense.

So, you pay to have the best of all of them in a very centralized Vibe Centric IDE basically. Which is why I’m cutting out all of them and attacking every project like an engineer rather than vibe coder. Really stretch out my subscription.

Then for messaging you can just use the free tier models honestly.

I’ll still keep GitHub pro myself the copilot is nice.

My thought is only pay for agent costs on projects once you’ve planned and mapped… I digress though.

I had no authority too.. I’m not trying to posture. It’s just what my thoughts are

i dunno . i racked up big costs. i was using gem pro 3 to help arhictect design with detailed replit agent prompts and my bill was going up to $50 a day

I attempted this on one of my projects and immediately realized the significant cost and potential for it. This is why I personally believe that front-loading the costs of design is counterproductive unless you have several years or even a lifetime of training under your belt.

However, once you have that training, I wager that the prompts you submit to an agent costing $50 will yield results comparable to what we achieve now, which costs nearly $500 and still has several issues like this.

Therefore, I believe (and again, take this with a grain of salt, as different strokes for different folks) that if you approach your design architecture and framework from the perspective of an engineer rather than a computer scientist, you’ll be much more cost-effective.

By doing the bulk of that work manually upfront, you not only learn for the next time but also begin to develop your own style and refine it over 40+ years. It’s highly counterproductive to spend hundreds on just a sound design that you could have done at a $50 prompt rate twice a month.

Then, approach the remaining work just like you are the 15-person team that keeps it afloat.

idk I’m rambling. I just know if users took the whole month of their subscription and planned methodically and pretend they are the engineers then over time you are learning on the job. Even if it’s not a paid job. These are transferable skills that transfer into formal paid jobs…

Anyways I’ll shut up lol

Okay, here is the issue. It was with my code! I hope this helps others who may hit this. I should point out Replit support did get back to me (I did have to really push though).

Issue:
My before_request handler was using request.headers.get(‘X-Forwarded-Proto’, ‘http’), which defaults missing headers to ‘http’. When Replit’s internal health checker hits http://127.0.0.1:1104/ directly (no proxy, no X-Forwarded-Proto header), the middleware treated it as an external HTTP request and returned a 301 redirect to HTTPS. The health checker followed the redirect and tried HTTPS against Gunicorn, which only serves HTTP, causing the “http: server gave HTTP response to HTTPS client” error loop.

Fix: Changed to request.headers.get(‘X-Forwarded-Proto’) (no default). Internal health check requests with no header now pass through. External requests through the load balancer with X-Forwarded-Proto: http still get redirected to HTTPS as intended.

Separate issue: [[ports]] keeps being auto-added to .replit during deploy. While this wasn’t the primary cause, it would be helpful to know if there’s a way to prevent autoscale deployments from injecting [[ports]] automatically. (Waiting for a reply on this)

1 Like

I’ll be quite now because if I had a nickel everytime the Replit Md changed… smh