-
Notifications
You must be signed in to change notification settings - Fork 49
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
external provider does not log what its trying to do #22
Comments
By "what its attempting to do" - I mean the command its trying to run. |
#36 added trace logging of the output of the command, but still no tracing of the command itself. |
The fact this has been open for 3 years is ... I'll be honest, both damning and deeply disheartening. I can't give you a PR because you don't have staff time/resources to review community contributions, and you leave basic functionality that has serious security implications broken for years (I say broken because #36 should never have passed review without also fixing this, I know I would have kicked it back)... when lets be fair... this is at absolute worst 1 days work for a junior developer, heck its probably less than 1 days work even if the junior developer never used GoLang before that's how trivial this is. |
Hi @techdragon 👋 This project is maintained by a different set of maintainers and willing to review contributions in this area. We just haven't seen much interest in this issue (e.g. 👍 count) or any submissions so it hasn't been prioritized against other work. If someone is interested in working on this, there's two options: Using log.Printf("[TRACE] Calling Program: %s", cmd.String()) Using the new terraform-plugin-log This is a little bit more of an invasive change to future proof things, but has the benefit of providing much more information in the logs. This requires switching the data source Read functionality to be context aware, then passing that context through tflog.Trace(ctx, "calling program", "program", cmd.String(), "stdin", string(queryJson)) We are planning to cut a release of this provider shortly for other reasons, so now may be a great time to get something in. |
Reference: #14 Reference: #22 This will enable the data source to exit immediately when receiving an interupt signal from Terraform. This also prepares the data source for future enhancements, such as including Terraform Plugin SDK context with logging messages and including additional information in return diagnostics.
Reference: #14 Reference: #22 This will enable the data source to exit immediately when receiving an interupt signal from Terraform. This also prepares the data source for future enhancements, such as including Terraform Plugin SDK context with logging messages and including additional information in return diagnostics.
…g executed Reference: #22 Provider will now produce trace logging such as: ``` 2021-12-20T09:45:21.305-0500 [TRACE] sdk.proto: Received request: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource 2021-12-20T09:45:21.305-0500 [TRACE] sdk.proto: Calling downstream: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource 2021-12-20T09:45:21.305-0500 [TRACE] external: Executing external program: tf_data_source_type=external tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource program=/Users/bflad/go/bin/tf-acc-external-data-source 2021-12-20T09:45:21.375-0500 [TRACE] external: Executed external program: tf_data_source_type=external tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource program=/Users/bflad/go/bin/tf-acc-external-data-source output="" 2021-12-20T09:45:21.375-0500 [TRACE] sdk.proto: Called downstream: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource 2021-12-20T09:45:21.375-0500 [TRACE] sdk.proto: Served request: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource ```
…g executed (#95) Reference: #22 Provider will now produce trace logging such as: ``` 2021-12-20T09:45:21.305-0500 [TRACE] sdk.proto: Received request: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource 2021-12-20T09:45:21.305-0500 [TRACE] sdk.proto: Calling downstream: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource 2021-12-20T09:45:21.305-0500 [TRACE] external: Executing external program: tf_data_source_type=external tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource program=/Users/bflad/go/bin/tf-acc-external-data-source 2021-12-20T09:45:21.375-0500 [TRACE] external: Executed external program: tf_data_source_type=external tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource program=/Users/bflad/go/bin/tf-acc-external-data-source output="" 2021-12-20T09:45:21.375-0500 [TRACE] sdk.proto: Called downstream: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource 2021-12-20T09:45:21.375-0500 [TRACE] sdk.proto: Served request: tf_data_source_type=external tf_proto_version=5 tf_provider_addr=registry.terraform.io/hashicorp/external tf_req_id=f7754152-04ab-826b-3dec-c68af595576a tf_rpc=ReadDataSource ```
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform-provider-external v1.0.0
Terraform all versions
I'm running a complicated external command. It's not working. What would be really useful in debugging why is that if I set TF_LOG to trace, the provider logs what its attempting to do, so I can reconcile the output, but it doesnt log anything.
This makes debugging so much more difficult than it needs to be. Could we have some debug please?!
The text was updated successfully, but these errors were encountered: