cloudfoundry/cnb:bionic builder doesn't build the app

So I have a Strapi app that I’d like to deploy on Fly. First, I was trying to use heroku/buildpacks:20 but no luck here. I’m using yarn and heroku buildpack was trying to use npm, even though I do have only one lock file in the project - yarn.lock. So I decided to try cloudfoundry/cnb:bionic builder. But now I got another problem - this builder installs dependencies correctly, using yarn but it doesn’t seem to build the app. I do have an npm script inside my package.json called build. I saw that you can specify build script using BP_NODE_RUN_SCRIPTS argument for this buildpack. So I’ve added this to my fly.toml file. But still no luck, app doesn’t seem to build. Below is my fly.toml file.

# fly.toml file generated for exampe-app on 2021-11-16T09:42:48+01:00

app = "example-app"

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

[build]
  builder = "cloudfoundry/cnb:bionic"

[build.args]
  BP_NODE_RUN_SCRIPTS="build"

[env]
  PORT = "8080"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

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

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

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

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

Are there any logs that indicate what the actual problem is? It should also be possible to run the buildpacks outside of Fly like you would a Dockerfile using the pack command from https://buildpacks.io — that should make it easy to figure out exactly what needs to be set and what’ll work, and then you can add that into the Fly config.

Thanks, I’ve tried running it locally but no luck. Had to change the builder to paketobuildpacks/builder:base. Seems to work fine.

1 Like

@sudhir.j unfortunately I was wrong.

pack build my-app --buildpack gcr.io/paketo-buildpacks/nodejs --builder paketobuildpacks/builder:base --env BP_NODE_RUN_SCRIPTS=build

So the above command works fine locally for me, it takes some time to build the app (about 20 minutes) but it works. And when I run fly deploy with the same builder paketobuildpacks/builder:base it hangs on yarn run build step, now it’s 25 minutes and counting. Seems really weird. I have no idea what might be causing this, was trying to search if anyone had a similar issue but no luck.

Can you try passing —local-only to fly deploy? That should tell us if the problem is network dependent.

1 Like

The same behavior occurs, it reached 25 minutes and is still on yarn run build step. There are no errors logs or any useful information in the output.