GoogleCloudPlatform / appengine-ruby

Optional integration library for the Ruby runtime for Google App Engine
Apache License 2.0
53 stars 21 forks source link

appengine:exec region error #56

Open moliver-hemasystems opened 7 months ago

moliver-hemasystems commented 7 months ago

We recently upgraded from 0.6.0 to 0.7.0, and we're now encountering an error when running the following:

bundle exec rake appengine:exec GAE_PROJECT=my_project_name GAE_SERVICE=default GAE_TIMEOUT=60m -- echo foo

When we run the above, or any other command through appengine:exec, we get the following output:

** Invoke appengine:exec (first_time)
** Execute appengine:exec
Bad value for region: (value missing)

I'm assuming I need to configure something somewhere, but I've not been able to find anything about this message to indicate what's missing a region value and where I should be setting it. I thought initially that our appengine config was maybe missing something, but looking at the terraform file for the project, I see:

locals {
  google_region = "us-central1"
  google_zone = "us-central1-c"
  # ... more config after this...
}

And further on, this is referenced in places like:

module "app_engine_endpoint_groups" {
  source = "../../modules/app_engine_endpoint_groups"

  region = local.google_region
  service_names = ["default"]
}

So I'm not sure what else to be looking at.

Any help with how to resolve this error is appreciated.

moliver-hemasystems commented 7 months ago

I think I found the cause of the issue. We are configuring our services at build-time on a per-environment-basis, so we're copying over the YAML file at the time of the build. This is resulting in the gem not detecting the "app.yaml" file in the root directory, so it's defaulting the product to "CLOUD_RUN" instead of "APP_ENGINE". However, we can't pass the product to use via environment variable as far as I can see, so we can't override this behavior in the command.