# Gateway-mt: satellite startup-check timeout doesn't stop the process — hangs forever if satellite is down at boot

**URL:** <https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707>\
**Category:** troubleshooting\
**Tags:** gateway-mt, satellites\
**Created:** [September 10, 2026, 6:10am UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707 "2026-09-10T06:10:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kocoten1992](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kocoten1992/32/7819_2.png) [@kocoten1992](https://forum.storj.io/u/kocoten1992)\
**Post date:** [September 10, 2026, 6:10am UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707/1 "2026-09-10T06:10:06Z")

</div>

I notice this while ago in [Tutorial: Edge gateway-mt](https://forum.storj.io/t/tutorial-run-your-own-satellite-part-15-edge-gateway-mt/32020):

```auto
INFO startupcheck/startupcheck.go:45 checking "<sat_address>"
# will stuck at checking satellite step forever..

INFO httpserver/server.go:320 HTTP server started {"addr": "[::]:20010"}
INFO httpserver/server.go:320 HTTPS server started {"addr": "[::]:20011"}

```

Run into this again today, basically, it hang forever if satellite unavailable at startupcheck time, it a problem because the binary still running, but the service is in limbo state.

I ask Claude to debug, it tell me this is a deadlock:

* * *

## The bug:

If a configured satellite is unreachable at startup, the check correctly times out (`--server.startup-check.timeout`, default 30s) — but the process then hangs forever instead of exiting. Never serves, never dies.

**Cause:** `Peer.Run` (`pkg/server/server.go`) uses `errs2.Group`, which waits for _all_ goroutines and never cancels siblings on error. When the startup check fails, `s.server.Run(ctx)` returns, but `s.processor.Run` (accesslogs) keeps running — it only stops via `processor.Close()`, which is only called by `Peer.Close()`, which only runs _after_ `Peer.Run` returns. Deadlock.

* * *

## The fix:

**Fix:** use `errgroup.WithContext` instead, so a failing goroutine cancels the rest:

```auto
func (s *Peer) Run(ctx context.Context) (err error) {
	defer mon.Task()(&ctx)(&err)
	minioOnce.Do(func() { minio.StartMinio(!s.config.InsecureDisableTLS) })

	g, ctx := errgroup.WithContext(ctx)
	g.Go(func() error { <-ctx.Done(); return errs2.IgnoreCanceled(s.processor.Close()) })
	g.Go(s.processor.Run)
	g.Go(func() error { return s.server.Run(ctx) })
	return g.Wait()
}

```

(Same pattern `cmd/gateway-mt/main.go` already uses one level up.) Note: `processor.Close()` could now fire twice — worth checking it’s idempotent.

* * *

I intent to post to github at first, but storj github issue tab is also in limbo state, so…

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [September 10, 2026, 6:12am UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707/2 "2026-09-10T06:12:21Z")

</div>

Could you please submit a PR?

---

<div class="post-metadata">

**Author:** ![kocoten1992](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kocoten1992/32/7819_2.png) [@kocoten1992](https://forum.storj.io/u/kocoten1992)\
**Post date:** [September 10, 2026, 7:01am UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707/3 "2026-09-10T07:01:34Z")

</div>

For some reason, I can’t trigger `gerrit-trigger` bot to run test - and have not set up test infra for storj/edge yet, just gonna leave the PR here ~~`https://review.dev.storj.tools/c/storj/edge/+/23039`~~.

Edit: abandoned this PR, see next comment.

---

<div class="post-metadata">

**Author:** ![kocoten1992](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kocoten1992/32/7819_2.png) [@kocoten1992](https://forum.storj.io/u/kocoten1992)\
**Post date:** [September 10, 2026, 7:56pm UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707/4 "2026-09-10T19:56:25Z")

</div>

Hi, must admit I don’t know golang well enough, this is an opportunity for me to understand it more, new PR [https://review.dev.storj.tools/c/storj/edge/+/23048](https://review.dev.storj.tools/c/storj/edge/+/23048).

---

<div class="post-metadata">

**Author:** ![kocoten1992](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kocoten1992/32/7819_2.png) [@kocoten1992](https://forum.storj.io/u/kocoten1992)\
**Post date:** [September 18, 2026, 11:32pm UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707/5 "2026-09-18T23:32:46Z")

</div>

It is fixed [pkg/server: fix deadlock when the HTTP server fails to start · storj/edge@683c965 · GitHub](https://github.com/storj/edge/commit/683c9656073906417d0122aead6904e6544b9ca0)

---

<div class="post-metadata">

**Author:** ![system](https://storj-s3.bcdn.literatehosting.net/original/2X/f/f4de2608a2c14744db9fd57859b93ec00ed3323d.svg) [@system](https://forum.storj.io/u/system)\
**Post date:** [September 26, 2026, 8:42am UTC](https://forum.storj.io/t/gateway-mt-satellite-startup-check-timeout-doesnt-stop-the-process-hangs-forever-if-satellite-is-down-at-boot/32707/7 "2026-09-26T08:42:03Z")

</div>

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