[GH-ISSUE #134] Unhandled error: <class 'KeyError'>, 'aws_cloudfront_distribution.docs_bucket_distribution' #76

Closed
opened 2026-05-06 12:37:09 +02:00 by BreizhHardware · 8 comments

Originally created by @felipeyoneharatw on GitHub (Oct 3, 2024).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/134

Originally assigned to: @patrickchugh on GitHub.

Error when running
python3.10 terravision draw --source ~/infra/terraform/modules --workspace dev

....
Processing variables..

Processing resources..
random_string.unique_suffix
module.ecr_settings.aws_ecr_registry_policy.cross_account_ecr_policy
module.user_docs.aws_s3_bucket.docs_bucket
module.user_docs.aws_s3_bucket_website_configuration.user_docs_config
module.user_docs.aws_s3_bucket_public_access_block.this
module.user_docs.aws_s3_bucket_ownership_controls.this
module.user_docs.aws_s3_bucket_acl.this
module.user_docs.aws_s3_bucket_versioning.this
module.user_docs.aws_s3_bucket_policy.docs_bucket_policy
module.user_docs.aws_acm_certificate.user_docs_cert
module.user_docs.aws_route53_record.user_docs_cert_validation
module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation
module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution
module.user_docs.aws_route53_record.user_docs
module.user_docs.aws_cloudfront_origin_access_identity.user_docs_origin_access_identity

Checking for additional links between 16 resources..
module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation --> module.user_docs.aws_acm_certificate.user_docs_cert
module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation --> module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation
module.user_docs.aws_route53_record.user_docs --> module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation
module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution --> module.user_docs.aws_s3_bucket.docs_bucket
module.user_docs.aws_s3_bucket.docs_bucket --> module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution
module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution --> module.user_docs.aws_acm_certificate.user_docs_cert
module.user_docs.aws_route53_record.user_docs --> module.user_docs.aws_acm_certificate.user_docs_cert
module.user_docs.aws_s3_bucket.docs_bucket --> random_string.unique_suffix
module.user_docs.aws_s3_bucket_acl.this --> module.user_docs.aws_s3_bucket.docs_bucket
Unhandled error: <class 'KeyError'>, 'aws_cloudfront_distribution.docs_bucket_distribution', <traceback object at 0x132975900>

Originally created by @felipeyoneharatw on GitHub (Oct 3, 2024). Original GitHub issue: https://github.com/patrickchugh/terravision/issues/134 Originally assigned to: @patrickchugh on GitHub. Error when running python3.10 terravision draw --source ~/infra/terraform/modules --workspace dev .... Processing variables.. Processing resources.. random_string.unique_suffix module.ecr_settings.aws_ecr_registry_policy.cross_account_ecr_policy module.user_docs.aws_s3_bucket.docs_bucket module.user_docs.aws_s3_bucket_website_configuration.user_docs_config module.user_docs.aws_s3_bucket_public_access_block.this module.user_docs.aws_s3_bucket_ownership_controls.this module.user_docs.aws_s3_bucket_acl.this module.user_docs.aws_s3_bucket_versioning.this module.user_docs.aws_s3_bucket_policy.docs_bucket_policy module.user_docs.aws_acm_certificate.user_docs_cert module.user_docs.aws_route53_record.user_docs_cert_validation module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution module.user_docs.aws_route53_record.user_docs module.user_docs.aws_cloudfront_origin_access_identity.user_docs_origin_access_identity Checking for additional links between 16 resources.. module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation --> module.user_docs.aws_acm_certificate.user_docs_cert module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation --> module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation module.user_docs.aws_route53_record.user_docs --> module.user_docs.aws_acm_certificate_validation.user_docs_cert_validation module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution --> module.user_docs.aws_s3_bucket.docs_bucket module.user_docs.aws_s3_bucket.docs_bucket --> module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution module.user_docs.aws_cloudfront_distribution.docs_bucket_distribution --> module.user_docs.aws_acm_certificate.user_docs_cert module.user_docs.aws_route53_record.user_docs --> module.user_docs.aws_acm_certificate.user_docs_cert module.user_docs.aws_s3_bucket.docs_bucket --> random_string.unique_suffix module.user_docs.aws_s3_bucket_acl.this --> module.user_docs.aws_s3_bucket.docs_bucket Unhandled error: <class 'KeyError'>, 'aws_cloudfront_distribution.docs_bucket_distribution', <traceback object at 0x132975900>
Author
Owner

@gitjonez commented on GitHub (Nov 21, 2024):

Also have similar issue with KeyError aws_internet_gateway.igw
Python 3.11.9

❯ terravision draw --source .

...
Preflight check..
  dot command detected: /opt/homebrew/bin/dot
  gvpr command detected: /opt/homebrew/bin/gvpr
  git command detected: /opt/homebrew/bin/git
  terraform command detected: /Users/redacted/bin/terraform

Checking Terraform Version...

Terraform v1.9.6
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/aws versions matching "~> 5.16"...
- Finding latest version of hashicorp/null...
- Installing hashicorp/aws v5.76.0...
- Installed hashicorp/aws v5.76.0 (signed by HashiCorp)
- Installing hashicorp/null v3.2.3...
- Installed hashicorp/null v3.2.3 (signed by HashiCorp)

Terraform has been successfully initialized!

...

Saved the plan to: /var/folders/4v/_ym010l52n-REDACTED-8w2c0000gn/T/tfplan.bin

To perform exactly these actions, run the following command to apply:
    terraform apply "/var/folders/4v/_ym010l52n-REDACTED-8w2c0000gn/T/tfplan.bin"

Decoding plan..


Analysing plan..


Converting TF Graph Connections..  (this may take a while)


Unprocessed terraform graph dictionary:

{
    "aws_instance.bastion": [
        "null_resource.provisioner"
    ],
    "aws_instance.private_host": [],
    "aws_internet_gateway.igw": [
        "aws_route.default"
    ],
    "aws_route.default": [],
    "aws_route_table.private": [
        "aws_route_table_association.private",
        "aws_vpc_endpoint.s3"
    ],
    "aws_route_table_association.private": [],
    "aws_security_group.allow_icmp": [
        "aws_instance.bastion",
        "aws_instance.private_host",
        "aws_vpc_security_group_egress_rule.icmp_all_egress",
        "aws_vpc_security_group_ingress_rule.icmp_ingress"
    ],
    "aws_security_group.allow_ssh": [
        "aws_instance.bastion",
        "aws_vpc_security_group_egress_rule.ssh_egress",
        "aws_vpc_security_group_ingress_rule.ssh_ingress"
    ],
    "aws_security_group.interface_ep": [
        "aws_vpc_endpoint.ec2",
        "aws_vpc_security_group_egress_rule.if_ep_out",
        "aws_vpc_security_group_ingress_rule.if_ep_in"
    ],
    "aws_security_group.private_ssh": [
        "aws_instance.private_host",
        "aws_vpc_security_group_egress_rule.pvt_egress",
        "aws_vpc_security_group_egress_rule.pvt_egress_pfxlst",
        "aws_vpc_security_group_ingress_rule.pvt_ingress"
    ],
    "aws_subnet.sub1": [
        "aws_instance.bastion"
    ],
    "aws_subnet.sub2": [
        "aws_instance.private_host",
        "aws_internet_gateway.igw",
        "aws_route_table_association.private",
        "aws_vpc_endpoint.ec2"
    ],
    "aws_vpc.vpc": [
        "aws_route_table.private",
        "aws_security_group.allow_icmp",
        "aws_security_group.allow_ssh",
        "aws_security_group.interface_ep",
        "aws_security_group.private_ssh",
        "aws_subnet.sub1",
        "aws_vpc_dhcp_options_association.dhcpassoc",
        "aws_vpc_ipv4_cidr_block_association.cidr2",
        "aws_subnet.sub1"
    ],
    "aws_vpc_dhcp_options.dns_resolver": [
        "aws_vpc_dhcp_options_association.dhcpassoc"
    ],
    "aws_vpc_dhcp_options_association.dhcpassoc": [],
    "aws_vpc_endpoint.ec2": [],
    "aws_vpc_endpoint.s3": [],
    "aws_vpc_ipv4_cidr_block_association.cidr2": [
        "aws_subnet.sub2"
    ],
    "aws_vpc_security_group_egress_rule.icmp_all_egress": [],
    "aws_vpc_security_group_egress_rule.if_ep_out": [],
    "aws_vpc_security_group_egress_rule.pvt_egress": [],
    "aws_vpc_security_group_egress_rule.pvt_egress_pfxlst": [],
    "aws_vpc_security_group_egress_rule.ssh_egress": [],
    "aws_vpc_security_group_ingress_rule.icmp_ingress": [],
    "aws_vpc_security_group_ingress_rule.if_ep_in": [],
    "aws_vpc_security_group_ingress_rule.pvt_ingress": [],
    "aws_vpc_security_group_ingress_rule.ssh_ingress": [],
    "null_resource.provisioner": []
}

Parsing Terraform Source Files..
  Added Source Location: .
  Parsing ./interface_endpoint.tf
  Parsing ./gateway_endpoint.tf
    Found 1 output stanza(s)
    Found 2 resource stanza(s)
    Found 1 data stanza(s)
  Parsing ./ec2_endpoint.tf
    Found 1 output stanza(s)
    Found 1 resource stanza(s)
  Parsing ./variables.tf
    Found 12 output stanza(s)
    Found 17 variable stanza(s)
  Parsing ./instances.tf
    Found 3 output stanza(s)
    Found 3 resource stanza(s)
    Found 1 data stanza(s)
  Parsing ./provider.tf
    Found 1 data stanza(s)
  Parsing ./vpc.tf
    Found 22 resource stanza(s)
    Found 1 data stanza(s)

Processing variables..

Processing resources..
   aws_vpc_security_group_egress_rule.pvt_egress_pfxlst
   aws_vpc_endpoint.s3
   aws_vpc_endpoint.ec2
   aws_instance.bastion
   aws_instance.private_host
   null_resource.provisioner
   aws_vpc.vpc
   aws_vpc_ipv4_cidr_block_association.cidr2
   aws_subnet.sub1
   aws_subnet.sub2
   aws_vpc_dhcp_options.dns_resolver
   aws_vpc_dhcp_options_association.dhcpassoc
   aws_route_table.private
   aws_route_table_association.private
   aws_internet_gateway.igw
   aws_route.default
   aws_security_group.allow_ssh
   aws_vpc_security_group_ingress_rule.ssh_ingress
   aws_vpc_security_group_egress_rule.ssh_egress
   aws_security_group.private_ssh
   aws_vpc_security_group_ingress_rule.pvt_ingress
   aws_vpc_security_group_egress_rule.pvt_egress
   aws_security_group.allow_icmp
   aws_vpc_security_group_ingress_rule.icmp_ingress
   aws_vpc_security_group_egress_rule.icmp_all_egress
   aws_security_group.interface_ep
   aws_vpc_security_group_ingress_rule.if_ep_in
   aws_vpc_security_group_egress_rule.if_ep_out

Checking for additional links between 28 resources..
   aws_vpc.vpc --> aws_internet_gateway.igw
   aws_route.default --> aws_vpc_ipv4_cidr_block_association.cidr2
   aws_vpc.vpc --> aws_subnet.sub2
   aws_vpc.vpc --> aws_vpc_endpoint.ec2
   aws_vpc.vpc --> aws_vpc_endpoint.s3
Unhandled error: <class 'KeyError'>, 'aws_internet_gateway.igw', <traceback object at 0x11530b300>

If yous need anything else or, if yous could point me at where/what in the terravision code I could look at, let me know. Not sure I'm up for cold start investigation. I could trade yous for getting to work with python3.12... it wasn't very happy with that =) Cheers.

