-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PUB/SUB Error in Subscription Sidecar #692
Comments
I should have also mentioned that both services are using the Java SDK. |
Can you show the code on your event subscriber that is failing to call the invocation endpoint? It looks like your app is failing to invoke another app, and thus returning an error to Dapr when it's receiving the event. |
the code is in a private repo, so full sharing is impossible....here are the pertinent code snippets: k8s Subscription CRDapiVersion: dapr.io/v1alpha1
k8s Component CRDapiVersion: dapr.io/v1alpha1
JAVA CODE@RestController
} k8s Deployment
|
@a377965 is this Java code the exact same code producing the error? Because according to the error, the subscriber is trying to invoke Dapr or call to some Dapr endpoint. @artursouza do you spot anything here? |
Hi Yaron, the log is from this code (the subscription to the topic) which makes it very odd, see the sidecar logs: time="2022-02-17T21:24:46.361732876Z" level=debug msg="Calling app's handler for message a2894ee1-944f-4ee9-a5bd-d0c52fe9efa4 on topic ap555555.calculation.t" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0 followed by the very next (error ) message time="2022-02-17T21:24:46.362329914Z" level=error msg="non-retriable error returned from app while processing pub/sub event ccd3f051-0295-4cb7-9e8a-7d9bcd91cbef: {"errorCode":"ERR_DIRECT_INVOKE","message":"failed getting app id either from the URL path or the header dapr-app-id"}. status code returned: 404" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.runtime type=log ver=1.6.0 I am actually thinking there is something wrong with the service that is PUBLISHING the topic, as the message indicates there is no APPID in URL or HEADER. |
Is the app |
@yaron2, this is essentially from your solution : https://docs.dapr.io/developing-applications/building-blocks/pubsub/howto-publish-subscribe/ |
Ok, can you remove the code that writes to Redis and see if you see a difference in the logs? |
after removing the code which writes to Redis, the problem continues to exist. Without this property being set, I get this message: stack_trace":"java.lang.NoSuchFieldError: Companion Could this possibly be leading to the issue? |
@yaron2 and @artursouza , and this entire problem stems back to the okhttp3 version ..... any way you guys can confirm or deny this assertion? This is a significant problem for me in adopting the platform, as we are making significant use of springboot and the recommended workaround it to use a version of the library that is no longer available on Maven. |
@a377965 You should not use gRPC for service invocation. HTTP is the solution to be used. In this case, you can override the okhttp3 version to a higher version to resolve the dependency conflict. I am moving this issue to java-sdk repo. We can also upgrade to a most recent version of OKHTTP3 for now. The long term goal is to remove it as a dependency. |
@artursouza , I am not sure this is resolved as I am getting a stack overflow error in my application logs using the version 4.9.0 of OKHTTP3 which was using in this post: #687 Is there a recommended version I can use that you know of that is compatible? My managed version is 3.14.9 which does not work but doesn't throw a stack over flow message. |
@artursouza and @yaron2 But the original matters continues to occur and I am seeing this message in the SIDECAR logs for the SUBSCRIPTION service: We have seemed to rule out the OKHTTP3 matter. Any additional thoughts on what may be going wrong would be appreciated! |
I'm kind of bewildered by what's going on here :) Can you confirm your subscriber endpoint does nothing more than return a response to Dapr? |
yaron2...its still the JAVA CODE above posted on February 21 2022. Interestingly observation, I was adding the debug k8s annotation to my PUBLISHER to see if anything interesting was being logged in that services sidecar, and I got this: @timestamp":"2022-02-24T12:35:21.216-05:00","@Version":"1","message":"Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception if I remove the dapr debug annotation, all is well, .....very odd. So the only update was the k8s deployment annotation, no code change at all. |
Solved!! Operator error, that is misaligned ports on the SUB service! Now the error makes sense as the sidecar could not get the APPID from the SUB service during the subscribe event. I was not clear in the log message where the error was being encountered. Figure 7.3 in this Microsoft paged helped isolate the problem: https://docs.microsoft.com/en-us/dotnet/architecture/dapr-for-net-developers/publish-subscribe Thank you both @yaron2 and @artursouza |
I am running DAPR in Azure AKS using Azure Service Bus. I have a service which it using grpc and stores state in a Redis instance in AKS. This same client also publishes a topic on an ASB / Namespace topic. The message appears to be sent successfully
A client which is set up to process the message from the subscription on the topic is emitting the following error :
time="2022-02-17T21:24:46.361600968Z" level=debug msg="Waiting to receive message on topic ap555555.calculation.t" app_id=ap149500 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0
time="2022-02-17T21:24:46.361672772Z" level=debug msg="Adding message a2894ee1-944f-4ee9-a5bd-d0c52fe9efa4 to active messages on topic ap555555.calculation.t" app_id=ap149500 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0
time="2022-02-17T21:24:46.361732876Z" level=debug msg="Calling app's handler for message a2894ee1-944f-4ee9-a5bd-d0c52fe9efa4 on topic ap555555.calculation.t" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0
time="2022-02-17T21:24:46.362329914Z" level=error msg="non-retriable error returned from app while processing pub/sub event ccd3f051-0295-4cb7-9e8a-7d9bcd91cbef: {"errorCode":"ERR_DIRECT_INVOKE","message":"failed getting app id either from the URL path or the header dapr-app-id"}. status code returned: 404" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.runtime type=log ver=1.6.0
time="2022-02-17T21:24:46.362365016Z" level=debug msg="Completing message a2894ee1-944f-4ee9-a5bd-d0c52fe9efa4 on topic ap555555.calculation.t" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0
time="2022-02-17T21:24:46.41919448Z" level=debug msg="Removing message a2894ee1-944f-4ee9-a5bd-d0c52fe9efa4 from active messages on topic ap555555.calculation.t" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0
time="2022-02-17T21:25:02.055100447Z" level=debug msg="No active messages require lock renewal for topic ap555555.calculation.t" app_id=ap999999 instance=calculator-microservice-8c65fd8ff-vjjks scope=dapr.contrib type=log ver=1.6.0
Any insight into this error, especially based on the setup would be appreciated.
The text was updated successfully, but these errors were encountered: