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

Unclear error message when using unsupported plugin combinations #1580

Closed
izaaklauer opened this issue Jun 2, 2021 · 7 comments · Fixed by #2143
Closed

Unclear error message when using unsupported plugin combinations #1580

izaaklauer opened this issue Jun 2, 2021 · 7 comments · Fixed by #2143
Labels
Milestone

Comments

@izaaklauer
Copy link
Contributor

Describe the bug
When using an unsupported plugin combination (i.e. an aws/alb releaser after an aws/ecs deployment), the resultant error messages do not make it clear what the problem is.

Steps to Reproduce

Starting with the ecs nodejs sample app, add the folowing release clause to waypoint.hcl:

  release {
    use "aws-alb" {}
  }

and observe the following:

$ ~/dev/waypoint/waypoint deploy

» Deploying...
✓ Found existing ECS cluster: waypoint
✓ Found existing IAM role to use: ecr-example-nodejs
✓ Using default subnets for Service networking
✓ Modified ALB Listener to introduce target group
✓ Configured security group: example-nodejs-inbound-internal
✓ Created ECS Service (example-nodejs-01F776N8MEQ6GVQEH, cluster-name: waypoint)


» Releasing...
! 1 error occurred:
  	* argument cannot be satisfied: type *anypb.Any

As a user, that doesn't strongly indicate to me that I'm using an unsupported plugin combination.

Expected behavior

I believe the error is coming from argmapper failing to resolve the target group that the aws/alb releaser is expecting from it's available transformers. Given that, I would expect it to at least say something like:

! 1 error occurred:
  	* argument cannot be satisfied: type *TargetGroup

But even that argmapper enhancement I think wouldn't give the user much indication of what they've done wrong. I think something like:

The ALB releaser plugin has not received the necessary context to run from previous operations to run: missing required type *TargetGroup

Waypoint Platform Versions

  • Waypoint CLI Version: 0.3.2
  • Waypoint Server Platform and Version: 0.3.2
  • Waypoint Plugin: aws/ecs, aws/alb
@mitchellh
Copy link
Contributor

Step 1 here would be checking if argmapper gives a structured error, I'm not actually sure it does right now.

@izaaklauer
Copy link
Contributor Author

izaaklauer commented Jun 2, 2021

Update: I've also tested the ecs sample app with the k8s releaser, and get the following error:

» Releasing...
! 1 error occurred:
  	* argument cannot be satisfied: type *anypb.Any (subtype: "k8s.Deployment")

Which does provide more context. It seems the ecs deploy -> alb release combination is particularly bad in that it doesn't include that subtype, and may not be long for this world anyway (#1577)

@evanphx evanphx assigned mitchellh and unassigned mitchellh Jun 16, 2021
@evanphx evanphx added this to the 0.4.x milestone Jun 16, 2021
@evanphx evanphx removed the new label Jun 16, 2021
@evanphx evanphx modified the milestones: 0.4.x, 0.5.x Jun 16, 2021
@Hokutosei
Copy link

@izaaklauer @mitchellh sorry, any status on this? I also encountered this today.. any idea how to fix? thank you!

✓ Pushing Docker image...
 │ 08MB/2.161MB: Layer already exists
 │ 23f74e52d377: Layer already exists
 │ b027055f5ab4: Layer already exists
 │ d5bf350f7794: Layer already exists
 │ dee2ed3104f0: Layer already exists
 │ 646ac29ff29b: Layer already exists
 │ 674420ee1a47: Layer already exists
 │ 356db0d0a1d7: Layer already exists
 │ latest: digest: sha256:xxxxxxx
 │ 83593af size: 3258
✓ Docker image pushed: xxxxxxxxxxxxx.xxxxx.ecr.ap-northeast-1.amazonaws.com/xxxxx-demo-hexa-gantt-example:latest

» Deploying...
✓ Rendering templates...
✓ Executing command: kubectl apply -f Dxxx/docker/k8s/waypoint/deployment.yml
 │ deployment.apps/hexa-gantt configured
 │ service/beee-hexa-gantt unchanged


» Releasing...
! 1 error occurred:
        * argument cannot be satisfied: type *anypb.Any (subtype: "k8s.Deployment")

@mitchellh
Copy link
Contributor

@Hokutosei what plugins were you using? I will look at this...

@Hokutosei
Copy link

@mitchellh I am using kubernetes. this is how my hcl looks like..

# The name of your project. A project typically maps 1:1 to a VCS repository.
# This name must be unique for your Waypoint server. If you're running in
# local mode, this must be unique to your machine.
project = "Hexa-gantt-example"

# Labels can be specified for organizational purposes.
# labels = { "foo" = "bar" }

# An application to deploy.
app "hexa-gantt-example" {
  # Build specifies how an application should be deployed. In this case,
  # we'll build using a Dockerfile and keeping it in a local registry.
  build {
    use "docker" {
        dockerfile = "docker/app/Dockerfile"
    }
    registry {
      use "aws-ecr" {
        region     = "ap-northeast-1"
        repository = "xxxxx-demo-hexa-gantt-example"
        tag        = "latest"
      }
    }
  }


  # Deploy to Docker
  deploy {
    use "exec" {
        command = ["kubectl", "apply", "-f", "${path.app}/docker/k8s/waypoint/deployment.yml"]
    }
  }

  release {
    use "kubernetes" {
      load_balancer = true
      port          = 80
    }
  }
}

I am trying to deploy a basic angular app, to amazon EKS. I also tried tutorials, or examples. and I was able to deploy, but not to an existing app, using our already made yaml files for kubernetes

@mitchellh
Copy link
Contributor

Thanks, I'm going to look at improving the error message. I would recommend using the kubernetes-apply plugin but I just looked and its not currently compatible with the kubernetes releaser either. :(

@Hokutosei
Copy link

Hokutosei commented Jul 21, 2021

@mitchellh thank you. I think I have already tried kubernetes-apply. it did not worked, so I tried exec.. any other ways?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants