Can't get hello-world run locally. Error code: ERR_DIRECT_INVOKE
See original GitHub issueAsk your question here
I could not get the hello-world example work on my Mac Big Sur. I tried both 0.11.3
and 1.0.0-rc.2
:
➜ dapr11 --version
CLI version: 0.11.0
Runtime version: 0.11.3
➜ dapr11 invoke --app-id nodeapp --method neworder --payload "{\"data\": { \"orderId\": \"42\" } }"
{"errorCode":"ERR_DIRECT_INVOKE","message":"couldn't find service: nodeapp"}
✅ App invoked successfully
Then I tried with 1.0.0-rc3
➜ dapr --version
CLI version: 1.0.0-rc.3
Runtime version: 1.0.0-rc.2
➜ dapr invoke --app-id nodeapp --method neworder --data "{\"data\": { \"orderId\": \"42\" } }"
{"errorCode":"ERR_DIRECT_INVOKE","message":"fail to invoke, id: nodeapp, err: couldn't find service: nodeapp"}
✅ App invoked successfully
➜ dapr list
APP ID HTTP PORT GRPC PORT APP PORT COMMAND AGE CREATED PID
nodeapp 3500 52047 3000 node app.js 5m 2021-01-02 16:58.24 6144
The log of the hello-world node app on 1.0.0-rc.2
➜ dapr run --log-level debug --app-id nodeapp --app-port 3000 --dapr-http-port 3500 node app.js
ℹ️ Starting Dapr with id nodeapp. HTTP Port: 3500. gRPC Port: 52047
== DAPR == time="2021-01-02T16:58:25.068394+01:00" level=info msg="starting Dapr Runtime -- version 1.0.0-rc.2 -- commit 196483d" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.068436+01:00" level=info msg="log level set to: debug" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.068582+01:00" level=info msg="metrics server started on :52048/" app_id=nodeapp instance=macBigSur.local scope=dapr.metrics type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.06913+01:00" level=info msg="standalone mode configured" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.069145+01:00" level=info msg="app id: nodeapp" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.069345+01:00" level=info msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.069798+01:00" level=info msg="local service entry announced: nodeapp -> 192.168.0.94:52052" app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.069816+01:00" level=info msg="Initialized name resolution to standalone" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.070927+01:00" level=debug msg="loading component. name: pubsub, type: pubsub.redis" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.074415+01:00" level=info msg="component loaded. name: pubsub, type: pubsub.redis" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.074478+01:00" level=debug msg="loading component. name: statestore, type: state.redis" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.074519+01:00" level=info msg="waiting for all outstanding components to be processed" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.078914+01:00" level=info msg="component loaded. name: statestore, type: state.redis" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.078951+01:00" level=info msg="all outstanding components processed" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079056+01:00" level=info msg="enabled gRPC tracing middleware" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.grpc.api type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.07908+01:00" level=info msg="enabled gRPC metrics middleware" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.grpc.api type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079162+01:00" level=info msg="API gRPC server is running on port 52047" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079335+01:00" level=info msg="enabled metrics http middleware" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.http type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079351+01:00" level=info msg="enabled tracing http middleware" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.http type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079365+01:00" level=info msg="http server is running on port 3500" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079423+01:00" level=info msg="enabled gRPC tracing middleware" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.grpc.internal type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079447+01:00" level=info msg="enabled gRPC metrics middleware" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.grpc.internal type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.07948+01:00" level=info msg="internal gRPC server is running on port 52052" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.079503+01:00" level=info msg="application host: 127.0.0.1. application protocol: http. waiting on port 3000. This will block until the app is listening on that port." app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== APP == Node App listening on port 3000!
== DAPR == time="2021-01-02T16:58:25.186315+01:00" level=info msg="application discovered on port 3000" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.19432+01:00" level=info msg="application configuration loaded" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.194538+01:00" level=info msg="actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.194594+01:00" level=debug msg="try to connect to placement service: dns:///localhost:50005" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor.internal.placement type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.196183+01:00" level=debug msg="user app did not subscribe to any topic" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.196203+01:00" level=debug msg="app responded with subscriptions []" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:25.196595+01:00" level=info msg="dapr initialized. Status: Running. Init Elapsed 127.46ms" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime type=log ver=1.0.0-rc.2
ℹ️ Updating metadata for app command: node app.js
✅ You're up and running! Both Dapr and your app logs will appear here.
== DAPR == time="2021-01-02T16:58:31.287689+01:00" level=debug msg="established connection to placement service at dns:///localhost:50005" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor.internal.placement type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:31.293385+01:00" level=debug msg="placement order received: lock" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor.internal.placement type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:31.293501+01:00" level=debug msg="placement order received: update" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor.internal.placement type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:31.293535+01:00" level=info msg="placement tables updated, version: 0" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor.internal.placement type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:31.293556+01:00" level=debug msg="placement order received: unlock" app_id=nodeapp instance=macBigSur.local scope=dapr.runtime.actor.internal.placement type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:50.887756+01:00" level=debug msg="no mDNS address found in cache, browsing network for app id nodeapp" app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:50.887791+01:00" level=debug msg="Browsing for first mDNS address for app id nodeapp" app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:51.889089+01:00" level=debug msg="Browsing for first mDNS address for app id nodeapp timed out." app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:51.889098+01:00" level=debug msg="mDNS browse for app id nodeapp timed out." app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:55.069395+01:00" level=debug msg="Refreshing all mDNS addresses." app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
== DAPR == time="2021-01-02T16:58:55.069474+01:00" level=debug msg="no mDNS apps to refresh." app_id=nodeapp instance=macBigSur.local scope=dapr.contrib type=log ver=1.0.0-rc.2
log of placement service
➜ docker logs dapr_placement
time="2021-01-02T15:57:40.736962633Z" level=info msg="starting Dapr Placement Service -- version 1.0.0-rc.2 -- commit 196483d" instance=02e30fdfef59 scope=dapr.placement type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:40.737090596Z" level=info msg="log level set to: info" instance=02e30fdfef59 scope=dapr.placement type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:40.737380638Z" level=info msg="metrics server started on :9090/" instance=02e30fdfef59 scope=dapr.metrics type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:40.737686288Z" level=info msg="Raft server is starting on 127.0.0.1:8201..." instance=02e30fdfef59 scope=dapr.placement.raft type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:40.737736627Z" level=info msg="placement service started on port 50005" instance=02e30fdfef59 scope=dapr.placement type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:40.737935786Z" level=info msg="Healthz server is listening on :8080" instance=02e30fdfef59 scope=dapr.placement type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:42.536784596Z" level=info msg="cluster leadership acquired" instance=02e30fdfef59 scope=dapr.placement type=log ver=1.0.0-rc.2
time="2021-01-02T15:57:42.537057971Z" level=info msg="leader is established." instance=02e30fdfef59 scope=dapr.placement type=log ver=1.0.0-rc.2
If I terminate the nodeapp. Then the error is as expected, and it’s different from the one above.
➜ dapr invoke --app-id nodeapp --method neworder --data "{\"data\": { \"orderId\": \"42\" } }"
❌ error invoking app nodeapp: app ID nodeapp not found
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Dapr golang Docker Compose - running into a ""errorCode ...
I am running into the following error. {"errorCode":"ERR_DIRECT_INVOKE","message":"invoke API is not ready"}. And the Dapr logs in ...
Read more >[Solved]-HAProxy not running nodeJS API correctly-docker
Coding example for the question HAProxy not running nodeJS API ... running into a ""errorCode":"ERR_DIRECT_INVOKE","message":"invoke API is not ready" error ...
Read more >Error codes returned by APIs
Following table lists the error codes returned by Dapr runtime: Error Code, Description. ERR_ACTOR_INSTANCE_MISSING, Error getting an actor instance.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI - Removing myself from this issue - Was a self-inflicted issue in that my Cisco VPN client was interfering with DAPR (even though I wasn’t connected to the VPN, it’s does something that interferes with DAPR) - View the issue for details on my issue and how I fixed it (MacOS) - @longle255 maybe this will help you.
Great for me and it works well if only keeping the filters at least.