Skip to content

Invoking a service method inside an Actor method doesn't work #260

@omidb

Description

@omidb

Expected Behavior

Invoking a service method inside an actor method should simply work.

async def create_something(self, request: dict) -> object:
        """Creating something"""
        with DaprClient() as d:
            d.publish_event("pubsub", "TOPIC_A", "") #this works
            # following doesn't work with/without await
            d.invoke_method(
                    'myservice',
                    'doSomething',
                    "{}")

Actual Behavior

== APP == dapr.clients.exceptions.DaprInternalError: ('error invoke actor method: rpc error: code = Internal desc = error invoke actor method: error from actor service: {"message":"RuntimeError(\'asyncio.run() cannot be called from a running event loop\')","errorCode":"UNKNOWN"}', 'ERR_ACTOR_INVOKE_METHOD'

Steps to Reproduce the Problem

invoke a method inside an actor. Workaround from @wcs1only:

export DAPR_API_METHOD_INVOCATION_PROTOCOL=grpc

Release Note

RELEASE NOTE:

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions