Skip to content

Metadata API does not return components through GRPC  #5051

@tmacam

Description

@tmacam

In what area(s)?

/area runtime

What version of Dapr?

edge: v1.7.0-rc.4-504-g032581df-dirty

032581d

Expected Behavior

While invoking GetMetadata through GRPC, the contents of the registeredComponents field should be non-empty and match what is returned by the corresponding HTTP API:

The HTTP response:

{
  "id": "my-metadata-app",
  "actors": [],
  "extended": {
    "cliPID": "20746",
    "daprRuntimeVersion": "edge"
  },
  "components": [
    {
      "name": "lockstore",
      "type": "lock.redis",
      "version": "",
      "capabilities": []
    },
    {
      "name": "pubsub",
      "type": "pubsub.redis",
      "version": "v1",
      "capabilities": []
    },
    {
      "name": "statestore",
      "type": "state.redis",
      "version": "v1",
      "capabilities": [
        "ETAG",
        "TRANSACTIONAL",
        "QUERY_API",
        "ACTOR"
      ]
    }
  ]
}

Actual Behavior

Right now, with the current HEAD of dapr/dapr, this is the returned GetMetadataReponse comes with no registered_components entries:

id: "my-metadata-app"
extended_metadata {
  key: "daprRuntimeVersion"
  value: "edge"
}
extended_metadata {
  key: "is-this-our-metadata-example"
  value: "yes"
}

Notice the absence of any registered_components object in the response.

Steps to Reproduce the Problem

  1. Override your ~/.dapr/bin/dapr with the a fresh build from dapr/dapr

  2. Use the setup from examples/metadata from Metadata API support for Python GRPC clients. python-sdk#446

  3. Instrument Python SDK client code to output the returned GetMetadataResponse protobuf object as-is:

    --- a/dapr/clients/grpc/client.py
    +++ b/dapr/clients/grpc/client.py
    @@ -1137,6 +1137,7 @@ class DaprGrpcClient:
            """
            _resp, call = self._stub.GetMetadata.with_call(GrpcEmpty())
            response: api_v1.GetMetadataResponse = _resp  # type alias
    +        print(response)
            # Convert to more pythonic formats
            active_actors_count = {
                type_count.type: type_count.count
  4. Run the code as pointed out in `examples/metadata/README.md:

    cd examples/metadata
    dapr run --app-id=my-metadata-app --app-protocol grpc --components-path components/ python3 app.py
    
  5. At this point you observed the problem with the GRPC endpoint.

  6. To baseline this problem, we also need to retrieve the result of the Metadata API using its HTTP endpoint. Start dapr with HTTP using the same components path :

    # In the same directory you just ran the code above
    dapr run --app-id=my-metadata-app --dapr-http-port=3500 --components-path components/
    
  7. and retrieve the metadata:

    curl http://localhost:3500/v1.0/metadata | jq
    
  8. Notice the difference in the number of returned components.

Release Note

RELEASE NOTE: FIX Fix missing registered_components in GRPC Metadata API

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions