question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'NoneType' object has no attribute 'groupdict'

See original GitHub issue

Issue Description

Terraform 0.13.2 OS Ubuntu 20.04 Install via pip

[2020-09-14 18:24:52,501] ERROR in app: Exception on /graph.svg [GET]
Traceback (most recent call last):
  File "/home/pepodev/.local/lib/python3.8/site-packages/blastradius/handlers/dot.py", line 455, in _module
    return m.groupdict()['module']
AttributeError: 'NoneType' object has no attribute 'groupdict'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pepodev/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/pepodev/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/pepodev/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/pepodev/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/pepodev/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/pepodev/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/pepodev/.local/lib/python3.8/site-packages/blastradius/server/server.py", line 36, in graph_svg
    dot = DotGraph('', file_contents=run_tf_graph())
  File "/home/pepodev/.local/lib/python3.8/site-packages/blastradius/handlers/dot.py", line 56, in __init__
    self.nodes.append(DotNode(e.target))
  File "/home/pepodev/.local/lib/python3.8/site-packages/blastradius/handlers/dot.py", line 415, in __init__
    self.module         = DotNode._module(self.label) # for module groupings. 'root' or 'module.foo.module.bar'
  File "/home/pepodev/.local/lib/python3.8/site-packages/blastradius/handlers/dot.py", line 457, in _module
    raise Exception("None: ", label)
Exception: ('None: ', '[root] module.allow_nfs (close)')

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:24
  • Comments:12

github_iconTop GitHub Comments

9reactions
leriksencommented, Feb 8, 2021

I got it to render a graph by changing the regex as well, in blastradius/handlers/dot.py to be

m = re.match(r'(\[root\]\s+)*(?P<module>\S+)\.(?P<type>\S+)[. ]\S+', label)

Not the [. ] after the capture for the <type> group. The offending label that was crashing for me was

[root] module.kv (close)

This character class handles a . or a \s after a module type

I’ll submit a PR maybe by the weekend

7reactions
PePoDevcommented, Feb 20, 2021

Closed. I found alternative to visual infrastructure from Terraform.

https://github.com/cycloidio/inframap https://github.com/pcasteran/terraform-graph-beautifier

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'NoneType' object has no attribute 'groupdict'
'NoneType' object has no attribute 'groupdict' means you are calling the method groupdict() on an object containing None.
Read more >
AttributeError: 'NoneType' object has no attribute 'group'
The Python "AttributeError: 'NoneType' object has no attribute" occurs when we try to call the group() method on a None value, e.g. after...
Read more >
AttributeError: 'NoneType' object has no attribute ... - Treehouse
AttributeError : 'NoneType' object has no attribute 'groupdict' With mine and Kenneth's code. Here is my code:.
Read more >
AttributeError: 'NoneType' object has no ... - Google Groups
Hi,. I am trying to read existing excel file to update some values. But OpenPyExcel giving "AttributeError: 'NoneType' object has no attribute ' ......
Read more >
[Solved] AttributeError: Nonetype Object Has No Attribute Group
In this article we will discuss AttributeError:Nonetype object has no Attribute Group. We will understand it and then find solution for it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found