question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot subscribe to topics

See original GitHub issue

Expected Behavior

Subscribe to topic

Actual Behavior

time="2020-09-21T23:46:49.612093+02:00" level=error msg="cannot subscribe to topics on pubsub pubsub - was a component for it created?\n" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.612129+02:00" level=error msg="cannot subscribe to topics on pubsub pubsub - was a component for it created?\n" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0

Full dapr build

Microsoft (R) Build Engine version 16.7.0+7fb82e5b2 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  Dapr.Client -> /sandbox/dotnet-sdk/bin/Debug/prod/Dapr.Client/Dapr.Client.dll
  Dapr.AspNetCore ->/sandbox/dotnet-sdk/bin/Debug/prod/Dapr.AspNetCore/Dapr.AspNetCore.dll
  RoutingSample -> /sandbox/dotnet-sdk/bin/Debug/samples/RoutingSample/RoutingSample.dll

Terminal will be reused by tasks, press any key to close it.

> Executing task: daprd-debug <

> Executing command: daprd --app-id "app" --app-port "5000" --components-path "./components" --placement-address "localhost:50005" <

time="2020-09-21T23:46:31.25849+02:00" level=info msg="starting Dapr Runtime -- version 0.10.0 -- commit 6032dc2" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.258644+02:00" level=info msg="log level set to: info" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.259345+02:00" level=info msg="metrics server started on :9090/" app_id=app instance=laughtale.local scope=dapr.metrics type=log ver=0.10.0
time="2020-09-21T23:46:31.261075+02:00" level=info msg="loading default configuration" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.261157+02:00" level=info msg="standalone mode configured" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.261165+02:00" level=info msg="app id: app" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.261218+02:00" level=info msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.264931+02:00" level=info msg="found component statestore (state.redis)" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.264935+02:00" level=info msg="found component messagebus (pubsub.redis)" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:31.265006+02:00" level=info msg="application protocol: http. waiting on port 5000.  This will block until the app is listening on that port." app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.320353+02:00" level=info msg="application discovered on port 5000" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.482155+02:00" level=info msg="application configuration loaded" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.495344+02:00" level=info msg="local service entry announced: app -> 192.168.0.14:49460" app_id=app instance=laughtale.local scope=dapr.contrib type=log ver=0.10.0
time="2020-09-21T23:46:49.495378+02:00" level=info msg="Initialized name resolution to standalone" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.496547+02:00" level=info msg="actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.496904+02:00" level=info msg="enabled gRPC tracing middleware" app_id=app instance=laughtale.local scope=dapr.runtime.grpc.api type=log ver=0.10.0
time="2020-09-21T23:46:49.4971+02:00" level=info msg="enabled gRPC metrics middleware" app_id=app instance=laughtale.local scope=dapr.runtime.grpc.api type=log ver=0.10.0
time="2020-09-21T23:46:49.497529+02:00" level=info msg="API gRPC server is running on port 50001" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.497602+02:00" level=info msg="enabled gRPC tracing middleware" app_id=app instance=laughtale.local scope=dapr.runtime.grpc.internal type=log ver=0.10.0
time="2020-09-21T23:46:49.497621+02:00" level=info msg="enabled gRPC metrics middleware" app_id=app instance=laughtale.local scope=dapr.runtime.grpc.internal type=log ver=0.10.0
time="2020-09-21T23:46:49.497695+02:00" level=info msg="internal gRPC server is running on port 49460" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.497141+02:00" level=info msg="starting connection attempt to placement service at localhost:50005" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.498905+02:00" level=info msg="enabled cors http middleware" app_id=app instance=laughtale.local scope=dapr.runtime.http type=log ver=0.10.0
time="2020-09-21T23:46:49.499032+02:00" level=info msg="enabled metrics http middleware" app_id=app instance=laughtale.local scope=dapr.runtime.http type=log ver=0.10.0
time="2020-09-21T23:46:49.49905+02:00" level=info msg="enabled tracing http middleware" app_id=app instance=laughtale.local scope=dapr.runtime.http type=log ver=0.10.0
time="2020-09-21T23:46:49.499179+02:00" level=info msg="http server is running on port 3500" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.504074+02:00" level=info msg="established connection to placement service at localhost:50005" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.507798+02:00" level=info msg="placement order received: lock" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.507916+02:00" level=info msg="placement order received: update" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.507929+02:00" level=info msg="actors: placement tables updated" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.507979+02:00" level=info msg="placement order received: unlock" app_id=app instance=laughtale.local scope=dapr.runtime.actor type=log ver=0.10.0
time="2020-09-21T23:46:49.612093+02:00" level=error msg="cannot subscribe to topics on pubsub pubsub - was a component for it created?\n" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.612129+02:00" level=error msg="cannot subscribe to topics on pubsub pubsub - was a component for it created?\n" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0
time="2020-09-21T23:46:49.612217+02:00" level=info msg="dapr initialized. Status: Running. Init Elapsed 18350.999000000003ms" app_id=app instance=laughtale.local scope=dapr.runtime type=log ver=0.10.0

