elastic / terraform-provider-elasticstack

Terraform provider for Elastic Stack
https://registry.terraform.io/providers/elastic/elasticstack/latest/docs
Apache License 2.0
170 stars 92 forks source link

[Bug] Error: EOF #418

Open sphtd opened 1 year ago

sphtd commented 1 year ago

Describe the bug When using any resource I have a problem with Error: EOF.

To Reproduce Steps to reproduce the behavior:

  1. TF configuration used 'I treid just copy configuration from docs and run terraform apply'
  2. TF operations to execute to get the error 'After terraform apply'
  3. See the error in the output 'elasticstack_elasticsearch_logstash_pipeline.example: Creating... ╷ │ Error: EOF │ │ with elasticstack_elasticsearch_logstash_pipeline.example, │ on main.tf line 22, in resource "elasticstack_elasticsearch_logstash_pipeline" "example": │ 22: resource "elasticstack_elasticsearch_logstash_pipeline" "example" {'

Expected behavior

Debug output

2023-09-07T10:09:37.627+0200 [TRACE] maybeTainted: elasticstack_elasticsearch_logstash_pipeline.example encountered an error during creation, so it is now marked as tainted
2023-09-07T10:09:37.627+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for elasticstack_elasticsearch_logstash_pipeline.example
2023-09-07T10:09:37.628+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for elasticstack_elasticsearch_logstash_pipeline.example
2023-09-07T10:09:37.628+0200 [TRACE] evalApplyProvisioners: elasticstack_elasticsearch_logstash_pipeline.example is tainted, so skipping provisioning
2023-09-07T10:09:37.628+0200 [TRACE] maybeTainted: elasticstack_elasticsearch_logstash_pipeline.example was already tainted, so nothing to do
2023-09-07T10:09:37.628+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for elasticstack_elasticsearch_logstash_pipeline.example
2023-09-07T10:09:37.628+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for elasticstack_elasticsearch_logstash_pipeline.example
2023-09-07T10:09:37.628+0200 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2023-09-07T10:09:37.629+0200 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2023-09-07T10:09:37.629+0200 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
2023-09-07T10:09:37.633+0200 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2023-09-07T10:09:37.633+0200 [ERROR] vertex "elasticstack_elasticsearch_logstash_pipeline.example" error: EOF
2023-09-07T10:09:37.633+0200 [TRACE] vertex "elasticstack_elasticsearch_logstash_pipeline.example": visit complete, with errors
2023-09-07T10:09:37.634+0200 [TRACE] dag/walk: upstream of "output.pipeline (expand)" errored, so skipping  
2023-09-07T10:09:37.634+0200 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/elastic/elasticstack\"] (close)" errored, so skipping
2023-09-07T10:09:37.634+0200 [TRACE] dag/walk: upstream of "root" errored, so skipping
2023-09-07T10:09:37.634+0200 [TRACE] statemgr.Filesystem: not making a backup, because the new snapshot is identical to the old
2023-09-07T10:09:37.635+0200 [TRACE] statemgr.Filesystem: no state changes since last snapshot
2023-09-07T10:09:37.635+0200 [TRACE] statemgr.Filesystem: writing snapshot at terraform.tfstate
╷
│ Error: EOF
│
│   with elasticstack_elasticsearch_logstash_pipeline.example,
│   on main.tf line 22, in resource "elasticstack_elasticsearch_logstash_pipeline" "example":
│   22: resource "elasticstack_elasticsearch_logstash_pipeline" "example" {
│
╵
2023-09-07T10:09:37.637+0200 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2023-09-07T10:09:37.638+0200 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock     
2023-09-07T10:09:37.639+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-09-07T10:09:37.642+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/elastic/elasticstack/0.7.0/linux_amd64/terraform-provider-elasticstack_v0.7.0 pid=2924
2023-09-07T10:09:37.642+0200 [DEBUG] provider: plugin exited

Screenshots image

Versions (please complete the following information):

polak785 commented 1 year ago

Hello @sphtd,

I had the same problem, but after some tests with previous versions I had the same error. So I thought there was a problem on my side, and bingo! In my case I'd entered the endpoint address incorrectly, I'd put 'http' instead of 'https'. So maybe it's the same for you ;) Otherwise check all the other provider data.

RoseSecurity commented 1 year ago

Had this happen as well, and it would be useful to add some more verbose logging for connection errors instead of just "EOF." Creating an issue for this

rsmith013 commented 11 months ago

This was also my issue, a connection issue. Thank you to this thread.