Strapi: Failing to deploy, hangs and then fails on read/write on closed pipe

Hello,

I’m experiencing the following issue. In my case, I’m trying to deploy Strapi with Fly.io.

Scripts
LOG_LEVEL=debug flyctl launch
LOG_LEVEL=debug flyctl deploy

fly.toml

# fly.toml file generated for strapitoheroku on 2022-09-18T07:39:49+01:00

app = "strapitoheroku"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  builder = "heroku/buildpacks:20"

[env]
  PORT = "1337"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 1337
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [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.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

It is stuck at “Status: Image is up to date for heroku/heroku:20-cnb” and with LOG_LEVEL=debug enabled:

image

I’ve tried flyctl wireguard websockets enable as suggested however that doesn’t seem to make a difference.

When viewing the builder logs, it repeatedly shows:

and each time this occurs it seems that it will eventually fail.

Eventually this builder becomes suspended and final output is:

The deploy script eventually outputs:

image

I’ve seen various issues raised and even documentation including:

What have I tried?

  • flyctl wireguard websockets enable
  • Changing networks

Conclusion
My thoughts are that given the repeated output by the builder each time that it will likely fail unless there is some other reason. I intend on exploring the approach as mentioned above of what I have not tried. I’m interested however in knowing the approach I am trying should work.

Thank you for your help!

Creating Dockfile and configuring Fly to use that.

Thanks to Fly.io Deployment - Strapi Developer Docs