NetSendo
Platform Updates

NetSendo v2.11.1: No More 502 Errors After Docker Updates

NetSendo Team5 min read

You run docker compose pull and docker compose up -d, the new containers start, and everything looks fine. Then you open your dashboard and get a 502 Bad Gateway. The update itself went through. The problem was that nginx was still sending requests to an address the app container no longer had.

On the day the 2.11.0 update rolled out, this hit 7 of 16 hosted NetSendo installations. NetSendo v2.11.1 fixes it at the source. The webserver now restarts automatically every time Docker Compose recreates the app container, so you no longer have to restart it by hand after an update.

TL;DR: NetSendo v2.11.1 adds restart: true to the webserver's dependency on the app in docker-compose.yml. With Docker Compose 2.17 or newer, nginx restarts whenever the app container is recreated, so you won't get 502 errors after updates. If you keep your own compose file, run docker compose restart webserver after each update. podman-compose accepts the setting but ignores it.

🚀 What's New in v2.11.1

The root cause: nginx resolves the app address only once

NetSendo's webserver passes PHP requests to the app container with a directive like fastcgi_pass app:9000. nginx resolves the hostname app to an IP address once, when it starts, and keeps using that IP until it restarts.

When you run docker compose up -d with a new image, Compose recreates the app container, and the new container often gets a different IP on the Docker network. nginx still has the old address, so every request fails with:

connect() failed (111) while connecting to upstream

Think of it like a courier who copied down your street address once and never checks it again. You move to a new house, and every parcel still goes to the old one.

The fix: restart the webserver along with the app

The long form of depends_on in Docker Compose accepts a restart option. When it's set to true, Compose restarts the dependent service (the webserver) every time it recreates or restarts the dependency (the app). The relevant part looks like this:

services:
  webserver:
    # ...
    depends_on:
      app:
        condition: service_started
        restart: true

When nginx restarts, it looks up app again and gets the new address, so requests reach the new container right away.

🔄

Automatic webserver restart

nginx restarts whenever Compose recreates the app container.

🛡️

No more stale upstream

nginx can't keep sending traffic to an old container IP.

🐳

Built into Docker Compose

Uses a standard Compose option (2.17+). No extra scripts or sidecars.

ℹ️ Note: This option needs Docker Compose 2.17 or newer. podman-compose accepts it but doesn't act on it, so Podman users still have to restart the webserver by hand.

💼 Who Benefits From This Fix

  • ✅ No 502 errors after routine updates
  • ✅ No manual step after docker compose up -d
  • ✅ Safer unattended and scheduled updates
  • ✅ Fewer "site is down" support tickets
🛒

E-commerce: keep forms and tracking online

A 502 after an update means your signup forms, preference pages and tracking links stop responding. If that happens during a sale, you lose:

  • New subscribers from checkout opt-ins
  • Click data from abandoned-cart emails
  • Unsubscribe requests, which can be a compliance risk
🚀

SaaS: protect onboarding flows

If your app calls NetSendo's API when a user signs up, a stale nginx upstream makes those calls fail without anyone noticing. Onboarding emails don't go out, and new users get a weaker first impression. With v2.11.1, the API is reachable as soon as the new container is up.

🏢

Agencies: update many installations at once

If you run NetSendo for several clients, a 7-in-16 failure rate means checking and restarting servers one by one. With automatic webserver restarts, you can script updates across all of them without that manual pass.

🛠️ Step-by-Step: Upgrading to v2.11.1

  1. Check your Compose version

    Run docker compose version. You need 2.17 or newer for restart: true to work. The old standalone docker-compose (v1) binary doesn't support it.

  2. Update your compose file

    If you use the stock docker-compose.yml from the repository, pull the v2.11.1 version. If you keep a customized file, add restart: true under the webserver's depends_on → app entry, as shown above.

  3. Pull and recreate
    docker compose pull
    docker compose up -d
  4. Verify

    Run docker compose ps and check that the webserver's uptime matches the app's. Then load your dashboard. If you still see 502s, check docker compose logs webserver for "connect() failed (111)".

  5. Fallback for custom setups and Podman

    If you can't use the new option, restart the webserver after every update, as described in README → Updates:

    docker compose restart webserver
⚠️ Common pitfall: Merging only the new image tag into a custom compose file won't fix the problem. The fix is in the compose configuration, not in the image, so you need the restart: true line as well.

🎯 Expert Tips

1
Add a health check after each update

End your update script with a check like curl -fsS https://your-domain/ > /dev/null. If it fails, the script fails, so you find a broken update right away instead of hearing about it from users.

2
Keep your custom compose file close to upstream

Put your local changes in a docker-compose.override.yml instead of editing the main file. That way, fixes like this one reach you when you pull the main file.

3
Podman users: script the restart

Since podman-compose ignores restart: true, add the webserver restart to the end of your update script.

4
Update during low traffic

Even with this fix, the app is briefly unavailable while it's recreated. Schedule updates outside your campaign send windows.

✅ Conclusion

v2.11.1 is a small release that fixes a real problem. Because nginx looked up the app's address only once, recreating the app container after an update could leave the webserver sending traffic to an address that no longer existed. With restart: true in docker-compose.yml, Docker Compose 2.17+ now restarts the webserver together with the app.

Here's what to do:

  • Make sure you're on Docker Compose 2.17 or newer.
  • Use the updated compose file, or add restart: true to your own.
  • If you use a custom compose file or Podman, run docker compose restart webserver after each update.

For setup details, see the documentation. To connect NetSendo with other tools, browse the integrations.

Ready to Update?

Upgrade to NetSendo v2.11.1 for updates without 502 errors.

#docker#docker-compose#nginx#bugfix#self-hosted#updates
Share