Got a SDK Exception on deployed tenant logs related to microservice subscription. What do they mean?

Product/components used and version/fix level:

Cumulocity Production

Detailed explanation of the problem:

Hi, I am getting this error on some of my services. I got a couple of alarms that my service is unhealthy and then What does this mean?

2023-10-12 05:15:12.256 ERROR 1 --- [subscriptions-0] .s.s.i.MicroserviceSubscriptionScheduler : Error while reacting on microservice subscription


com.cumulocity.sdk.client.SDKException: Error invoking GET http://cumulocity:8111/application/currentApplication
	at com.cumulocity.microservice.subscription.repository.impl.CurrentMicroserviceRepository.handleException( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.repository.impl.CurrentMicroserviceRepository.getCurrentApplication( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.repository.impl.CurrentMicroserviceRepository.register( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.repository.impl.CurrentMicroserviceRepository.register( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.repository.MicroserviceSubscriptionsRepository.register( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.service.impl.MicroserviceSubscriptionsServiceImpl.registerApplication( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.service.impl.MicroserviceSubscriptionsServiceImpl.subscribe( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.service.impl.MicroserviceSubscriptionScheduler.lambda$schedulePeriodicSubscription$0( ~[microservice-subscription-1016.0.264.jar!/:na]
	at java.base/java.util.concurrent.Executors$ ~[na:na]
	at java.base/java.util.concurrent.FutureTask.runAndReset( ~[na:na]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$ ~[na:na]
	at java.base/ ~[na:na]
Caused by: com.cumulocity.sdk.client.SDKException: Http status code: 502
Something went wrong. Failed to parse error message.
tenant: t173516 user: servicebootstrap_dataingestion-service
	at com.cumulocity.sdk.client.ResponseParser.checkStatus( ~[java-client-1016.0.264.jar!/:na]
	at com.cumulocity.sdk.client.ResponseParser.parse( ~[java-client-1016.0.264.jar!/:na]
	at com.cumulocity.sdk.client.RestConnector.get( ~[java-client-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.repository.application.CurrentApplicationApi.get( ~[microservice-subscription-1016.0.264.jar!/:na]
	at com.cumulocity.microservice.subscription.repository.impl.CurrentMicroserviceRepository.getCurrentApplication( ~[microservice-subscription-1016.0.264.jar!/:na]
	... 12 common frames omitted

Please let me know whats the issue?


1 Like

5xx errors retrieved from Cumulocity Core API indicate that something is wrong with the platform.
502 means that the load balancer could not forward the message to the core.
Most likely this is resolved after some short time. You can handle that by catching SDK Exception with status code 502 and implement a retry pattern for important stuff.
That’s the only thing you can do about it. If the 5xx error persist even after minutes/hours you should create an issue in our support system because it could be that some load balancer are misconfigured or a core in the cluster is not reachable any more and must be restarted.


Okay Thanks, will monitor and update if any issue occurs. :slight_smile:

Hi Stefan,

I just wanted to highlight a few things. Let me know if these contribute to the error that I highlighted in this post. My microservice config is set like CPU as 1 and memory as 512 M. Also my service is set as a multi-tenant.

Could you please guide me on the same?


1 Like

Hi @Sam123 ,

the local resources of your microservice (like CPU cores and memory) don’t have any impact to the 5xx errors. Same for the isolation level.
They only impact if you see your microservice crashing or restarting due to OOM-errors.

What could contribute are the number of requests the microservice is sending to the platform. If you send 1000 of them at the same time this could impact the platform responding with 5xx errors sporadically (throttling your client) but normally even this should be handled well by the load balancers and multiple core nodes processing them.

1 Like