<!-- gh-comment-id:2490074288 --> @gitjonez commented on GitHub (Nov 21, 2024): Also have similar issue with KeyError `aws_internet_gateway.igw` `Python 3.11.9` ``` ❯ terravision draw --source . ... Preflight check.. dot command detected: /opt/homebrew/bin/dot gvpr command detected: /opt/homebrew/bin/gvpr git command detected: /opt/homebrew/bin/git terraform command detected: /Users/redacted/bin/terraform Checking Terraform Version... Terraform v1.9.6 Initializing the backend... Initializing provider plugins... - Finding hashicorp/aws versions matching "~> 5.16"... - Finding latest version of hashicorp/null... - Installing hashicorp/aws v5.76.0... - Installed hashicorp/aws v5.76.0 (signed by HashiCorp) - Installing hashicorp/null v3.2.3... - Installed hashicorp/null v3.2.3 (signed by HashiCorp) Terraform has been successfully initialized! ... Saved the plan to: /var/folders/4v/_ym010l52n-REDACTED-8w2c0000gn/T/tfplan.bin To perform exactly these actions, run the following command to apply: terraform apply "/var/folders/4v/_ym010l52n-REDACTED-8w2c0000gn/T/tfplan.bin" Decoding plan.. Analysing plan.. Converting TF Graph Connections.. (this may take a while) Unprocessed terraform graph dictionary: { "aws_instance.bastion": [ "null_resource.provisioner" ], "aws_instance.private_host": [], "aws_internet_gateway.igw": [ "aws_route.default" ], "aws_route.default": [], "aws_route_table.private": [ "aws_route_table_association.private", "aws_vpc_endpoint.s3" ], "aws_route_table_association.private": [], "aws_security_group.allow_icmp": [ "aws_instance.bastion", "aws_instance.private_host", "aws_vpc_security_group_egress_rule.icmp_all_egress", "aws_vpc_security_group_ingress_rule.icmp_ingress" ], "aws_security_group.allow_ssh": [ "aws_instance.bastion", "aws_vpc_security_group_egress_rule.ssh_egress", "aws_vpc_security_group_ingress_rule.ssh_ingress" ], "aws_security_group.interface_ep": [ "aws_vpc_endpoint.ec2", "aws_vpc_security_group_egress_rule.if_ep_out", "aws_vpc_security_group_ingress_rule.if_ep_in" ], "aws_security_group.private_ssh": [ "aws_instance.private_host", "aws_vpc_security_group_egress_rule.pvt_egress", "aws_vpc_security_group_egress_rule.pvt_egress_pfxlst", "aws_vpc_security_group_ingress_rule.pvt_ingress" ], "aws_subnet.sub1": [ "aws_instance.bastion" ], "aws_subnet.sub2": [ "aws_instance.private_host", "aws_internet_gateway.igw", "aws_route_table_association.private", "aws_vpc_endpoint.ec2" ], "aws_vpc.vpc": [ "aws_route_table.private", "aws_security_group.allow_icmp", "aws_security_group.allow_ssh", "aws_security_group.interface_ep", "aws_security_group.private_ssh", "aws_subnet.sub1", "aws_vpc_dhcp_options_association.dhcpassoc", "aws_vpc_ipv4_cidr_block_association.cidr2", "aws_subnet.sub1" ], "aws_vpc_dhcp_options.dns_resolver": [ "aws_vpc_dhcp_options_association.dhcpassoc" ], "aws_vpc_dhcp_options_association.dhcpassoc": [], "aws_vpc_endpoint.ec2": [], "aws_vpc_endpoint.s3": [], "aws_vpc_ipv4_cidr_block_association.cidr2": [ "aws_subnet.sub2" ], "aws_vpc_security_group_egress_rule.icmp_all_egress": [], "aws_vpc_security_group_egress_rule.if_ep_out": [], "aws_vpc_security_group_egress_rule.pvt_egress": [], "aws_vpc_security_group_egress_rule.pvt_egress_pfxlst": [], "aws_vpc_security_group_egress_rule.ssh_egress": [], "aws_vpc_security_group_ingress_rule.icmp_ingress": [], "aws_vpc_security_group_ingress_rule.if_ep_in": [], "aws_vpc_security_group_ingress_rule.pvt_ingress": [], "aws_vpc_security_group_ingress_rule.ssh_ingress": [], "null_resource.provisioner": [] } Parsing Terraform Source Files.. Added Source Location: . Parsing ./interface_endpoint.tf Parsing ./gateway_endpoint.tf Found 1 output stanza(s) Found 2 resource stanza(s) Found 1 data stanza(s) Parsing ./ec2_endpoint.tf Found 1 output stanza(s) Found 1 resource stanza(s) Parsing ./variables.tf Found 12 output stanza(s) Found 17 variable stanza(s) Parsing ./instances.tf Found 3 output stanza(s) Found 3 resource stanza(s) Found 1 data stanza(s) Parsing ./provider.tf Found 1 data stanza(s) Parsing ./vpc.tf Found 22 resource stanza(s) Found 1 data stanza(s) Processing variables.. Processing resources.. aws_vpc_security_group_egress_rule.pvt_egress_pfxlst aws_vpc_endpoint.s3 aws_vpc_endpoint.ec2 aws_instance.bastion aws_instance.private_host null_resource.provisioner aws_vpc.vpc aws_vpc_ipv4_cidr_block_association.cidr2 aws_subnet.sub1 aws_subnet.sub2 aws_vpc_dhcp_options.dns_resolver aws_vpc_dhcp_options_association.dhcpassoc aws_route_table.private aws_route_table_association.private aws_internet_gateway.igw aws_route.default aws_security_group.allow_ssh aws_vpc_security_group_ingress_rule.ssh_ingress aws_vpc_security_group_egress_rule.ssh_egress aws_security_group.private_ssh aws_vpc_security_group_ingress_rule.pvt_ingress aws_vpc_security_group_egress_rule.pvt_egress aws_security_group.allow_icmp aws_vpc_security_group_ingress_rule.icmp_ingress aws_vpc_security_group_egress_rule.icmp_all_egress aws_security_group.interface_ep aws_vpc_security_group_ingress_rule.if_ep_in aws_vpc_security_group_egress_rule.if_ep_out Checking for additional links between 28 resources.. aws_vpc.vpc --> aws_internet_gateway.igw aws_route.default --> aws_vpc_ipv4_cidr_block_association.cidr2 aws_vpc.vpc --> aws_subnet.sub2 aws_vpc.vpc --> aws_vpc_endpoint.ec2 aws_vpc.vpc --> aws_vpc_endpoint.s3 Unhandled error: <class 'KeyError'>, 'aws_internet_gateway.igw', <traceback object at 0x11530b300> ``` If yous need anything else or, if yous could point me at where/what in the `terravision` code I could look at, let me know. Not sure I'm up for cold start investigation. I could trade yous for getting to work with `python3.12`... it wasn't very happy with that =) Cheers.
Author
Owner

