bcgov / aries-vcr

Hyperledger Aries Verifiable Credential Registry (VCR) is a set of application level software components designed to accelerate the adoption of trustworthy entity to entity communications.
Apache License 2.0
78 stars 70 forks source link

Server Error (500) from `/topic/{id}/credentialset` #486

Closed WadeBarnes closed 4 years ago

WadeBarnes commented 4 years ago

Found in:

Steps to reproduce:

Expected result:

Observed Result: image

Error Log:

ERROR 2020-04-24 21:16:51,455 log 1 140514946967296 Internal Server Error: /api/topic/170966/credentialset
Traceback (most recent call last):
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/rest_framework/viewsets.py", line 114, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/home/indy/.pyenv/versions/3.6.8/lib/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/indy/api/v2/views/rest.py", line 271, in list_credential_sets
    for credential_set in credential_sets
  File "/home/indy/api/v2/views/rest.py", line 271, in <listcomp>
    for credential_set in credential_sets
  File "/home/indy/api/v2/views/rest.py", line 268, in <listcomp>
    for credential in credential_set.credentials.all()
  File "/home/indy/api/v2/views/rest.py", line 261, in <listcomp>
    for related_topic in credential.related_topics.all()
AttributeError: 'NoneType' object has no attribute 'id'
WadeBarnes commented 4 years ago

Other examples of this issue:

ianco commented 4 years ago

Company BC0131809

ianco commented 4 years ago

Seems to be missing FM0149073 in this environment

WadeBarnes commented 4 years ago

Seems to be missing FM0149073 in this environment

The dev environment is only a partial data load. So that's not completely surprising. The ones from test will be interesting to re-visit after the load is complete.

ianco commented 4 years ago

I've duplicated this locally so am fixing the "500 server error"

WadeBarnes commented 4 years ago

Other examples of this issue:

The errors with these records went away after the complete data load was finished.

WadeBarnes commented 4 years ago

Resolved in 25c1c3a0b961ab4a0b82bd18b0ce0778a1d9bb18

Ensured FM0149073 still does not exist: image

Viewed page for BC0131809: image