dashpay / platform

L2 solution for seriously fast decentralized applications for the Dash network
https://dashplatform.readme.io/docs/introduction-what-is-dash-platform
MIT License
72 stars 39 forks source link

getDocuments using dapi-grpc Python client regularly fails with InactiveRpcError #391

Closed mayoreee closed 1 month ago

mayoreee commented 2 years ago

Several attempts to getDocuments using dapi-grpc Python client failed with InactiveRpcError

Expected Behavior

Return documents

Current Behavior

Throws error:

Exception:
<_InactiveRpcError of RPC that terminated with:
    status = StatusCode.DEADLINE_EXCEEDED
    details = "Deadline Exceeded"
    debug_error_string = "{"created":"@1651832078.957738000","description":"Deadline Exceeded","file":"src/core/ext/filters/deadline/deadline_filter.cc","file_line":81,"grpc_status":4}"
>

Steps to Reproduce (for bugs)

    def getDocuments(stub, params, options):
        #print(params)

        document_request = platform_pb2.GetDocumentsRequest()
        document_request.data_contract_id = params['data_contract_id']
        document_request.document_type =  params['document_type']
        document_request.where = params['where']
        document_request.order_by = params['order_by']
        document_request.limit =  params['limit']
        document_request.start_at =  params['start_at']
        document_request.start_after = params['start_after']

        response = stub.getDocuments(document_request, options['timeout'])

        documents = []
        for doc in response.documents:
             docBytes = doc[4 : len(doc)]
             documents.append(cbor2.loads(docBytes))

        return documents

platform_pb2 imported from here: https://github.com/dashevo/platform/blob/v0.23-dev/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py

Your Environment

shumkov commented 1 month ago

Please reopen if this issue still reproducting.