Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Terraform / Heroku not finding 'web' process in heroku/ruby buildpack

I’m getting an error in Terraform:

Error: Patch "https://api.heroku.com/apps/coderdojo-contentful-staging/formation/web": Couldn’t find that process type (web).

│ with heroku_formation.coderdojo_contentful_staging_formation[0],
│ on terraform.tf line 41, in resource "heroku_formation" "coderdojo_contentful_staging_formation":
│ 41: resource "heroku_formation" "coderdojo_contentful_staging_formation" {

from these lines from my terraform.tf file:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

resource "heroku_formation" "coderdojo_contentful_staging_formation" {
  count    = length(var.formations)
  app      = heroku_app.coderdojo_contentful_staging.name
  type     = lookup(var.formations[count.index], "type")
  quantity = lookup(var.formations[count.index], "quantity")
  size     = lookup(var.formations[count.index], "size")
}

which rely on these lines in my terraform.tfvars file:

formations = [
  {
    type     = "web"
    size     = "standard-1x"
    quantity = "1"
  }
]

buildpacks = [
  "heroku/ruby"
]

Searching the documentation online (e.g. buildpacks and heroku-buildpack-ruby) it appears that the web process type comes from either the buildpack, or the Procfile.

Another project works fine with a very similar setup (i.e. no Procfile), but with the addition of a heroku/nodejs buildpack. I tried adding that build pack but got the same error.

What am I missing?

>Solution :

Another project works fine with a very similar setup (i.e. no Procfile), but with the addition of a heroku/nodejs buildpack. I tried adding that build pack but got the same error.

The heroku/nodejs buildpack falls back to the start script defined in the package.json if no Procfile is present. I suspect your other project that uses that buildpack has a start script. The Ruby buildpack has no such default.

If your app doesn’t require Node.js, don’t add the Node.js buildpack. Instead, add a Procfile to the root of your repository that tells Heroku how to run your app, e.g.

web: bundle exec ruby path/to/some/script.rb

This defines a web process that runs bundle exec ruby ruby path/to/some/script.rb.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading