inkdrop-org / inkdrop-visualizer

Visualizes your Terraform
https://inkdrop.ai/
Mozilla Public License 2.0
442 stars 16 forks source link

No valid Terraform resources found in graph. #44

Closed nick-ppcprotect closed 1 month ago

nick-ppcprotect commented 1 month ago

Hello,

I am getting this response from inkdrop on a few of my repos. They are typically ones that do not have much of a drift when it comes to terraform changes.

I am using inkdrop 1.1.44

In this particular case I have created the terraform plan which shows no new changes.
If I run this command locally everything seems to work fine and I can view all my resources: inkdrop plan.out --opacity-full --show-unchanged --debug

However if I run this with the --ci flag: inkdrop plan.out --opacity-full --show-unchanged --ci --debug I get the error No valid Terraform resources found in graph.

Full debug output is here. Any insights you can offer would be appreciated. I have this on most of my repos now and is working great except for these edge cases.

Diagram renderer running on localhost:3000
Computing terraform graph...
Creating SVG of the diagram...

  Degraded performance warning:
  Launching Chrome on Mac Silicon (arm64) from an x64 Node installation results in
  Rosetta translating the Chrome binary, even if Chrome is already arm64. This would
  result in huge performance issues. To resolve this, you must run Puppeteer with
  a version of Node built for arm64.
LOG: Detailed view is off.
LOG: Unchanged resources are shown.
LOG: Full opacity for unchanged resources is on.
LOG: Aggregating multiple states graphs...
LOG: Terraform plan detected.
LOG: Adding main resources...
LOG: Adding main resource: aws_cloudwatch_log_group.vpn
LOG: Adding main resource: aws_iam_role.datasync-s3-access-role
LOG: Adding main resource: aws_security_group.endpoint_sg
LOG: Adding main resource: aws_security_group.vpn
WARN: Unknown block type datadog_monitor.efs_percent_iolimit
WARN: Unknown block type datadog_monitor.natgw_usage
LOG: Adding main resource: module.vpc.aws_cloudwatch_log_group.flow_log
LOG: Adding main resource: module.vpc.aws_db_subnet_group.database
LOG: Adding main resource: module.vpc.aws_iam_policy.vpc_flow_log_cloudwatch
LOG: Adding main resource: module.vpc.aws_iam_role.vpc_flow_log_cloudwatch
LOG: Adding main resource: module.vpc.aws_internet_gateway.this
LOG: Adding main resource: module.vpc.aws_nat_gateway.this
LOG: Adding main resource: module.vpc.aws_subnet.database
LOG: Adding main resource: module.vpc.aws_subnet.elasticache
LOG: Adding main resource: module.vpc.aws_subnet.intra
LOG: Adding main resource: module.vpc.aws_subnet.outpost
LOG: Adding main resource: module.vpc.aws_subnet.private
LOG: Adding main resource: module.vpc.aws_vpc.this
LOG: Adding main resource: module.vpc.aws_vpn_gateway.this
LOG: Adding main resources... Done.
LOG: Adding main resource: module.vpc.aws_subnet.public
LOG: Adding main resource: module.vpc.aws_subnet.redshift
LOG: Aggregating resource: aws_cloudwatch_log_stream.vpn    ->  aws_cloudwatch_log_group.vpn
LOG: Aggregating secondary resources...
LOG: Aggregating resource: data.aws_iam_policy_document.datasync_assume_role    ->  aws_iam_role.datasync-s3-access-role
LOG: Aggregating resource: aws_iam_role_policy.datasync-s3-access-policy    ->  aws_iam_role.datasync-s3-access-role
LOG: Aggregating resource: data.aws_iam_policy_document.bucket_access   ->  aws_iam_role.datasync-s3-access-role
LOG: Aggregating resource: module.vpc.aws_route.database_internet_gateway   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.data.aws_iam_policy_document.vpc_flow_log_cloudwatch  ->  module.vpc.aws_iam_policy.vpc_flow_log_cloudwatch
LOG: Aggregating resource: module.vpc.aws_iam_role_policy_attachment.vpc_flow_log_cloudwatch    ->  module.vpc.aws_iam_policy.vpc_flow_log_cloudwatch
LOG: Aggregating resource: module.vpc.data.aws_iam_policy_document.flow_log_cloudwatch_assume_role  ->  module.vpc.aws_iam_role.vpc_flow_log_cloudwatch
LOG: Aggregating resource: module.vpc.aws_route_table.database  ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.database_ipv6_egress    ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_egress_only_internet_gateway.this ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.database_dns64_nat_gateway  ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.private_ipv6_egress ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table.private   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.private_dns64_nat_gateway   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.private_nat_gateway ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.database  ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.elasticache   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table.elasticache   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.outpost   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.private   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.redshift  ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table.redshift  ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.public_internet_gateway ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.redshift_public   ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table.public    ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.public_internet_gateway_ipv6    ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route_table_association.public    ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_route.database_nat_gateway    ->  module.vpc.aws_internet_gateway.this
LOG: Aggregating resource: module.vpc.aws_network_acl.database  ->  module.vpc.aws_subnet.database
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.database_inbound ->  module.vpc.aws_subnet.database
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.database_outbound    ->  module.vpc.aws_subnet.database
LOG: Aggregating resource: module.vpc.aws_network_acl.elasticache   ->  module.vpc.aws_subnet.elasticache
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.elasticache_inbound  ->  module.vpc.aws_subnet.elasticache
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.elasticache_outbound ->  module.vpc.aws_subnet.elasticache
LOG: Aggregating resource: module.vpc.aws_network_acl.intra ->  module.vpc.aws_subnet.intra
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.intra_inbound    ->  module.vpc.aws_subnet.intra
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.intra_outbound   ->  module.vpc.aws_subnet.intra
LOG: Aggregating resource: module.vpc.aws_route_table_association.intra ->  module.vpc.aws_subnet.intra
LOG: Aggregating resource: module.vpc.aws_route_table.intra ->  module.vpc.aws_subnet.intra
LOG: Aggregating resource: module.vpc.aws_network_acl.outpost   ->  module.vpc.aws_subnet.outpost
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.outpost_inbound  ->  module.vpc.aws_subnet.outpost
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.outpost_outbound ->  module.vpc.aws_subnet.outpost
LOG: Aggregating resource: module.vpc.aws_network_acl.private   ->  module.vpc.aws_subnet.private
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.private_inbound  ->  module.vpc.aws_subnet.private
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.private_outbound ->  module.vpc.aws_subnet.private
LOG: Aggregating resource: module.vpc.aws_network_acl.public    ->  module.vpc.aws_subnet.public
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.public_inbound   ->  module.vpc.aws_subnet.public
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.public_outbound  ->  module.vpc.aws_subnet.public
LOG: Aggregating resource: module.vpc.aws_network_acl.redshift  ->  module.vpc.aws_subnet.redshift
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.redshift_inbound ->  module.vpc.aws_subnet.redshift
LOG: Aggregating resource: module.vpc.aws_network_acl_rule.redshift_outbound    ->  module.vpc.aws_subnet.redshift
LOG: Aggregating resource: module.vpc.aws_default_network_acl.this  ->  module.vpc.aws_vpc.this
LOG: Aggregating resource: module.vpc.aws_default_route_table.default   ->  module.vpc.aws_vpc.this
LOG: Aggregating resource: module.vpc.aws_default_security_group.this   ->  module.vpc.aws_vpc.this
LOG: Aggregating resource: module.vpc.aws_vpc_ipv4_cidr_block_association.this  ->  module.vpc.aws_vpc.this
LOG: Aggregating resource: module.vpc.aws_vpn_gateway_route_propagation.intra   ->  module.vpc.aws_vpn_gateway.this
LOG: Aggregating resource: module.vpc.aws_vpn_gateway_attachment.this   ->  module.vpc.aws_vpn_gateway.this
LOG: Aggregating resource: module.vpc.aws_vpn_gateway_route_propagation.private ->  module.vpc.aws_vpn_gateway.this
LOG: Aggregating resource: module.vpc.aws_vpn_gateway_route_propagation.public  ->  module.vpc.aws_vpn_gateway.this
LOG: Aggregating secondary resources... Done.
LOG: Removing inactive resources...
LOG: Removing inactive main resource: module.vpc.aws_subnet.outpost
LOG: Removing inactive main resource: module.vpc.aws_vpn_gateway.this
LOG: Removing inactive secondary resource: data.aws_iam_policy_document.datasync_assume_role
LOG: Removing inactive secondary resource: data.aws_iam_policy_document.bucket_access
LOG: Removing inactive secondary resource: module.vpc.data.aws_iam_policy_document.vpc_flow_log_cloudwatch
LOG: Removing inactive secondary resource: module.vpc.data.aws_iam_policy_document.flow_log_cloudwatch_assume_role
LOG: Removing inactive secondary resource: module.vpc.aws_route.database_dns64_nat_gateway
LOG: Removing inactive secondary resource: module.vpc.aws_route.private_dns64_nat_gateway
LOG: Removing inactive secondary resource: module.vpc.aws_route_table_association.outpost
LOG: Removing inactive secondary resource: module.vpc.aws_route_table_association.redshift_public
LOG: Removing inactive secondary resource: module.vpc.aws_route.database_nat_gateway
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl.database
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.database_inbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.database_outbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl.elasticache
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.elasticache_inbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.elasticache_outbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl.intra
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.intra_inbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.intra_outbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl.private
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.private_inbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.private_outbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl.public
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.public_inbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl.redshift
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.redshift_inbound
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.redshift_outbound
LOG: Removing inactive secondary resource: module.vpc.aws_vpc_ipv4_cidr_block_association.this
LOG: Removing inactive secondary resource: module.vpc.aws_network_acl_rule.public_outbound
LOG: Computing connections...
LOG: Computing connections... Done.
LOG: Removing inactive resources... Done.
Writing 'inkdrop-ci-data_24-05-13_14-37-32.json'...
No valid Terraform resources found in graph.
Please ensure that you have run Inkdrop inside your Terraform project directory, or specify the path to your Terraform project using the --path argument.
albschi commented 1 month ago

Hey,

The problem should be solved in v1.1.45.

In the CI process, puppeteer was trying to right-click on {x:0, y:0}, but since we added a left sidebar, these coordinates were not valid anymore.

Thanks for reporting

nick-ppcprotect commented 1 month ago

Thank you that seemed to fix it when --show-unchanged is specified.

I do still get the same error through when running inkdrop plan.out --ci --debug Am I correct in assuming that this should still produce something rather than an error if there are no changes detected in the terraform plan?

albschi commented 1 month ago

I improved the error flow: