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

Stack trace on incorrect PMAPPER_STORAGE environment variable #134

Open
rdegraaf opened this issue Aug 22, 2023 · 0 comments
Open

Stack trace on incorrect PMAPPER_STORAGE environment variable #134

rdegraaf opened this issue Aug 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@rdegraaf
Copy link

rdegraaf commented Aug 22, 2023

Describe the bug
If a user attempts to re-use pre-gathered data from a custom storage location but gives an incorrect path, the application dumps a stack trace.

To Reproduce
Steps to reproduce the behavior, please include information on suspected users/roles that are the source of the issue when possible:

  1. Gather data for some account 1234567899012, storing the data in a custom location (PMAPPER_STORAGE=/tmp/pmapper pmapper graph create, etc.)

  2. Attempt to use that data but give the wrong path (PMAPPER_STORAGE=/tmp/pmapper/123456789012 pmapper analyze)

  3. Stack trace:

     Traceback (most recent call last):
       File "/home/rdegraaf/aws-venv/bin/pmapper", line 8, in <module>
         sys.exit(main())
       File "/home/rdegraaf/aws-venv/lib/python3.8/site-packages/principalmapper/__main__.py", line 157, in main
         return analysis_cli.process_arguments(parsed_args)
       File "/home/rdegraaf/aws-venv/lib/python3.8/site-packages/principalmapper/analysis/cli.py", line 45, in process_arguments
         graph = graph_actions.get_existing_graph(session, parsed_args.account)
       File "/home/rdegraaf/aws-venv/lib/python3.8/site-packages/principalmapper/graphing/graph_actions.py", line 75, in get_existing_graph
         graph = get_graph_from_disk(get_default_graph_path(account))
       File "/home/rdegraaf/aws-venv/lib/python3.8/site-packages/principalmapper/graphing/graph_actions.py", line 65, in get_graph_from_disk
         return Graph.create_graph_from_local_disk(location)
       File "/home/rdegraaf/aws-venv/lib/python3.8/site-packages/principalmapper/common/graphs.py", line 132, in create_graph_from_local_disk
         raise ValueError('Did not find file at: {}'.format(rootpath))
     ValueError: Did not find file at: /tmp/pmapper/123456789012/123456789012
    

Expected behavior
A useful error message with no stack trace.

@rdegraaf rdegraaf added the bug Something isn't working label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant