[GH-ISSUE #93] Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x7f48ac46a540> #43

Open
opened 2026-05-06 12:36:38 +02:00 by BreizhHardware · 8 comments

Originally created by @kk-rishang on GitHub (Dec 9, 2023).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/93

I am getting this error for terravision draw --source $PWD

Analysing plan..

Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x7f48ac46a540>
Originally created by @kk-rishang on GitHub (Dec 9, 2023). Original GitHub issue: https://github.com/patrickchugh/terravision/issues/93 I am getting this error for `terravision draw --source $PWD` ``` Analysing plan.. Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x7f48ac46a540> ```
Author
Owner

@patrickchugh commented on GitHub (Dec 10, 2023):

Can you paste your block of code relating to subnets and VPCs here so I can try to reproduce the error?

<!-- gh-comment-id:1848928664 --> @patrickchugh commented on GitHub (Dec 10, 2023): Can you paste your block of code relating to subnets and VPCs here so I can try to reproduce the error?
Author
Owner

@kk-rishang commented on GitHub (Dec 11, 2023):

@patrickchugh here is the repo: you can try for https://github.com/Rishang/demo-tf-1

<!-- gh-comment-id:1849909150 --> @kk-rishang commented on GitHub (Dec 11, 2023): @patrickchugh here is the repo: you can try for https://github.com/Rishang/demo-tf-1
Author
Owner

@Manickz commented on GitHub (Dec 16, 2023):

I face the same error as welll .

<!-- gh-comment-id:1858754992 --> @Manickz commented on GitHub (Dec 16, 2023): I face the same error as welll .
Author
Owner

@l-gatillon commented on GitHub (Dec 20, 2023):

I get the same issue

Analysing plan..

Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x106c8a2c0>
<!-- gh-comment-id:1864848915 --> @l-gatillon commented on GitHub (Dec 20, 2023): I get the same issue ``` Analysing plan.. Unhandled error: <class 'KeyError'>, 'cidr_block', <traceback object at 0x106c8a2c0> ```
Author
Owner

@patrickchugh commented on GitHub (Dec 20, 2023):

@Manickz @l-gatillon @kk-rishang Can you do a git pull on main branch and try again with the latest code?

<!-- gh-comment-id:1865250292 --> @patrickchugh commented on GitHub (Dec 20, 2023): @Manickz @l-gatillon @kk-rishang Can you do a git pull on main branch and try again with the latest code?
Author
Owner

@rraffaello commented on GitHub (Dec 27, 2023):

Hi all! I cloned the last version from main branch and it still raise the "unhandled error" exception for 'cidr_block' fields.

My script defines an aws_vpc_endpoint resource used for the db Secret rotation. In tfwrapper.py file (row 247) terravision tries to parse the aws_vpc_endpoint resource searching for the cidr_block values, but it doesn't find them.
This raises exception.

<!-- gh-comment-id:1870240191 --> @rraffaello commented on GitHub (Dec 27, 2023): Hi all! I cloned the last version from main branch and it still raise the "unhandled error" exception for 'cidr_block' fields. My script defines an aws_vpc_endpoint resource used for the db Secret rotation. In tfwrapper.py file (row 247) terravision tries to parse the aws_vpc_endpoint resource searching for the cidr_block values, but it doesn't find them. This raises exception.
Author
Owner

@patrickchugh commented on GitHub (Dec 27, 2023):

@kk-rishang @rraffaello It seems the program was detecting VPC endpoints as VPCs, I added a fix and tested it works. Please git pull the latest code and try again.

$ terravision draw --source https://github.com/Rishang/demo-tf-1//project-stack/src --show
....
Enriched graphviz dictionary:

{
    "aws_cloudwatch_log_group.cloudwatch": [],
    "aws_ebs_volume.extra_volume~1": [
        "aws_instance.this~1",
        "aws_volume_attachment.extra_volume~1"
    ],
    "aws_group.shared_services": [
        "aws_cloudwatch_log_group.cloudwatch"
    ],
    "aws_iam_role.lambda_role~1": [
        "aws_iam_role_policy.lambda_policy~1"
    ],
    "aws_iam_role_policy.lambda_policy~1": [],
    "aws_instance.this~1": [],
    "aws_lambda_function.this~1": [
        "aws_cloudwatch_log_group.cloudwatch",
        "aws_cloudwatch_log_group.cloudwatch",
        "null_resource.archive~1"
    ],
    "aws_volume_attachment.extra_volume~1": [
        "aws_instance.this~1"
    ],
    "local_file.archive_plan~1": [
        "null_resource.archive~1"
    ]
}
<!-- gh-comment-id:1870623834 --> @patrickchugh commented on GitHub (Dec 27, 2023): @kk-rishang @rraffaello It seems the program was detecting VPC endpoints as VPCs, I added a fix and tested it works. Please git pull the latest code and try again. ``` $ terravision draw --source https://github.com/Rishang/demo-tf-1//project-stack/src --show .... Enriched graphviz dictionary: { "aws_cloudwatch_log_group.cloudwatch": [], "aws_ebs_volume.extra_volume~1": [ "aws_instance.this~1", "aws_volume_attachment.extra_volume~1" ], "aws_group.shared_services": [ "aws_cloudwatch_log_group.cloudwatch" ], "aws_iam_role.lambda_role~1": [ "aws_iam_role_policy.lambda_policy~1" ], "aws_iam_role_policy.lambda_policy~1": [], "aws_instance.this~1": [], "aws_lambda_function.this~1": [ "aws_cloudwatch_log_group.cloudwatch", "aws_cloudwatch_log_group.cloudwatch", "null_resource.archive~1" ], "aws_volume_attachment.extra_volume~1": [ "aws_instance.this~1" ], "local_file.archive_plan~1": [ "null_resource.archive~1" ] } ```
Author
Owner

@patrickchugh commented on GitHub (Apr 30, 2026):

Hi @kk-rishang @rraffaello @kk-rishang @l-gatillon @Manickz Can I close this issue? The code base is now quite different from when you last used terravision. It would be great if you could have a quick look now at the latest version and tell me if there are any more issues.

<!-- gh-comment-id:4351926146 --> @patrickchugh commented on GitHub (Apr 30, 2026): Hi @kk-rishang @rraffaello @kk-rishang @l-gatillon @Manickz Can I close this issue? The code base is now quite different from when you last used terravision. It would be great if you could have a quick look now at the latest version and tell me if there are any more issues.
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#43
No description provided.