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

jq: error: Cannot index array with string "ip" #3

Open
hbceylan opened this issue Jun 9, 2018 · 2 comments
Open

jq: error: Cannot index array with string "ip" #3

hbceylan opened this issue Jun 9, 2018 · 2 comments

Comments

@hbceylan
Copy link

hbceylan commented Jun 9, 2018

➜ ~ sh down-agents.sh agents.json
jq: error (at agents.json:14): Cannot index array with string "ip"

agents.json

{
  "windows" : [
    {
      "machine_ids" : [
        { "hostname" : "10.26.2.107", "ip" : "10.26.2.107" },
        { "hostname" : "10.26.2.5", "ip" : "10.26.2.5" }
      ],
      "unavailability" : {
        "start" : { "nanoseconds" : 1 },
        "duration" : { "nanoseconds" : 3600000000000 }
      }
    }
  ]
}
@nkhanal0
Copy link

I am getting a similar error: parse error: Invalid numeric literal at line 1, column 8

@digitalyuki
Copy link

@nkhanal0 that's a jq error... essentially jq is swallowing errors, if there's an error we don't necessarily get a json return, so jq is erroring out.

I am thinking of creating a PR to remove jq so we see the actual error message instead of ... not seeing it.

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

3 participants