bosh-bootloader icon indicating copy to clipboard operation
bosh-bootloader copied to clipboard

Terraform error not correctly displayed when using bbl in debug mode

Open jochenehret opened this issue 2 years ago • 1 comments

Hi bbl developers,

when we run bbl in debug mode and a Terraform subcommand fails, the output is not correctly formatted. We see a long list of numbers which should be converted into a string. Example:

bbl --debug up --lb-type=cf --lb-cert=/tmp/bbl-cert --lb-key=/tmp/bbl-key (...)

╷
│ Error: attaching policy arn:aws:iam::537913301405:policy/perf-test-rails_bosh_policy to IAM Role perf-test-rails_bosh_role: NoSuchEntity: The role with name perf-test-rails_bosh_role cannot be found.
│ 	status code: 404, request id: 132f6022-c5b9-46b5-a117-2d0c4e0c6ee8
│ 
│   with aws_iam_role_policy_attachment.bosh[0],
│   on bbl-template.tf line 653, in resource "aws_iam_role_policy_attachment" "bosh":
│  653: resource "aws_iam_role_policy_attachment" "bosh" {
│ 
╵
(...)
Executor apply: command execution failed got: exit status 1 stderr:
 &{[%!s(*os.File=&{0xc000118120}) %!s(*bytes.Buffer=&{[10 27 91 48 109 27 91 49 109 73 110 105 116 105 97 108 105 122 105 110 103 32 116 104 101 (...)

I guess that somewhere here a (string) conversion is missing: https://github.com/cloudfoundry/bosh-bootloader/blob/1e9223250ced84616cc15ae3f83eb9813453a5d9/terraform/cli.go#L44 I haven't found a test that provokes an error and validates the output conversion.

Thanks for handling this issue!

jochenehret avatar Jun 06 '23 13:06 jochenehret

well before it would swallow all errors :) as noted in this commit https://github.com/cloudfoundry/bosh-bootloader/commit/b386086a84c56391fb635bdf810efc98164a5099 but when i have some time i will take a look

ramonskie avatar Jun 08 '23 09:06 ramonskie

as this still relevant?

ramonskie avatar Feb 11 '25 12:02 ramonskie

It's currently not a problem for us as our bbl setups are running fine (ARD WG).

jochenehret avatar Feb 11 '25 13:02 jochenehret