Steps to Reproduce the Problem

  • Clone repo
  • Run RoutingSample

REST

Get the pubsubname and topics

GET http://127.0.0.1:5000/dapr/subscribe

HTTP/1.1 200 OK
Connection: close
Date: Mon, 21 Sep 2020 21:50:15 GMT
Content-Type: application/json
Server: Kestrel
Transfer-Encoding: chunked

[
  {
    "topic": "deposit",
    "route": "deposit",
    "pubsubName": "pubsub"
  },
  {
    "topic": "withdraw",
    "route": "withdraw",
    "pubsubName": "pubsub"
  }
]

Post Deposit

POST http://127.0.0.1:5000/deposit
Content-Type: application/json

{ "id": "17", "amount": 20 }
HTTP/1.1 200 OK
Connection: close
Date: Mon, 21 Sep 2020 21:55:07 GMT
Content-Type: application/json
Server: Kestrel
Transfer-Encoding: chunked

{
  "id": "17",
  "balance": 52
}

Trying to pubsub deposit

POST http://localhost:3500/v1.0/publish/pubsub/deposit
Content-Type: application/json

{ "id": "17", "amount": 18 }
HTTP/1.1 500 Internal Server Error
Server: fasthttp
Date: Mon, 21 Sep 2020 21:55:24 GMT
Content-Type: application/json
Content-Length: 71
Traceparent: 00-e4397f201735e7f47f503a12125c4304-8b1d1defd613f5dd-00
Connection: close

{
  "errorCode": "ERR_PUBSUB_PUBLISH_MESSAGE",
  "message": "pubsub not found"
}

Run command line

 ➜ dapr publish --pubsub pubsub -t deposit -d '{"id": "17", "amount": 15 }'                                                                                                            [20/09/21|23:53]
❌  Error publishing topic deposit: couldn't find a running Dapr instance

Env

  • macOS 10.15.6 (19G2021)
  • dotnet 3.1.402
  • dapr-cli 0.10.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jjchiwcommented, Oct 4, 2020

Hi!

Thanks now is working with daprd

In the components folder I had two files

  • messagebus.yaml
  • statestore.yaml

I think those files where created in the first “launch” of the extension https://github.com/microsoft/vscode-dapr and the content of the file messagebus.yaml is

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: messagebus
spec:
  type: pubsub.redis
  metadata:
    - name: redisHost
      value: localhost:6379
    - name: redisPassword
      value: ""

So after following your advice and checked $HOME/.dapr/components I renamed the

metadata:
  name: messagebus

to

metadata:
  name: pubsub

And now it’s working as expected 😃

So at the end it wasn’t a kind/bug just plain misconfiguration 😦

I will close the issue

thanks a lot

0reactions
vinayada1commented, Oct 3, 2020

The difference between the two commands you have is that first one (which you said works), uses the default components folder which is $HOME/.dapr/components where a pubsub.yaml exists by default.

The second command uses a custom components-path, which, from the logs looks like does not have a component of type pubsub. Could you check?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot subscribe to topic while consumer is running
I am using KafkaJS, Typescript. KafkaJSNonRetriableError: Cannot subscribe to topic while consumer is running at Object.subscribe (E:\Tech\ ...
Read more >
Cannot subscribe to topic while consumer is running. · ...
Getting error log failure in consumer : Cannot subscribe to topic while consumer is running. Getting this error on consumer startup, ...
Read more >
Cannot subscribe to topics using rosbag play
I would like to subscribe to a message which is being played back from a bag file. Whenever I launch my node that...
Read more >
Admin Console cannot subscribe to topic
Admin Console cannot subscribe to topic. Hi,. I'm getting an error from the Admin Console when I try to subscribe to a topic:....
Read more >
Amazon SNS: Unable to find ARN for topic subscription
I'm trying to subscribe to a topic via SNS according to this documentation, but the only topics I can find in the SNS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found