Cancel api throwing an exception and not cancelling at the end of term.

47 views
Skip to first unread message

Vivek Manpuria (Vivek)

unread,
Aug 2, 2025, 2:20:09 AMAug 2
to Kill Bill users mailing-list
Dear Team,

Upon calling the "Cancel Subscription API", I have noticed an exception is being thrown, because of which, the cancellation is done immediately instead of at the end-of-term.

Step 1: Call Cancel Subscription API  to cancel at END_OF_TERM 
Step 2: Observe exception in logs, "Exception thrown by subscriber method handleSubscriptionTransition"
Step 3: Subscription is cancelled immediately instead of at END_OF_TERM.

I have attached the KillBill logs for the above steps.
 
Thank you,
Vivek
cancel-subscription-issue-immediate-not-end-of-term-after-exception.csv

karan bansal

unread,
Aug 4, 2025, 2:49:15 AMAug 4
to Kill Bill users mailing-list
Hi Vivek,

I checked the attached log as well as tried the cancellation ( with invoice group plugin as well as without it ) and in both cases it worked ok for me. In the logs that were generated, I see the delete call like this but similar seems missing from the log that you shared. All the calls in there point to immediate cancellation. Could you please share the api call that you used as well as full logs. 

DELETE http://localhost:8080/1.0/kb/subscriptions/019eec35-60de-4824-8899-104c107f6f94?callCompletion=false&callTimeoutSec=5&entitlementPolicy=END_OF_TERM&billingPolicy=END_OF_TERM&useRequestedDateForBilling=false

Regards
Karan

Vivek

unread,
Aug 4, 2025, 8:20:19 AMAug 4
to Kill Bill users mailing-list
Dear Team

Upon investigating this issue, I found that turning off the invgrp plugin helped resolve the issue, i.e. the exception from Step 2 was not thrown. The invgrp plugin contains code from https://github.com/killbill/killbill-invgrp-demo.git after commenting out some portions. No new code was added.

Thank you,
Vivek
 

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/killbilling-users/158ac0b1-f9eb-4185-89a7-8e6d217a4a50n%40googlegroups.com.

Vivek Manpuria (Vivek)

unread,
Aug 9, 2025, 12:50:40 PMAug 9
to Kill Bill users mailing-list
Hi Karan,

Here are the steps to reproduce the issue:

1. Start the demo invgrp plugin
2. Create an account
3. Create a subscription
4. Cancel the subscription (billingPolicy = END_OF_TERM, entitlementPolicy = END_OF_TERM)
5. Cancel the subscription (billingPolicy = IMMEDIATE, entitlementPolicy = IMMEDIATE)
6. Observe "Exception thrown by subscriber method handleSubscriptionTransition" in the logs

When only Steps 2 to 5 are performed, then Step 6 is not observed.

If needed, I can send logs after executing the above steps.

Thank you,
Vivek

karan bansal

unread,
Aug 9, 2025, 2:20:53 PMAug 9
to Kill Bill users mailing-list
Hi Vivek,

Yes please share the logs after executing the above steps. 

Regards
Karan

Vivek Manpuria (Vivek)

unread,
Aug 13, 2025, 5:13:10 PMAug 13
to Kill Bill users mailing-list
Hi Karan

Attached, please find the logs.

Thank you,
Vivek

cancel-eot-immediate-exception.csv

karan bansal

unread,
Aug 20, 2025, 1:00:09 PMAug 20
to Kill Bill users mailing-list
Hi Vivek,

I checked the logs. I see the below calls in the log. These are different calls. Are separate calls being issued for End of term and Immediate cancellation? 

