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.

unexpected identifier error

See original GitHub issue

Hello, I’m trying this out with a terraform 0.12 project (which I suspect could be the root issue). The terraform is planned/applied successfully. The blast-radius graph draws on the screen but is not interactive. The blast-radius server shows this output:

[2019-05-30 13:06:33,958] ERROR in app: Exception on /graph.json [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2311, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1834, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1737, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 36, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1832, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1818, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.7/site-packages/blastradius/server/server.py", line 61, in graph_json
    tf = Terraform(os.getcwd())
  File "/usr/local/lib/python3.7/site-packages/blastradius/handlers/terraform.py", line 26, in __init__
    self.config = hcl.load(config_io)
  File "/usr/local/lib/python3.7/site-packages/hcl/api.py", line 54, in load
    return loads(fp.read())
  File "/usr/local/lib/python3.7/site-packages/hcl/api.py", line 66, in loads
    return HclParser().parse(s)
  File "/usr/local/lib/python3.7/site-packages/hcl/parser.py", line 326, in parse
    return self.yacc.parse(s, lexer=Lexer())
  File "/usr/local/lib/python3.7/site-packages/ply/yacc.py", line 333, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/local/lib/python3.7/site-packages/ply/yacc.py", line 1201, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/local/lib/python3.7/site-packages/ply/yacc.py", line 192, in call_errorfunc
    r = errorfunc(token)
  File "/usr/local/lib/python3.7/site-packages/hcl/parser.py", line 318, in p_error
    raise ValueError(msg)
ValueError: Line 18, column 423: unexpected IDENTIFIER
172.27.192.130 - - [30/May/2019 13:06:33] "GET /graph.json HTTP/1.1" 500 -

Is there a way to find the unexpected identifier to debug further? I tried running blast-radius with --debug but it was not a valid flag.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:10
  • Comments:13

github_iconTop GitHub Comments

2reactions
yourbuddyconnercommented, Jun 15, 2019

Relevant error: Error loading configuration: Error parsing <SNIP>: At 43:15: Unknown token: 43:15 IDENT data.aws_secretsmanager_secret.elasticsearch_additional_ips.id

Coincidentally, due to my plugins being out of date, my IDE tells me this this line is wrong when in reality it’s perfectly valid in TF 0.12.x:

data "aws_secretsmanager_secret_version" "selected" {
  secret_id = data.aws_secretsmanager_secret.elasticsearch_additional_ips.id
}

When changed to the following, the error in blast-radius goes away:

data "aws_secretsmanager_secret_version" "selected" {
  secret_id = "${data.aws_secretsmanager_secret.elasticsearch_additional_ips.id}"
}

And I run into another one stemming from my use of the compact function which is valid in terraform 0.12.x.

This leads me to believe it’s just an out of date HCL parser that doesn’t support TF 0.12.x.

1reaction
obourdoncommented, Jun 15, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Solve The Unexpected Identifier Error in JavaScript
How do you fix this Unexpected identifier error in your code? The simplest thing you can do to find a specific error like...
Read more >
SyntaxError: Unexpected identifier in JavaScript [Solved]
To solve the "Uncaught SyntaxError: Unexpected identifier" error, make sure you don't have any misspelled keywords, e.g. Let or Function instead of let...
Read more >
A Common Cause of "Uncaught syntax error - Techstacker
A Common Cause of "Uncaught syntax error: unexpected identifier" in JavaScript ... One of the most common reasons is that you're trying to...
Read more >
Unexpected Identifier in Chrome's Javascript console
I got this error Unexpected identifier because of a missing semi-colon ; at the end of a line. Anyone wandering here for other...
Read more >
How to Fix "Uncaught SyntaxError: Unexpected identifier" in ...
What causes this error? · A missing bracket, quote, parenthesis, etc. · Extra brackets, quotes, parenthesis, etc. · A typo in a keyword...
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