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

Unexpected identifier TF #69

Open
Marcus-James-Adams opened this issue Oct 13, 2019 · 1 comment
Open

Unexpected identifier TF #69

Marcus-James-Adams opened this issue Oct 13, 2019 · 1 comment

Comments

@Marcus-James-Adams
Copy link

TF version v.12.9
azure rm
running on windows 10.
I cant see how to witch debug mode on tried --debug, but if you can let me know I'll try again to get more info.

127.0.0.1 - - [13/Oct/2019 16:06:46] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [13/Oct/2019 16:06:49] "GET /graph.svg HTTP/1.1" 200 -
[2019-10-13 16:06:50,729] ERROR in app: Exception on /graph.json [GET]
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\flask\app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "C:\Python37\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Python37\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Python37\lib\site-packages\flask_compat.py", line 39, in reraise
raise value
File "C:\Python37\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Python37\lib\site-packages\flask\app.py", line 1935, in dispatch_request
return self.view_functionsrule.endpoint
File "C:\Python37\lib\site-packages\blastradius\server\server.py", line 61, in graph_json
tf = Terraform(os.getcwd())
File "C:\Python37\lib\site-packages\blastradius\handlers\terraform.py", line 26, in init
self.config = hcl.load(config_io)
File "C:\Python37\lib\site-packages\hcl\api.py", line 54, in load
return loads(fp.read())
File "C:\Python37\lib\site-packages\hcl\api.py", line 66, in loads
return HclParser().parse(s)
File "C:\Python37\lib\site-packages\hcl\parser.py", line 326, in parse
return self.yacc.parse(s, lexer=Lexer())
File "C:\Python37\lib\site-packages\ply\yacc.py", line 333, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "C:\Python37\lib\site-packages\ply\yacc.py", line 1201, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File "C:\Python37\lib\site-packages\ply\yacc.py", line 192, in call_errorfunc
r = errorfunc(token)
File "C:\Python37\lib\site-packages\hcl\parser.py", line 318, in p_error
raise ValueError(msg)
ValueError: Line 55, column 1607: unexpected IDENTIFIER
127.0.0.1 - - [13/Oct/2019 16:06:50] "GET /graph.json HTTP/1.1" 500 -

@mcdafydd
Copy link

mcdafydd commented Nov 7, 2019

I also get this error trying to generate the json for embedded use with TF v0.12.13.

Edit: Posted too soon - I see all the other issues about pyhcl and will investigate one of the forks for now.

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