2025-08-12T17:50:09.626Z,"{""@timestamp"":""2025-08-12T17:50:09.626Z"",""message"":""24 * Server responded with a response on thread catalina-exec-12\n24 < 204\n24 < Content-Type: application/json\n"",""logger_name"":""org.glassfish.jersey.logging.LoggingFeature"",""thread_name"":""catalina-exec-12"",""level"":""INFO"",""req.requestURI"":""/1.0/kb/subscriptions/1b4e7582-1edc-4d89-9e57-55da9faa6ada"",""req.queryString"":""entitlementPolicy=END_OF_TERM&billingPolicy=END_OF_TERM"",""kb.tenantRecordId"":""1"",""kb.userToken"":""f126ae4d-f708-40f7-91bb-423e9aa76f30"",""req.requestId"":""f126ae4d-f708-40f7-91bb-423e9aa76f30"",""req.method"":""DELETE"",""kb.accountRecordId"":""147"",""req.remoteHost"":""198.178.12.68"",""req.requestURL"":""https://lms.dev.commerce.comcast.com/1.0/kb/subscriptions/1b4e7582-1edc-4d89-9e57-55da9faa6ada"",""req.userAgent"":""insomnia/10.3.1""}",555170539925:/ecs/commerce-killbill-logs-devtwo,ecs/lms-tf-devtwo/2b27a7eb1f5c4b409eadabad035c8d91

2025-08-12T17:50:44.773Z,"{""@timestamp"":""2025-08-12T17:50:44.772Z"",""message"":""25 * Server has received a request on thread catalina-exec-12\n25 > DELETE https://lms.dev.commerce.comcast.com/1.0/kb/subscriptions/1b4e7582-1edc-4d89-9e57-55da9faa6ada?entitlementPolicy=IMMEDIATE&billingPolicy=IMMEDIATE\n25 > accept: */*\n25 > authorization: **********\n25 > host: lms.dev.commerce.comcast.com\n25 > user-agent: insomnia/10.3.1\n25 > x-amzn-trace-id: Root=1-689b7ef4-3db008950252209e149a9355\n25 > x-envoy-expected-rq-timeout-ms: 15000\n25 > x-forwarded-port: 443\n25 > x-forwarded-proto: https\n25 > x-killbill-apikey: comcast\n25 > x-killbill-apisecret: ******\n25 > x-killbill-createdby: vivek\n25 > x-request-id: 9c4c3f28-92b2-489a-a42b-c14b2b6d7545\n"",""logger_name"":""org.glassfish.jersey.logging.LoggingFeature"",""thread_name"":""catalina-exec-12"",""level"":""INFO"",""req.requestURI"":""/1.0/kb/subscriptions/1b4e7582-1edc-4d89-9e57-55da9faa6ada"",""req.queryString"":""entitlementPolicy=IMMEDIATE&billingPolicy=IMMEDIATE"",""kb.tenantRecordId"":""1"",""req.method"":""DELETE"",""req.remoteHost"":""198.178.12.68"",""req.requestURL"":""https://lms.dev.commerce.comcast.com/1.0/kb/subscriptions/1b4e7582-1edc-4d89-9e57-55da9faa6ada"",""req.userAgent"":""insomnia/10.3.1""}",555170539925:/ecs/commerce-killbill-logs-devtwo,ecs/lms-tf-devtwo/2b27a7eb1f5c4b409eadabad035c8d91

Regards
Karan

Vivek Manpuria (Vivek)

unread,
Sep 8, 2025, 12:28:08 PMSep 8
to Kill Bill users mailing-list
Hi Karan,

Yes, those are 2 separate calls to cancel the subscription. Both calls are to cancel the same subscription. The first one is an END_OF_TERM cancellation (Step 4). The second one is an IMMEDIATE cacellation (Step 5).

1. Start the demo invgrp plugin
2. Create an account
3. Create a subscription
4. Cancel the subscription (billingPolicy = END_OF_TERM, entitlementPolicy = END_OF_TERM)
5. Cancel the subscription (billingPolicy = IMMEDIATE, entitlementPolicy = IMMEDIATE)
6. Observe "Exception thrown by subscriber method handleSubscriptionTransition" in the logs

Thank you,
Vivek

Vivek Manpuria (Vivek)

unread,
Sep 12, 2025, 4:31:42 AMSep 12
to Kill Bill users mailing-list
Hi Karan

I made a change to the demo invgrp plugin and used it. Now, there are no errors. We are good. Thanks.

Thank you,
Vivek

Reply all
Reply to author
Forward
0 new messages