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 67 forks source link

BC Gov Instance - Errors posting credentials #751

Closed WadeBarnes closed 1 year ago

WadeBarnes commented 1 year ago

Receiving the following errors posting credentials.

ERROR 2023-06-20 06:29:44,354 views 1 140521995925056  >>> Received duplicate for credential_id: a696c6b9-4502-4981-8f77-78b5fe021709, exch id: e0a4339d-acae-4dc0-998b-3a82c064fa8c
ERROR 2023-06-20 06:29:44,355 utils 1 140521995925056 Agent connection raised exception, raise: __init__() got an unexpected keyword argument 'method_whitelist'
ERROR 2023-06-20 06:29:44,355 views 1 140521995925056 __init__() got an unexpected keyword argument 'method_whitelist'
ERROR 2023-06-20 06:29:44,355 views 1 140521995925056 Send problem report for e0a4339d-acae-4dc0-998b-3a82c064fa8c
ERROR 2023-06-20 06:29:44,355 utils 1 140521995925056 Agent connection raised exception, raise: __init__() got an unexpected keyword argument 'method_whitelist'
ERROR 2023-06-20 06:29:44,382 log 1 140521995925056 Internal Server Error: /agentcb/topic/issue_credential/
Traceback (most recent call last):
  File "/opt/app-root/src/agent_webhooks/views.py", line 189, in handle_credentials
    return receive_credential(credential_exchange_id, credential_data)
  File "/opt/app-root/src/agent_webhooks/views.py", line 588, in receive_credential
    raise e
  File "/opt/app-root/src/agent_webhooks/views.py", line 549, in receive_credential
    resp = call_agent_with_retry(
  File "/opt/app-root/src/api/v2/utils.py", line 268, in call_agent_with_retry
    retry = Retry(
TypeError: __init__() got an unexpected keyword argument 'method_whitelist'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/app-root/lib64/python3.9/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/app-root/lib64/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/app-root/lib64/python3.9/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/app-root/lib64/python3.9/site-packages/rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "/opt/app-root/lib64/python3.9/site-packages/rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/app-root/lib64/python3.9/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "/opt/app-root/lib64/python3.9/site-packages/rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/app-root/lib64/python3.9/site-packages/rest_framework/decorators.py", line 50, in handler
    return func(*args, **kwargs)
  File "/opt/app-root/src/agent_webhooks/views.py", line 69, in agent_callback
    response = handle_credentials(state, message)
  File "/opt/app-root/src/agent_webhooks/views.py", line 199, in handle_credentials
    resp = call_agent_with_retry(
  File "/opt/app-root/src/api/v2/utils.py", line 268, in call_agent_with_retry
    retry = Retry(
TypeError: __init__() got an unexpected keyword argument 'method_whitelist'

cc @swcurran, @esune, @amanji

WadeBarnes commented 1 year ago

Currently there is a large backlog of credentials for some reason:

BC_REG : Table: event_by_corp_filing Processed: 10630604 Outstanding: 5
BC_REG :        event_by_corp_filing Process Errors: 0
BC_REG : Table: corp_history_log Processed: 8272295 Outstanding: 0
BC_REG :        corp_history_log Process Errors: 0
BC_REG : Table: credential_log Processed: 5232723 Outstanding: 9288
BC_REG :        credential_log Process Errors: 0
BCREG_LEAR : Table: event_by_corp_filing Processed: 32184 Outstanding: 2
BCREG_LEAR :        event_by_corp_filing Process Errors: 0
BCREG_LEAR : Table: corp_history_log Processed: 29472 Outstanding: 0
BCREG_LEAR :        corp_history_log Process Errors: 0
BCREG_LEAR : Table: credential_log Processed: 50682 Outstanding: 2515
BCREG_LEAR :        credential_log Process Errors: 0
WadeBarnes commented 1 year ago

Possible issue is method_whitelist parameter being changed to allowed_methods in urllib3. The API is using urllib3 v2.0.2.

WadeBarnes commented 1 year ago

Confirmed the issue; https://urllib3.readthedocs.io/en/2.0.2/reference/urllib3.util.html#urllib3.util.Retry

In urllib3 v2.0.2 the Retry class uses allowed_methods, not method_whitelist.