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

Failed to import ISO 27001-2022 library #30

Closed
IEEInfraPCE opened this issue Jan 30, 2024 · 1 comment
Closed

Failed to import ISO 27001-2022 library #30

IEEInfraPCE opened this issue Jan 30, 2024 · 1 comment

Comments

@IEEInfraPCE
Copy link

Describe the bug
Similar to #14

Internal Server error 500

To Reproduce
Steps to reproduce the behavior:

  1. Import ISO 27001-2022 framework

Expected behavior
Import works as expected

Screenshots
image
image

Environment (please complete the following information):

  • OS: Debian 12
  • Python: 3.11
  • Git repo hash:
git rev-parse --verify HEAD
5c4051040f572fb3efafeee0dd0d16a40d6e6b8e

git rev-parse --branches
5c4051040f572fb3efafeee0dd0d16a40d6e6b8e

git rev-parse --remotes
5c4051040f572fb3efafeee0dd0d16a40d6e6b8e
a9a6d866e7c52623969138079bfb0fbfb05785e6
b19b1e005044ace506dae5d9d233e4e50b89bcdf
d373310ac476ba4c4d5bd52e0e26af2dfa39fee6
7f9dd77973a8bb69eec4755735b2054e1dba6dec
5c4051040f572fb3efafeee0dd0d16a40d6e6b8e

Additional context
Debug log

[30/Jan/2024 07:53:33] "POST /accounts/login/?next=/libraries/import_default_library/urn%3Aintuitem%3Arisk%3Alibrary%3Aiso27001-2022 HTTP/1.1" 302 0
Internal Server Error: /libraries/import_default_library/urn:intuitem:risk:library:iso27001-2022
Traceback (most recent call last):
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/db/models/query.py", line 916, in get_or_create
    return self.get(**kwargs), False
           ^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/db/models/query.py", line 637, in get
    raise self.model.DoesNotExist(
core.models.SecurityFunction.DoesNotExist: SecurityFunction matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/library/views.py", line 82, in import_default_library
    raise e
  File "/root/ciso-assistant-community/library/views.py", line 80, in import_default_library
    import_library_view(request, library)
  File "/root/ciso-assistant-community/library/utils.py", line 355, in import_library_view
    import_objects(objects_imported)
  File "/root/ciso-assistant-community/library/utils.py", line 303, in import_objects
    import_security_function(security_function)
  File "/root/ciso-assistant-community/library/utils.py", line 274, in import_security_function
    security_function = SecurityFunction.objects.update_or_create(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/db/models/query.py", line 949, in update_or_create
    obj, created = self.select_for_update().get_or_create(defaults, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/db/models/query.py", line 923, in get_or_create
    return self.create(**params), True
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/ciso-assistant-community/venv/lib/python3.11/site-packages/django/db/models/query.py", line 658, in create
    obj.save(force_insert=True, using=self.db)
  File "/root/ciso-assistant-community/core/base_models.py", line 95, in save
    self.clean()
  File "/root/ciso-assistant-community/core/base_models.py", line 92, in clean
    raise ValidationError(field_errors)
django.core.exceptions.ValidationError: {'name': ['Value already used in this scope.']}
[30/Jan/2024 07:53:34] "GET /libraries/import_default_library/urn:intuitem:risk:library:iso27001-2022 HTTP/1.1" 500 192245
@eric-intuitem
Copy link
Collaborator

This problem is due to the dependency between ISO27001 library and documents library.
We have pushed a major update to our codebase, with a Svelte frontend, and much more powerful library management, including dependency management.
Please pull the latest version, start from a fresh database, and see our new improved libraries!

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