We are encountering problems when creating subscriptions on an account with no payment method. Locally my call to javaclient.createSubscription() or createSubscriptionWithAddons() with a single subscription times out and I can see an INVOICE_PAYMENT_ERROR in the kill bill log. Strangely, calling createSubsctiptionWithAddons() with a base subscription and add-on produces the same error in the log but returns successfully even with a non-zero timeout. If I run the same operations against our preprod server I do not see the INVOICE_PAYMENT_ERROR but I see this exception instead:
java.sql.SQLIntegrityConstraintViolationException: Column 'payment_method_id' cannot be null [statement:"insert into _invoice_payment_control_plugin_auto_pay_off (attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values (?,?,?,?,?,?,?,?,?,?,?)", located:"insert into _invoice_payment_control_plugin_auto_pay_off (attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values (?,?,?,?,?,?,?,?,?,?,?)", rewritten:"insert into _invoice_payment_control_plugin_auto_pay_off (attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values (?,?,?,?,?,?,?,?,?,?,?)", arguments:{ positional:{0:'7321663f-
8193-4b65-9004-af4fd992a581',1:'229fa2f1-d958-49cd-9595-512786e6b915',2:'4d080070-74bb-41fc-a9e3-b71182980a1d',3:UUIDArgument{value=8227aaa4-c535-4357-ab94-ec4a6cafac90},4:'__INVOICE_PAYMENT_CONTROL_PLUGIN__',5:null,6:null,7:1.00,8:USD,9:'InvoicePaymentControlPluginApi',10:DateTimeArgument{value=2016-08-27T01:32:33.000Z}}, named:{}, finder:[]}]'}
This exception does not appear in the case of creating a subscription with an add-on. Also, I am unable to replicate this stacktrace locally and placing a breakpoint in the method where I am assuming it is generated (insert_AUTO_PAY_OFF_ifRequired() in InvoicePaymentControlPluginApi.java) has not yielded results. The breakpoint trips in that method but returns false before it can attempt to insert into the _invoice_payment_control_plugin_auto_pay_off table.
I was under the impression that the auto pay off account tag would stop payment attempts so I'm not sure why I am getting an invoice payment error. I would expect that a subscription created on an account without a payment method would generate an invoice but not try to pay it off. The server-side stacktrace looks to be related to the auto pay off tag but I am not familiar enough with the code to see how the _invoice_payment_control_plugin_auto_pay_off table is used.
This seems like it could be a combination of issues. There is my potentially incorrect reasoning about the auto pay off tag, the fact that the problem changes depending on whether a base subscription is created or a base with an add-on, and that it behaves differently in the two environments I have tested it in. Should I just never try to create a subscription on an account with no current way to pay? Or is there one or two bugs at work?
Thanks,
Nate Anderson
Hello,
We are encountering problems when creating subscriptions on an account with no payment method.
Locally my call to javaclient.createSubscription() or createSubscriptionWithAddons() with a single subscription times out and I can see an INVOICE_PAYMENT_ERROR in the kill bill log. Strangely, calling createSubsctiptionWithAddons() with a base subscription and add-on produces the same error in the log but returns successfully even with a non-zero timeout. If I run the same operations against our preprod server I do not see the INVOICE_PAYMENT_ERROR but I see this exception instead:
java.sql.SQLIntegrityConstraintViolationException: Column 'payment_method_id' cannot be null [statement:"insert into _invoice_payment_control_plugin_auto_pay_off (attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values (?,?,?,?,?,?,?,?,?,?,?)", located:"insert into _invoice_payment_control_plugin_auto_pay_off (attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values (?,?,?,?,?,?,?,?,?,?,?)", rewritten:"insert into _invoice_payment_control_plugin_auto_pay_off (attempt_id, payment_external_key, transaction_external_key, account_id, plugin_name, payment_id, payment_method_id, amount, currency, created_by, created_date) values (?,?,?,?,?,?,?,?,?,?,?)", arguments:{ positional:{0:'7321663f-
8193-4b65-9004-af4fd992a581',1:'229fa2f1-d958-49cd-9595-512786e6b915',2:'4d080070-74bb-41fc-a9e3-b71182980a1d',3:UUIDArgument{value=8227aaa4-c535-4357-ab94-ec4a6cafac90},4:'__INVOICE_PAYMENT_CONTROL_PLUGIN__',5:null,6:null,7:1.00,8:USD,9:'InvoicePaymentControlPluginApi',10:DateTimeArgument{value=2016-08-27T01:32:33.000Z}}, named:{}, finder:[]}]'}
This exception does not appear in the case of creating a subscription with an add-on.
Also, I am unable to replicate this stacktrace locally and placing a breakpoint in the method where I am assuming it is generated (insert_AUTO_PAY_OFF_ifRequired() in InvoicePaymentControlPluginApi.java) has not yielded results. The breakpoint trips in that method but returns false before it can attempt to insert into the _invoice_payment_control_plugin_auto_pay_off table.
I was under the impression that the auto pay off account tag would stop payment attempts so I'm not sure why I am getting an invoice payment error.
I would expect that a subscription created on an account without a payment method would generate an invoice but not try to pay it off.
The server-side stacktrace looks to be related to the auto pay off tag but I am not familiar enough with the code to see how the _invoice_payment_control_plugin_auto_pay_off table is used.
This seems like it could be a combination of issues. There is my potentially incorrect reasoning about the auto pay off tag, the fact that the problem changes depending on whether a base subscription is created or a base with an add-on, and that it behaves differently in the two environments I have tested it in. Should I just never try to create a subscription on an account with no current way to pay? Or is there one or two bugs at work?
Thanks,
Nate Anderson
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/2facfca1-f60c-4271-8844-b3a42d2c7aa3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Stéphane,
The basic thing I am trying to do is to add a base subscription or a base and add-on to an account that doesn't have a payment method but does have the auto pay off tag. The subscriptions all have recurring costs. If I do this against a local KB it seems to work correctly, but if I do it against a local KB in a docker container the call fails in the case of the base only subscription and in both cases I see the SQLIntegrityConstraintViolationException that I noted in the first message.
I think I am seeing two bugs. One is the call timing out when creating a base subscription alone vs creating a base and add-on in a single call. This can be replicated by creating the subscriptions on an account with no payment method and no auto pay off tag. Both cases result in an INVOICE_PAYMENT_ERROR but only the base with no add-on call will correctly time out. (My INVOICE_PAYMENT_ERROR problems in the first post were caused by my lack of an auto pay off tag).
The second bug is the SQLIntegrityConstraintViolationException and I have only been able to make it happen on a Kill Bill instance running in a docker container. I am currently trying to create a simple test case for this to eliminate the possibility that the problem is a custom plugin that we wrote or something of that nature. Creating subscriptions on an account with no payment method and with an auto pay off tag triggers this problem. The subscription is created successfully and, if created with an add-on, the method returns correctly, so it is potentially only visible in the logs.
I'll keep working on an easier way to reproduce the problem.
Please let me know if you need more information.
Thanks,
Nate
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/1ce0b8fb-629f-45df-9f41-740444f6ae6c%40googlegroups.com.
Stéphane,
Sorry, I have had other work and haven't been able to look into this for a few days. I hope to try and replicate the SQLIntegrityConstraintViolationException in a simpler test case by the end of the week.
We are currently running KB 0.16.8.
The steps to reproduce the lack of timeout on error when creating a base + add-on subscription are:
1. Create two plans in the catalog, one base and one add-on, both requiring a payment.
2. Create an account with no payment method.
3. Make sure the account does NOT have AUTO_PAY_OFF. This is an easy way to cause an error when creating a subscription that requires a payment.
4. Create a subscription and add-on using createSubscriptionWithAddons with callCompletion=true and a timeout.
The call returns without expiring the timeout even though there is an internal error caused by a payment attempt with no payment method.
Creating a subscription of the base plan alone with the same timeout parameters will return with an error after the timeout expires. I am assuming that this is the correct behavior.
I will get back to you on the SQLIntegrityConstraintViolationException when I have time to nail it down and make sure it isn't a problem on our end.
Thanks,
Nate
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/9df9ee2b-aee4-4bf6-8963-8207e0309587%40googlegroups.com.
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/a18fb7bd-ea4e-4fc7-a074-8bb7c997c5c0%40googlegroups.com.