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

Can't Import STIX package - KeyError: None #340

Open
packet-rat opened this issue Mar 30, 2018 · 1 comment
Open

Can't Import STIX package - KeyError: None #340

packet-rat opened this issue Mar 30, 2018 · 1 comment

Comments

@packet-rat
Copy link

After initial load of STIX Package, import fails when selecting [Import Selected and keep/delete others]. Failures occur across a full suite of Test STIX Packages that have loaded previously without issue.

FWIW: username is not equal to 'analyst'

self.updates[self.imported[id_][1]].save(username=analyst)
[Fri Mar 30 15:53:42.856387 2018] [wsgi:error] [pid 23154:tid 139743874414336] 1684932 ERROR: None
[Fri Mar 30 15:53:42.857479 2018] [wsgi:error] [pid 23154:tid 139743874414336] Traceback (most recent call last):
[Fri Mar 30 15:53:42.857486 2018] [wsgi:error] [pid 23154:tid 139743874414336]   File "/data/crits_services/taxii_service/handlers.py", line 2158, in import_standards_doc
[Fri Mar 30 15:53:42.857491 2018] [wsgi:error] [pid 23154:tid 139743874414336]     parser.relate_objects()
[Fri Mar 30 15:53:42.857495 2018] [wsgi:error] [pid 23154:tid 139743874414336]   File "/data/crits_services/taxii_service/parsers.py", line 1392, in relate_objects
[Fri Mar 30 15:53:42.857500 2018] [wsgi:error] [pid 23154:tid 139743874414336]     self.updates[self.imported[id_][1]].save(username=analyst)
[Fri Mar 30 15:53:42.857504 2018] [wsgi:error] [pid 23154:tid 139743874414336] KeyError: None
ERROR 2018-03-30 15:53:42,856 crits.taxii_service.handlers None
Traceback (most recent call last):
  File "/data/crits_services/taxii_service/handlers.py", line 2158, in import_standards_doc
    parser.relate_objects()
  File "/data/crits_services/taxii_service/parsers.py", line 1392, in relate_objects
    self.updates[self.imported[id_][1]].save(username=analyst)
KeyError: None
$ git status
HEAD detached at 6f29560
nothing to commit, working directory clean
ubuntu@crits:/data/crits$ cd ../crits_services/
ubuntu@crits:/data/crits_services$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    carbonblack_service/DEPENDENCIES
	deleted:    carbonblack_service/README
	deleted:    carbonblack_service/__init__.py
	deleted:    carbonblack_service/bootstrap
	deleted:    carbonblack_service/forms.py
	deleted:    carbonblack_service/requirements.txt

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	joesandbox_crits/

no changes added to commit (use "git add" and/or "git commit -a")

@brlogan
Copy link
Contributor

brlogan commented Apr 11, 2018

I have a theory about why you might be seeing this error, but I have not been able to confirm. The error seems to be saying that self.imported[id_][1] evaluates to None, but this should only happen when you're requesting a preview, not actually importing. However, when someone added RBAC support to the TAXII service, they modified the code in such a way that if one doesn't have the necessary access, the code treats that component as a preview, resulting in the None value.

So, first thing to try is ensure your user has full access rights for everything and see if that makes a difference.

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