Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when reading one of my state files #56

Open
red8888 opened this issue Jan 21, 2019 · 1 comment
Open

Error when reading one of my state files #56

red8888 opened this issue Jan 21, 2019 · 1 comment

Comments

@red8888
Copy link

red8888 commented Jan 21, 2019

Terraform v0.11.10

Im seeing this error (this is a valid tf config that applies successfully). Some other tf state it seems to work fine with, but this one it no like

  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [21/Jan/2019 09:38:05] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [21/Jan/2019 09:38:10] "GET / HTTP/1.1" 200 -
    127.0.0.1 - - [21/Jan/2019 09:38:12] "GET /graph.svg HTTP/1.1" 200 -
    [2019-01-21 09:38:14,328] ERROR in app: Exception on /graph.json [GET]
    Traceback (most recent call last):
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functionsrule.endpoint
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/blastradius/server/server.py", line 61, in graph_json
    tf = Terraform(os.getcwd())
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/blastradius/handlers/terraform.py", line 26, in init
    self.config = hcl.load(config_io)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/hcl/api.py", line 51, in load
    return loads(fp.read())
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/hcl/api.py", line 62, in loads
    return HclParser().parse(s)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/hcl/parser.py", line 307, in parse
    return self.yacc.parse(s, lexer=Lexer())
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/ply/yacc.py", line 1199, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/ply/yacc.py", line 193, in call_errorfunc
    r = errorfunc(token)
    File "/Users/meee/.pyenv/versions/3.6.5/lib/python3.6/site-packages/hcl/parser.py", line 300, in p_error
    raise ValueError(msg)
    ValueError: Line 171, column 6458: unexpected RIGHTBRACE
    127.0.0.1 - - [21/Jan/2019 09:38:14] "GET /graph.json HTTP/1.1" 500 -
@obourdon
Copy link

@red8888 most probably due to a bug/limit in py-hcl module like for this other issue

dustinlharrison added a commit to dustinlharrison/blast-radius that referenced this issue Nov 21, 2019
…8mm#71: work around pyhcl

virtuald/pyhcl#55: pyhcl doesn't support terraform v0.12

Resolve this temporarily by using the go library `hcl2json` which allows
colorization and rendering to still work.  JSON references don't appear
to work, but the package is still usable.

Add pipenv support and update documentation and Makefile to support the
external go package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants