[GH-ISSUE #139] Errors when running terravision for my AWS env. #81

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

Originally created by @FerreJanssensPXL on GitHub (Apr 30, 2025).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/139

I encountered 2 different errors when running Terravision:

Traceback (most recent call last): File "/Users/UNAME/Desktop/./terravision/terravision", line 289, in <module> cli( File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 207, in draw tfdata = compile_tfdata(source, varfile, workspace, debug, annotate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 72, in compile_tfdata tfdata = graphmaker.consolidate_nodes(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/terravision/modules/graphmaker.py", line 208, in consolidate_nodes resdata = tfdata["meta_data"][resource] ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ KeyError: 'aws_security_group_rule.allow_traffic_from_bastion_dev_ingress_ssh[1]~2'
#########################################################################################################

#########################################################################################################
Traceback (most recent call last): File "/Users/UNAME/Desktop/./terravision/terravision", line 289, in <module> cli( File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 207, in draw tfdata = compile_tfdata(source, varfile, workspace, debug, annotate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 76, in compile_tfdata tfdata = graphmaker.handle_special_resources(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/terravision/modules/graphmaker.py", line 465, in handle_special_resources tfdata = getattr(resource_handlers, handler)(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/terravision/modules/resource_handlers.py", line 425, in aws_handle_dbsubnet tfdata["graphdict"][vpc].remove(dbsubnet) ValueError: list.remove(x): x not in list

I temporarily solved these by using try-catch blocks, but the generated image has too many issues to use.

Image

Are there any recommendations for solving these, or is this an issue with the code that needs to be fixed?

Originally created by @FerreJanssensPXL on GitHub (Apr 30, 2025). Original GitHub issue: https://github.com/patrickchugh/terravision/issues/139 I encountered 2 different errors when running Terravision: `Traceback (most recent call last): File "/Users/UNAME/Desktop/./terravision/terravision", line 289, in <module> cli( File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 207, in draw tfdata = compile_tfdata(source, varfile, workspace, debug, annotate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 72, in compile_tfdata tfdata = graphmaker.consolidate_nodes(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/terravision/modules/graphmaker.py", line 208, in consolidate_nodes resdata = tfdata["meta_data"][resource] ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ KeyError: 'aws_security_group_rule.allow_traffic_from_bastion_dev_ingress_ssh[1]~2'` ######################################################################################################### ######################################################################################################### `Traceback (most recent call last): File "/Users/UNAME/Desktop/./terravision/terravision", line 289, in <module> cli( File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/.pyenv/versions/test/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 207, in draw tfdata = compile_tfdata(source, varfile, workspace, debug, annotate) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/./terravision/terravision", line 76, in compile_tfdata tfdata = graphmaker.handle_special_resources(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/terravision/modules/graphmaker.py", line 465, in handle_special_resources tfdata = getattr(resource_handlers, handler)(tfdata) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/UNAME/Desktop/terravision/modules/resource_handlers.py", line 425, in aws_handle_dbsubnet tfdata["graphdict"][vpc].remove(dbsubnet) ValueError: list.remove(x): x not in list` I temporarily solved these by using try-catch blocks, but the generated image has too many issues to use. ![Image](https://github.com/user-attachments/assets/4d1c3e63-e8c4-451d-a695-1bec81bd3167) Are there any recommendations for solving these, or is this an issue with the code that needs to be fixed?
Author
Owner

@patrickchugh commented on GitHub (Dec 22, 2025):

@FerreJanssensPXL Does this happen with the latest code? Can you please use the --debug flag and attach the tfdata.json file so I can try to reproduce this? Or if you have a terraform git repo I can try to reproduce the error.

<!-- gh-comment-id:3681172440 --> @patrickchugh commented on GitHub (Dec 22, 2025): @FerreJanssensPXL Does this happen with the latest code? Can you please use the --debug flag and attach the tfdata.json file so I can try to reproduce this? Or if you have a terraform git repo I can try to reproduce the error.
Author
Owner

@patrickchugh commented on GitHub (Jan 3, 2026):

@FerreJanssensPXL Did you get a chance to check with latest code?

<!-- gh-comment-id:3706541985 --> @patrickchugh commented on GitHub (Jan 3, 2026): @FerreJanssensPXL Did you get a chance to check with latest code?
Author
Owner

@patrickchugh commented on GitHub (Jan 24, 2026):

closing due to no response

<!-- gh-comment-id:3794522175 --> @patrickchugh commented on GitHub (Jan 24, 2026): closing due to no response
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#81
No description provided.