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

Importing OCAL 1.0.0 catalog causes Exception Type: KeyError at /controls/ #1735

Open
gbrown-gis opened this issue Dec 31, 2021 · 1 comment

Comments

@gbrown-gis
Copy link

Describe the bug as a Story
After importing https://raw.githubusercontent.com/GSA/fedramp-automation/master/dist/content/baselines/rev4/json/FedRAMP_rev4_MODERATE-baseline-resolved-profile_catalog.json into GUI: Database Administration -> Catalog datas, going to "Control" tab results in "Exception Type: KeyError at /controls/"

To Reproduce
Steps to reproduce the behavior:

  1. Go to (GUI) Database Administration -> Catalog datas
  2. Click on add to paste in catalog and baseline. Add https://raw.githubusercontent.com/GSA/fedramp-automation/master/dist/content/baselines/rev4/json/FedRAMP_rev4_MODERATE-baseline-resolved-profile_catalog.json to catalog. Baseline left null. Click "Save".
  3. Saved catalog shows up in list.
  4. Click on the upper right corner "visit site" that is next to the welcome user.
  5. Click on the "Controls" tab.
  6. See error page showing "Exception Type: KeyError at /controls/"

Expected behavior
An imported catalog listed in the results

Screenshots
51d4a867-f9cd-4b2a-abdf-5fd844c6b755
Screen Shot 2021-12-31 at 3 20 43 PM
32c799df-39a7-463f-b256-49b4d320b7bc
ad67b468-a447-4587-b2ca-f69774971bb4
Screen Shot 2021-12-31 at 3 32 12 PM
Screen Shot 2021-12-31 at 3 33 17 PM

Desktop (please complete the following information):

  • OS: macOS 11.6 (20G165)
  • Browser: Safari
  • Version: 15.1 (16612.2.9.1.30, 16612)
  • Virtual Machine: No, developer deployment through github.com clone.

Developer hints

  • Tested adding existing NIST rev 5 catalog by cutting and pasting into a new catalog under a new id. That worked.

9823f1d (HEAD -> main, origin/main, origin/HEAD, lib-fix) main@{0}: clone: from github.com:GovReady/govready-q.git

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/controls/

Django Version: 3.2.5
Python Version: 3.9.9

Error

Traceback (most recent call last):
File "/Users/XXXX/Library/Python/3.9/lib/python/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/Users/XXXX/Library/Python/3.9/lib/python/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/XXXX/Development/github/govready-q/controls/views.py", line 70, in catalogs
"catalogs": Catalogs(),
File "/Users/XXXX/Development/github/govready-q/controls/oscal.py", line 43, in init
self.index = self._build_index()
File "/Users/XXXX/Development/github/govready-q/controls/oscal.py", line 58, in build_index
{'id': catalog['id'], 'catalog_key': catalog_key, 'catalog_key_display': catalog_key.replace("", " "),

Exception Type: KeyError at /controls/
Exception Value: 'id'

Acceptance criteria

GIVEN I import a OSCAL 1.0.0 Catalog and compatible Baseline into database catalog such as https://raw.githubusercontent.com/GSA/fedramp-automation/master/dist/content/baselines/rev4/json/FedRAMP_rev4_MODERATE-baseline-resolved-profile_catalog.json
WHEN I click on "Controls"
THEN The imported catalog should appear.

Additional context
Add any other context about the problem here.

Links referenced in issue

@rylew1
Copy link

rylew1 commented Sep 8, 2022

@gbrown-gis were you able to resolve this ?

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

2 participants