juju / terraform-provider-juju

A Terraform provider for Juju
Apache License 2.0
21 stars 43 forks source link

panic: invalid user tag, from juju/api/connector.NewSimple #514

Open dparv opened 4 months ago

dparv commented 4 months ago

Description

Execution excited with this error, can't reproduce thou

Urgency

Annoying bug in our test suite

Terraform Juju Provider version

0.10.1

Terraform version

1.7.4

Juju version

3.4.4

Terraform Configuration(s)

No response

Reproduce / Test

terraform apply

Debug/Panic Output

$ terraform apply -auto-approve -input=false
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin6.(*GRPCProvider).ConfigureProvider call. The plugin logs may contain
│ more details.
╵
Stack trace from the terraform-provider-juju_v0.10.1 plugin:
panic: invalid user tag "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r"
goroutine 36 [running]:
github.com/juju/names/v4.NewUserTag({0xc0007b00b0, 0xa5})
    github.com/juju/names/v4@v4.0.0/user.go:102 +0xd4
github.com/juju/juju/api/connector.NewSimple({{0xc0007bc380, 0x1, 0x1}, {0xc0007ae600, 0x5c1}, {0x0, 0x0}, {0xc0007b00b0, 0xa5}, {0xc00037e460, ...}, ...}, ...)
    github.com/juju/juju@v0.0.0-20230918005335-afb8ee760af7/api/connector/simpleconnector.go:49 +0x6e
github.com/juju/terraform-provider-juju/internal/juju.(*sharedClient).GetConnection(0xc0001b5340, 0x1?)
    github.com/juju/terraform-provider-juju/internal/juju/client.go:124 +0x148
github.com/juju/terraform-provider-juju/internal/provider.(*jujuProvider).Configure(0x0?, {0x27478a0, 0xc000376b40}, {{0xc0000621d0, 0x5}, {{{0x2750930, 0xc000377410}, {0x1fd1020, 0xc000377320}}, {0x2755be8, ...}}}, ...)
    github.com/juju/terraform-provider-juju/internal/provider/provider.go:155 +0x3f0
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ConfigureProvider(0xc0004c8000, {0x27478a0, 0xc000376b40}, 0xc0000c5bc0, 0xc0000c5b40)
    github.com/hashicorp/terraform-plugin-framework@v1.3.5/internal/fwserver/server_configureprovider.go:18 +0x10f
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ConfigureProvider(0xc0004c8000, {0x27478a0?, 0xc0003769f0?}, 0xc0003769c0?)
    github.com/hashicorp/terraform-plugin-framework@v1.3.5/internal/proto6server/server_configureprovider.go:39 +0x30f
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ConfigureProvider(0xc0002e6460, {0x27478a0?, 0xc0003761b0?}, 0xc0000c5480)
    github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov6/tf6server/server.go:530 +0x2d3
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0x2239ac0?, 0xc0002e6460}, {0x27478a0, 0xc0003761b0}, 0xc0001b4150, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:368 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001c6000, {0x27516a0, 0xc000007520}, 0xc000782000, 0xc0003b5b90, 0x3865a58, 0x0)
    google.golang.org/grpc@v1.56.1/server.go:1337 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc0001c6000, {0x27516a0, 0xc000007520}, 0xc000782000, 0x0)
    google.golang.org/grpc@v1.56.1/server.go:1714 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.1()
    google.golang.org/grpc@v1.56.1/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
    google.golang.org/grpc@v1.56.1/server.go:957 +0x18c
Error: The terraform-provider-juju_v0.10.1 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
ERROR: Job failed: exit code 1

Notes & References

No response

hmlanigan commented 4 months ago

@dparv There was an error like this related to JAAS. Is that what you're running against? Which values of the provider config were set?