patrickchugh / terravision

Terravision creates Professional Cloud Architecture Diagrams from your Terraform code automatically. Supports AWS, Google and Azure.
Mozilla Public License 2.0
821 stars 78 forks source link

KeyError Unhandled error: <class 'KeyError'>, 'count', <traceback object at 0x7fec41ed67c0> #100

Open simon-pp opened 10 months ago

simon-pp commented 10 months ago

terravision draw --source --show

Key error from debug, terraform provider is aws

Traceback (most recent call last): File "terravision/terravision", line 245, in <module> cli( File "/home/simon/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/home/simon/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/home/simon/.local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/simon/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/simon/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "terravision/terravision", line 169, in draw tfdata = compile_tfdata(source, varfile, debug, annotate) File "terravision/terravision", line 72, in compile_tfdata tfdata = graphmaker.handle_special_resources(tfdata) File "terravision/modules/graphmaker.py", line 462, in handle_special_resources tfdata = getattr(resource_handlers, handler)(tfdata) File "terravision/modules/resource_handlers.py", line 154, in aws_handle_subnet_azs tfdata["meta_data"][az]["count"] = tfdata["meta_data"][subnet]["count"] KeyError: 'count'

macindra commented 9 months ago

It happens the same for me. Any update about this error?

haisumriaz-tkxel commented 7 months ago

now we stuck on this error here @patrickchugh

Dgmmarian commented 7 months ago

hi, any updates here?

patrickchugh commented 7 months ago

Working on a new version that fixes a lot of bugs will be pushed to main in 2 or 3 days

haisumriaz-tkxel commented 7 months ago

Thanks for the feedback! Much Appreciated!

patrickchugh commented 7 months ago

If you want to be sure your TF code will work please share with me so I can run tests before release the next version

haisumriaz-tkxel commented 7 months ago

it wasn't much, just modularised AWS specific code to create a basic vpc, and subnet to launch an ec2 instance, nothing special

AlexisDaciuk commented 6 months ago

+1 , same error here, is that release coming soon?

patrickchugh commented 6 months ago

@AlexisDaciuk @haisumriaz-tkxel can you try with the latest release?

AlexisDaciuk commented 6 months ago

Hi, now it fails with

Unhandled error: <class 'IndexError'>, list index out of range, <traceback object at 0x7fb3bfb0c640>

Unfortunately I won't be able to debug more this week, maybe friday, what info will be useful for debugging this?