# Can't make requests inside container

**URL:** <https://community.fly.io/t/cant-make-requests-inside-container/11158>\
**Category:** Questions / Help\
**Tags:** login-only\
**Created:** [March 2, 2023, 2:52am UTC](https://community.fly.io/t/cant-make-requests-inside-container/11158 "2023-03-02T02:52:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjavicente](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/benjavicente/32/9706_2.png) [@benjavicente](https://community.fly.io/u/benjavicente)\
**Post date:** [March 2, 2023, 2:52am UTC](https://community.fly.io/t/cant-make-requests-inside-container/11158/1 "2023-03-02T02:52:16Z")

</div>

Hi, a deployment (in `scl`) that I had working for months suddenly stopped working (near the [SCL incident](https://status.flyio.net/incidents/fssb3p7g7ycq)). I tried multiple suggestions that were whitened in this forum with no luck.

In short, inside the container (with `fly ssh console`), the command `wget http://example.com` hangs indefinitely, like if the container couldn’t make requests. Health checks and auxiliary logging shows that the real program can’t connect to an external service after the build, so health checks fails.

This application is an adaptation of the [_Host for free on Fly.io_ discussion over at PocketBase](https://github.com/pocketbase/pocketbase/discussions/537). The `fly.toml`file is like:

```toml
app = "..."
kill_signal = "SIGINT"
kill_timeout = 5

[mounts]
  destination = "/pb/pb_data"
  source = "pb_data"

[[services]]
  internal_port = 80
  protocol = "tcp"

  [services.concurrency]
     hard_limit = 25
     soft_limit = 20
     type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

[[services]]
  internal_port = 3000
  protocol = "tcp"

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 8000

```

The `Dockerfile` runs 2 processes in`./docker-entrypoint.sh` like:

```bash
/pb/pocketbase serve "--http=0.0.0.0:3000" --automigrate &
PORT=80 DB_URL="http://0.0.0.0:3000" pnpm run start &
wait -n
exit $?

```

Those processes start fine.

Most of the logs are as follows:

```plaintext
2023-03-02T02:37:22.904 proxy[b34c2fd5] scl [error] timed out while connecting to instance
2023-03-02T02:37:26.933 proxy[b34c2fd5] fra [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 50)
2023-03-02T02:37:31.948 proxy[b34c2fd5] ams [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 40)
Could not proxy HTTP request. Retrying in 24 ms (attempt 1)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 10)
2023-03-02T02:37:41.883 proxy[b34c2fd5] ams [warn] Could not proxy HTTP request. Retrying in 1000 ms (attempt 50)
Could not proxy HTTP request. Retrying in 1000 ms (attempt 20)
Could not proxy HTTP request. Retrying in 23 ms (attempt 1)

```

**It’s possible to make requests to the container, but not from inside the container.**

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [March 2, 2023, 3:40am UTC](https://community.fly.io/t/cant-make-requests-inside-container/11158/2 "2023-03-02T03:40:23Z")

</div>

The best way to debug this kind of issue is with curl from within the VM.

Run `curl -v https://example.com` and see what the output is. You can try `--ipv4` to force IPv4 if it’s using IPv6, too.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [March 9, 2023, 3:40am UTC](https://community.fly.io/t/cant-make-requests-inside-container/11158/3 "2023-03-09T03:40:31Z")

</div>

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