-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
(aws_elasticsearch_domain) panic: runtime error: invalid memory address or nil pointer dereference #2772
Comments
Please replace
|
@atsushi-ishibashi thanks. Changed
|
@nodesocket Uhhh.. Could you give me more error logs?
|
@atsushi-ishibashi I only created the two cloudwatch log groups: resource "aws_cloudwatch_log_group" "es_index_slow_logs" {
name = "es_index_slow_logs"
retention_in_days = 14
}
resource "aws_cloudwatch_log_group" "es_search_slow_logs" {
name = "es_search_slow_logs"
retention_in_days = 14
} Must I also create a cloudwatch resource policy for each group as well? |
@nodesocket Yeah, you must create a cloudwatch resource policy. To be exact, you have to assign
|
@atsushi-ishibashi thanks, updated and added a https://gist.github.com/nodesocket/84c8ad96fda3e146852652ae2f2bf152 |
The reason is
|
@atsushi-ishibashi really appreciate the help, but I removed Here is the updated relevant sections: resource "aws_cloudwatch_log_group" "es_index_slow_logs" {
name = "es_index_slow_logs"
retention_in_days = 14
}
resource "aws_cloudwatch_log_group" "es_search_slow_logs" {
name = "es_search_slow_logs"
retention_in_days = 14
}
resource "aws_cloudwatch_log_resource_policy" "es_slow_logs" {
policy_name = "es_slow_logs"
policy_document = <<CONFIG
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"Service": "es.amazonaws.com"
},
"Action": [
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
"logs:CreateLogStream"
],
"Resource": [
"${aws_cloudwatch_log_group.es_index_slow_logs.arn}",
"${aws_cloudwatch_log_group.es_search_slow_logs.arn}"
]
}]
}
CONFIG
} Relevant log_publishing_options {
log_type = "INDEX_SLOW_LOGS"
cloudwatch_log_group_arn = "${aws_cloudwatch_log_group.es_index_slow_logs.arn}"
}
log_publishing_options {
log_type = "SEARCH_SLOW_LOGS"
cloudwatch_log_group_arn = "${aws_cloudwatch_log_group.es_search_slow_logs.arn}"
} |
Uhh.. I submitted the PR which avoid nil pointer and is already merged. |
This is fixed by #2787. Thanks for reporting, @nodesocket, and thanks for fixing, @atsushi-ishibashi! |
@jen20 Not yet. Actually we can avoid nil pointer, but we couldn't understand why |
@atsushi-ishibashi and @jen20 so besides this nil pointer issue, is |
@atsushi-ishibashi, @jen20 ok this makes zero sense. I commented out the following blocks: # resource "aws_cloudwatch_log_group" "es_index_slow_logs" {
# name = "es_index_slow_logs"
# retention_in_days = 14
# }
# resource "aws_cloudwatch_log_group" "es_search_slow_logs" {
# name = "es_search_slow_logs"
# retention_in_days = 14
# }
# resource "aws_cloudwatch_log_resource_policy" "es_slow_logs" {
# policy_name = "es_slow_logs"
# policy_document = <<CONFIG
# {
# "Version": "2012-10-17",
# "Statement": [{
# "Effect": "Allow",
# "Principal": {
# "Service": "es.amazonaws.com"
# },
# "Action": [
# "logs:PutLogEvents",
# "logs:PutLogEventsBatch",
# "logs:CreateLogStream"
# ],
# "Resource": [
# "${aws_cloudwatch_log_group.es_index_slow_logs.arn}",
# "${aws_cloudwatch_log_group.es_search_slow_logs.arn}"
# ]
# }]
# }
# CONFIG
# }
And manually did
|
I'm attempting to upgrade our infrastructure from |
@nodesocket the fix was released in 1.7.0 just a few days ago. Can you try upgrading via Regardless I'd be keen to see the debug log from terraform commands you ran (minus any secrets) because I was unable to reproduce this crash. As we are unable to reproduce this I'm closing it for now, but happy to re-open once we have a repro case (i.e. when there's a chance of resolving it). @voltechs This is a different bug unrelated to this issue, we can keep track of it in #3005 which I just opened. Thanks all. |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Running Terraform v0.11.1 with AWS provider 1.6. I have a
crash.log
as well if needed, but don't want to post it publically as it seems to contain sensitive information.Here is the config:
The text was updated successfully, but these errors were encountered: