cloudmapper
cloudmapper copied to clipboard
cloudmapper.py report: _pyjq.ScriptRuntimeError: Cannot iterate over null (null)
stats_config.yaml contains the following: query: '[.Reservations[].Instances[]|select(.State.Name == "running")]|length'
When I run the report module, I ge the null error.
I changed the above line to: query: '[.Reservations[]?.Instances[]|select(.State.Name == "running")]|length'
and this works.
same issue..
(cloudmapper) sh-3.2# python3 cloudmapper.py prepare --account prod
Building data for account prod (****************)
- 0 nodes built in region eu-north-1
- 0 nodes built in region ap-south-1
- 0 nodes built in region eu-west-3
- 0 nodes built in region eu-west-2
- 0 nodes built in region eu-west-1
- 0 nodes built in region ap-northeast-2
- 0 nodes built in region me-south-1
- 0 nodes built in region ap-northeast-1
- 0 nodes built in region sa-east-1
- 0 nodes built in region ca-central-1
- 0 nodes built in region ap-east-1
- 0 nodes built in region ap-southeast-1
- 0 nodes built in region ap-southeast-2
- 0 nodes built in region eu-central-1
Traceback (most recent call last):
File "cloudmapper.py", line 72, in <module>
main()
File "cloudmapper.py", line 66, in main
commands[command].run(arguments)
File "/../../TOOLS/RECON/cloudmapper/commands/prepare.py", line 831, in run
prepare(account, config, outputfilter)
File "/../../TOOLS/RECON/cloudmapper/commands/prepare.py", line 660, in prepare
cytoscape_json = build_data_structure(account, config, outputfilter)
File "/../../TOOLS/RECON/cloudmapper/commands/prepare.py", line 477, in build_data_structure
add_node_to_subnets(region, node, nodes)
File "/../../TOOLS/RECON/cloudmapper/commands/prepare.py", line 329, in add_node_to_subnets
if len(node.subnets) == 0 and node._parent and vpc.local_id == node._parent.local_id:
File "/../../TOOLS/RECON/cloudmapper/shared/nodes.py", line 498, in subnets
".DBSubnetGroup.Subnets[].SubnetIdentifier", self._json_blob
File "/****/.local/share/virtualenvs/cloudmapper-0c-dE7-r/lib/python3.7/site-packages/pyjq.py", line 49, in all
return compile(script, vars, library_paths).all(_get_value(value, url, opener))
File "_pyjq.pyx", line 209, in _pyjq.Script.all (_pyjq.c:2561)
_pyjq.ScriptRuntimeError: Cannot iterate over null (null)
(cloudmapper) sh-3.2#
same error
SAME ERROR.
Same error, but I will note that the line in stats_config.yaml for me says
query: '[.Reservations[]?.Instances[]?|select(.State.Name == "running")]|length'
Deleing the question mark after instances fixed nothing.
Same