cloudmapper icon indicating copy to clipboard operation
cloudmapper copied to clipboard

Collection is not updating

Open planzone opened this issue 4 years ago • 7 comments

Hi I have cloudmapper running in a container.

I noticed my collection hasn't been update in a while (like over a year ago) on the page http://my_internal_ip/account-data/report.htm

It would show the account name, id and a collection date that is very old thus my data is also stale

I logged into the container and ran python cloudmapper.py collect --account myaccountname it went through and ran with out issue. Waited about an hour and refresh the pages and still shows the old date.

Also the account I ran it against I checked resources such as some users and buckets and the report isn't accurate I am so certain it is ignorance on my part. Any hints to get me back on track?

if I run to report command I would get the following: Getting resource counts Traceback (most recent call last): File "cloudmapper.py", line 72, in main() File "cloudmapper.py", line 66, in main commands[command].run(arguments) File "/opt/cloudmapper/commands/report.py", line 471, in run report(accounts, config, args) File "/opt/cloudmapper/commands/report.py", line 101, in report account, args.stats_all_resources File "/opt/cloudmapper/shared/common.py", line 297, in get_account_stats query_aws(region.account, resource["source"], region), File "/usr/local/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)

planzone avatar Mar 04 '21 22:03 planzone

Hello @planzone , it seems that it's trying to iterate over a null value here: https://github.com/duo-labs/cloudmapper/blob/bebf0d1a8f785b5d99995a9f120426b6ab3df4ee/shared/common.py#L298 Because somehow it didn't retrieve any value. Maybe we can add a check there so pyjq doesn't iterate over null? What do you think?

w0rmr1d3r avatar Mar 05 '21 10:03 w0rmr1d3r

What I think? I do not think I am qualified to say. Let me know what the changes are and I can try.

planzone avatar Mar 05 '21 16:03 planzone

@0xdabbad00 the function query_aws is returning null , but I can't see the error. It might be loading and empty .json file? Thus, returning null but not a valid {} ?

w0rmr1d3r avatar Mar 08 '21 07:03 w0rmr1d3r

I am having this same issue.

Is there a resolution for this?

lofzee avatar Mar 27 '21 21:03 lofzee

I am having this same issue.

Is there a resolution for this?

Hello @lofzee , not for the moment, will try to work on a fix in the next weeks to come :)

w0rmr1d3r avatar Mar 28 '21 11:03 w0rmr1d3r

Hi, just hitting same issue now also, any suggestions yet to resolve this ?

gnewso2909 avatar Apr 29 '21 15:04 gnewso2909

Hello @gnewso2909 , Can't work on the fix right now, but I know there's one! As said earlier in this issue -> https://github.com/duo-labs/cloudmapper/issues/845#issuecomment-792550928 There might be a try-catch that we aren't doing. However, this project lacks of participation for the moment :( very very sad

w0rmr1d3r avatar Apr 29 '21 15:04 w0rmr1d3r