@hangrybear666 commented on GitHub (Feb 10, 2026):

Have several KeyErrors preventing any AWS image generation at all. Each time I add a count = 1 to my resources to fix the KeyError, a new one appears, I will likely have to abort using terravision until this is fixed, the code shouldn't expect all these resources to have count defined, in fact most of the times it is not.

KeyError ALB

Traceback (most recent call last):
  File "/home/terravision/.local/bin/terravision", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main
    cli(
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw
    tfdata = compile_tfdata(
             ^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata
    tfdata = _enrich_graph_data(tfdata, debug, already_processed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 474, in _enrich_graph_data
    tfdata = graphmaker.handle_special_resources(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 1296, in handle_special_resources
    tfdata = handler_func(tfdata)
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/modules/resource_handlers_aws.py", line 672, in aws_handle_lb
    tfdata["meta_data"][renamed_node]["count"]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'count'
Unhandled error: <class 'KeyError'>, 'count'

KeyError ElastiCache

Traceback (most recent call last):
  File "/home/terravision/.local/bin/terravision", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main
    cli(
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw
    tfdata = compile_tfdata(
             ^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata
    tfdata = _enrich_graph_data(tfdata, debug, already_processed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data
    tfdata = graphmaker.reverse_relations(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations
    tfdata["graphdict"][node].remove(c)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'aws_elasticache_cluster.cachename'
Unhandled error: <class 'KeyError'>, 'aws_elasticache_cluster.cachename'

KeyError aws_ses_domain_dkim

Traceback (most recent call last):
  File "/home/terravision/.local/bin/terravision", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main
    cli(
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw
    tfdata = compile_tfdata(
             ^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata
    tfdata = _enrich_graph_data(tfdata, debug, already_processed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data
    tfdata = graphmaker.reverse_relations(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations
    tfdata["graphdict"][node].remove(c)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'aws_ses_domain_dkim.company'
Unhandled error: <class 'KeyError'>, 'aws_ses_domain_dkim.company'

KeyError Cloudfront

Traceback (most recent call last):
  File "/home/terravision/.local/bin/terravision", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main
    cli(
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw
    tfdata = compile_tfdata(
             ^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata
    tfdata = _enrich_graph_data(tfdata, debug, already_processed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data
    tfdata = graphmaker.reverse_relations(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations
    tfdata["graphdict"][node].remove(c)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'aws_cloudfront_origin_access_identity.s3OriginIdentity_main'
Unhandled error: <class 'KeyError'>, 'aws_cloudfront_origin_access_identity.s3OriginIdentity_main'

KeyError S3 Bucket

  File "/home/terravision/.local/bin/terravision", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main
    cli(
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw
    tfdata = compile_tfdata(
             ^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata
    tfdata = _enrich_graph_data(tfdata, debug, already_processed)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data
    tfdata = graphmaker.reverse_relations(tfdata)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations
    tfdata["graphdict"][node].remove(c)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'aws_s3_bucket.main-bucket'
Unhandled error: <class 'KeyError'>, 'aws_s3_bucket.main-bucket'
<!-- gh-comment-id:3878308242 --> @hangrybear666 commented on GitHub (Feb 10, 2026): Have several KeyErrors preventing any AWS image generation at all. Each time I add a count = 1 to my resources to fix the KeyError, a new one appears, I will likely have to abort using terravision until this is fixed, the code shouldn't expect all these resources to have count defined, in fact most of the times it is not. KeyError ALB ``` Traceback (most recent call last): File "/home/terravision/.local/bin/terravision", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main cli( File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw tfdata = compile_tfdata( ^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata tfdata = _enrich_graph_data(tfdata, debug, already_processed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 474, in _enrich_graph_data tfdata = graphmaker.handle_special_resources(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 1296, in handle_special_resources tfdata = handler_func(tfdata) ^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/modules/resource_handlers_aws.py", line 672, in aws_handle_lb tfdata["meta_data"][renamed_node]["count"] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ KeyError: 'count' Unhandled error: <class 'KeyError'>, 'count' ``` KeyError ElastiCache ``` Traceback (most recent call last): File "/home/terravision/.local/bin/terravision", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main cli( File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw tfdata = compile_tfdata( ^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata tfdata = _enrich_graph_data(tfdata, debug, already_processed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data tfdata = graphmaker.reverse_relations(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations tfdata["graphdict"][node].remove(c) ~~~~~~~~~~~~~~~~~~~^^^^^^ KeyError: 'aws_elasticache_cluster.cachename' Unhandled error: <class 'KeyError'>, 'aws_elasticache_cluster.cachename' ``` KeyError aws_ses_domain_dkim ``` Traceback (most recent call last): File "/home/terravision/.local/bin/terravision", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main cli( File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw tfdata = compile_tfdata( ^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata tfdata = _enrich_graph_data(tfdata, debug, already_processed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data tfdata = graphmaker.reverse_relations(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations tfdata["graphdict"][node].remove(c) ~~~~~~~~~~~~~~~~~~~^^^^^^ KeyError: 'aws_ses_domain_dkim.company' Unhandled error: <class 'KeyError'>, 'aws_ses_domain_dkim.company' ``` KeyError Cloudfront ``` Traceback (most recent call last): File "/home/terravision/.local/bin/terravision", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main cli( File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw tfdata = compile_tfdata( ^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata tfdata = _enrich_graph_data(tfdata, debug, already_processed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data tfdata = graphmaker.reverse_relations(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations tfdata["graphdict"][node].remove(c) ~~~~~~~~~~~~~~~~~~~^^^^^^ KeyError: 'aws_cloudfront_origin_access_identity.s3OriginIdentity_main' Unhandled error: <class 'KeyError'>, 'aws_cloudfront_origin_access_identity.s3OriginIdentity_main' ``` KeyError S3 Bucket ``` File "/home/terravision/.local/bin/terravision", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 1101, in main cli( File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 969, in draw tfdata = compile_tfdata( ^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 560, in compile_tfdata tfdata = _enrich_graph_data(tfdata, debug, already_processed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/terravision/terravision.py", line 478, in _enrich_graph_data tfdata = graphmaker.reverse_relations(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/terravision/.local/lib/python3.12/site-packages/modules/graphmaker.py", line 354, in reverse_relations tfdata["graphdict"][node].remove(c) ~~~~~~~~~~~~~~~~~~~^^^^^^ KeyError: 'aws_s3_bucket.main-bucket' Unhandled error: <class 'KeyError'>, 'aws_s3_bucket.main-bucket' ```
Author
Owner

@hangrybear666 commented on GitHub (Feb 10, 2026):

@patrickchugh I have analyzed the source code and think one of the issues might be that this line has an unsafe access to a node that might not be defined. https://github.com/patrickchugh/terravision/blob/main/modules/graphmaker.py#L357

And these lines directly access the count variable without checking if it is even defined
https://github.com/patrickchugh/terravision/blob/main/modules/resource_handlers_aws.py#L672

<!-- gh-comment-id:3878540976 --> @hangrybear666 commented on GitHub (Feb 10, 2026): @patrickchugh I have analyzed the source code and think one of the issues might be that this line has an unsafe access to a node that might not be defined. https://github.com/patrickchugh/terravision/blob/main/modules/graphmaker.py#L357 And these lines directly access the count variable without checking if it is even defined https://github.com/patrickchugh/terravision/blob/main/modules/resource_handlers_aws.py#L672
Author
Owner

@patrickchugh commented on GitHub (Feb 10, 2026):

Thanks @hangrybear666 can you share a sample repo or source code zip so I can try to reproduce this error and fix it ? If not you can also run terravision with --debug and send me the tfdata.json if you prefer.

<!-- gh-comment-id:3880631923 --> @patrickchugh commented on GitHub (Feb 10, 2026): Thanks @hangrybear666 can you share a sample repo or source code zip so I can try to reproduce this error and fix it ? If not you can also run terravision with --debug and send me the tfdata.json if you prefer.
Author
Owner

@hangrybear666 commented on GitHub (Feb 10, 2026):

Thanks @hangrybear666 can you share a sample repo or source code zip so I can try to reproduce this error and fix it ? If not you can also run terravision with --debug and send me the tfdata.json if you prefer.

It's an enterprise repository with 375 aws resources and lots of sensitive data I'm not sure how to share this responsibly while staying in line with my security team, also there are several layers of higher level infrastructure repos above mine from the operations team that deploy resources outside of my control, I'm currently unsure how to share a reproducible snippet wonder how others here have done it to help you out

<!-- gh-comment-id:3880904751 --> @hangrybear666 commented on GitHub (Feb 10, 2026): > Thanks [@hangrybear666](https://github.com/hangrybear666) can you share a sample repo or source code zip so I can try to reproduce this error and fix it ? If not you can also run terravision with --debug and send me the tfdata.json if you prefer. It's an enterprise repository with 375 aws resources and lots of sensitive data I'm not sure how to share this responsibly while staying in line with my security team, also there are several layers of higher level infrastructure repos above mine from the operations team that deploy resources outside of my control, I'm currently unsure how to share a reproducible snippet wonder how others here have done it to help you out
Author
Owner

@patrickchugh commented on GitHub (Feb 11, 2026):

Ok let me see if I can create a an updated version more verbose debugging output that can help me pinpoint the problem.

<!-- gh-comment-id:3884332237 --> @patrickchugh commented on GitHub (Feb 11, 2026): Ok let me see if I can create a an updated version more verbose debugging output that can help me pinpoint the problem.
Author
Owner

@patrickchugh commented on GitHub (Feb 15, 2026):

@gitjonez @hangrybear666 @felipeyoneharatw @gliptak I replaced ~80 unsafe del/.remove() calls across 7 files with 3 new safe helpers in helpers.py: delete_node(), rename_node(), and safe_remove_connection(). These prevent the KeyError and ValueError crashes reported in issue #134, where pipeline stages would delete/rename nodes but leave stale references that later stages would crash on trying to access or remove. Please try out latest version and let me know.

<!-- gh-comment-id:3904194963 --> @patrickchugh commented on GitHub (Feb 15, 2026): @gitjonez @hangrybear666 @felipeyoneharatw @gliptak I replaced ~80 unsafe del/.remove() calls across 7 files with 3 new safe helpers in helpers.py: delete_node(), rename_node(), and safe_remove_connection(). These prevent the KeyError and ValueError crashes reported in issue #134, where pipeline stages would delete/rename nodes but leave stale references that later stages would crash on trying to access or remove. Please try out latest version and let me know.
Author
Owner

@hangrybear666 commented on GitHub (Feb 16, 2026):

@gitjonez @hangrybear666 @felipeyoneharatw @gliptak I replaced ~80 unsafe del/.remove() calls across 7 files with 3 new safe helpers in helpers.py: delete_node(), rename_node(), and safe_remove_connection(). These prevent the KeyError and ValueError crashes reported in issue #134, where pipeline stages would delete/rename nodes but leave stale references that later stages would crash on trying to access or remove. Please try out latest version and let me know.

It worked for the first time and generated a diagram for our entire prod environment!
Thank you!!

<!-- gh-comment-id:3908171998 --> @hangrybear666 commented on GitHub (Feb 16, 2026): > [@gitjonez](https://github.com/gitjonez) [@hangrybear666](https://github.com/hangrybear666) [@felipeyoneharatw](https://github.com/felipeyoneharatw) [@gliptak](https://github.com/gliptak) I replaced ~80 unsafe del/.remove() calls across 7 files with 3 new safe helpers in helpers.py: delete_node(), rename_node(), and safe_remove_connection(). These prevent the KeyError and ValueError crashes reported in issue [#134](https://github.com/patrickchugh/terravision/issues/134), where pipeline stages would delete/rename nodes but leave stale references that later stages would crash on trying to access or remove. Please try out latest version and let me know. It worked for the first time and generated a diagram for our entire prod environment! Thank you!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/terravision#76
No description provided.