Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider fails when no private_key provided #12

Open
david-jointech opened this issue Jan 17, 2024 · 0 comments · May be fixed by #13
Open

Provider fails when no private_key provided #12

david-jointech opened this issue Jan 17, 2024 · 0 comments · May be fixed by #13

Comments

@david-jointech
Copy link

Terraform Version

1.6.6

Affected Resource(s)

  • data.ssh_tunnel

Expected Behavior

Using the provider without defining a private_key in auth should have the provider working as expected.

Actual Behavior

The provider fails during plan with a runtime error (nil pointer).

Steps to Reproduce

  1. Add provider configuring only password in the auth-block
  2. Add a data.ssh_tunnel-resource configuring a connection to the ssh-server
  3. Run terraform plan (or terraform apply).

Panic Output

Stack trace from the terraform-provider-ssh_v0.2.3 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xa42813]

goroutine 29 [running]:
github.com/stefansundin/terraform-provider-ssh/provider.(*SSHProvider).Configure(0x0?, {0xcb8ee0, 0xc00045b3e0}, {{0xc0001c3870, 0x5}, {{{0xcbd068, 0xc0004678f0}, {0xad97c0, 0xc000466930}}, {0xcbe6b0, ...}}}, ...)
        github.com/stefansundin/terraform-provider-ssh/provider/provider.go:179 +0x353
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ConfigureProvider(0xc0001614a0, {0xcb8ee0, 0xc00045b3e0}, 0xc000456440, 0xc0004563c0)
        github.com/hashicorp/[email protected]/internal/fwserver/server_configureprovider.go:15 +0x10f
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ConfigureProvider(0xc0001614a0, {0xcb8ee0?, 0xc00045b290?}, 0xc00045b260?)
        github.com/hashicorp/[email protected]/internal/proto6server/server_configureprovider.go:36 +0x30f
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ConfigureProvider(0xc0001dc780, {0xcb8ee0?, 0xc00045aa80?}, 0xc000456200)
        github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:527 +0x2d3
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0xb8b280?, 0xc0001dc780}, {0xcb8ee0, 0xc00045aa80}, 0xc00040caf0, 0x0)
        github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:365 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001da1e0, {0xcbd478, 0xc00040ab60}, 0xc000455680, 0xc0004083c0, 0x1119d58, 0x0)
        google.golang.org/[email protected]/server.go:1345 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc0001da1e0, {0xcbd478, 0xc00040ab60}, 0xc000455680, 0x0)
        google.golang.org/[email protected]/server.go:1722 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/[email protected]/server.go:966 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:964 +0x28a

Error: The terraform-provider-ssh_v0.2.3 plugin crashed!

Important Factoids

No

david-jointech added a commit to david-jointech/terraform-provider-ssh that referenced this issue Jan 17, 2024
Running the provider without a `private_key` in auth no
longer produces a runtime error.
Also, when provided password-authentication takes precedence
over ssh-socket-authentication.

Fixes AndrewChubatiuk#12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant