Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Error deploying a simple go app to cloud run #4704

Open
zboralski opened this issue May 12, 2023 · 2 comments
Open

Error deploying a simple go app to cloud run #4704

zboralski opened this issue May 12, 2023 · 2 comments
Labels
bug Something isn't working jira Will add an Issue to Jira plugin/google/cloudrun

Comments

@zboralski
Copy link

Describe the bug

Trying to deploy a simple app on Cloud Run using waypoint.

I can deploy without problem using gcloud also running the image directly in docker works:

 docker run --platform linux/amd64 --rm -e PORT=8080 -it gcr.io/xxx-ig-eu/ig:latest 
2023-05-12T13:42:13.122Z [INFO]  entrypoint: entrypoint starting: deployment_id="" instance_id=01H08357W2Y0G9TNNYSQ9S5Z4C args=["/cnb/process/web"]
2023-05-12T13:42:13.124Z [INFO]  entrypoint: entrypoint version: full_string=v0.11.0 version=v0.11.0 prerelease="" metadata="" revision=""
2023-05-12T13:42:13.127Z [DEBUG] entrypoint.child: waiting for stateChildReady to flip to true
2023-05-12T13:42:13.127Z [DEBUG] entrypoint.child: starting child command watch loop
2023-05-12T13:42:13.127Z [DEBUG] entrypoint.child: child command received
2023-05-12T13:42:13.127Z [INFO]  entrypoint.child: starting child process: args=["/cnb/process/web"] cmd=/cnb/process/web
2023/05/12 13:42:13 Listening on port 8080
^C2023-05-12T13:42:14.782Z [WARN]  interrupt received, cancelling context
2023-05-12T13:42:14.782Z [WARN]  entrypoint.child: request to exit
2023-05-12T13:42:14.783Z [INFO]  entrypoint.child: terminating current child process
2023-05-12T13:42:14.783Z [DEBUG] entrypoint.child: sending SIGTERM: pid=15
2023-05-12T13:42:14.782Z [INFO]  entrypoint: received cancellation request, waiting for child to exit
2023-05-12T13:42:14.784Z [DEBUG] entrypoint.child: SIGTERM sent, waiting for child process to end or timeout: pid=15
2023-05-12T13:42:14.837Z [WARN]  entrypoint.child: subprocess exited: args=["/cnb/process/web"] cmd=/cnb/process/web err="signal: terminated"
2023-05-12T13:42:14.838Z [INFO]  entrypoint.child: child process exited: pid=15 wait_err=<nil>
2023-05-12T13:42:14.838Z [INFO]  entrypoint.child: child process termination result: err=<nil>

however using waypoint I get the following errors:

! 2 errors occurred:
        * Cloud Run service failed to get ready
        * Error during rollback: 1 error occurred:
        * argument cannot be satisfied: type: bool. This is a bug in the go-argmapper
  library since this shouldn't happen at this point.

and the cloud run fails with:

Revision 'ig-00004-zq5' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

Steps to Reproduce

project = "xxx-ig-eu"

app "ig" {
  labels = {
    "service" = "ig",
    "env"     = "dev"
  }

  build {
    use "pack" {}

    // use "docker" {
    //   buildkit = true
    //   platform = "linux/amd64"
    // }

    registry {
      use "docker" {
        image = "gcr.io/xxx-ig-eu/ig"
        tag   = "latest"
      }
    }
  }

  deploy {
    use "google-cloud-run" {
      project  = "xxx-ig-eu"
      location = "europe-west1"

      port = 8080

      capacity {
        memory                     = 128
        cpu_count                  = 1
        max_requests_per_container = 10
        request_timeout            = 300
      }

      auto_scaling {
        max = 2
      }
    }
  }

  release {
    use "google-cloud-run" {}
  }
}

Expected behavior
A clear and concise description of what you expected to happen.

Waypoint Platform Versions

waypoint --version
CLI: v0.11.0
Server: v0.11.0

@zboralski zboralski added the new label May 12, 2023
@zboralski
Copy link
Author

setting the port to 5000 in waypoint.hcl and hardcoding it in the go app ignoring the environment variable PORT doesn't help.

@paladin-devops paladin-devops added bug Something isn't working plugin/google/cloudrun jira Will add an Issue to Jira and removed new labels May 17, 2023
@paladin-devops
Copy link
Contributor

Hi @zboralski, thank you for taking the time to open this issue with these details! It seems like there's an issue in the usage of argmapper in this plugin. We will look into reproducing and fixing this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working jira Will add an Issue to Jira plugin/google/cloudrun
Projects
None yet
Development

No branches or pull requests

2 participants