Skip to content
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

Incorrect use a catalog api leads to Could not find a plan matching spec #70

Open
sbrossie opened this issue Apr 4, 2017 · 4 comments

Comments

@sbrossie
Copy link
Member

sbrossie commented Apr 4, 2017

The issue was reported on the mailing list, and i could easily reproduce it:

  • Define a plan in catalog V1 and create the subscription -> OK
  • Define a catalog with V2 without that plan -> Ok
  • Move clock to reach next invoicing period -> analytics plugin throws stack trace
org.apache.felix.log.LogException: org.killbill.billing.catalog.api.CatalogApiException: Could not find a plan matching spec: (plan: 'MALTESTPRODUCT_MONTHLY', product: 'undefined', billing period: 'undefined', pricelist 'undefined')
        at org.killbill.billing.catalog.VersionedCatalog.findCatalogPlanEntry(VersionedCatalog.java:186)
        at org.killbill.billing.catalog.VersionedCatalog.findPlan(VersionedCatalog.java:301)
        at org.killbill.billing.catalog.VersionedCatalog.findPhase(VersionedCatalog.java:332)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessFactoryBase.getPlanPhaseFromInvoiceItem(BusinessFactoryBase.java:381)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessContextFactory.getPlanPhaseFromInvoiceItem(BusinessContextFactory.java:401)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessInvoiceFactory.createBusinessInvoiceItem(BusinessInvoiceFactory.java:244)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessInvoiceFactory.createBusinessInvoiceItem(BusinessInvoiceFactory.java:190)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessInvoiceFactory.access$000(BusinessInvoiceFactory.java:65)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessInvoiceFactory$1.call(BusinessInvoiceFactory.java:117)
        at org.killbill.billing.plugin.analytics.dao.factory.BusinessInvoiceFactory$1.call(BusinessInvoiceFactory.java:114)
@sbrossie
Copy link
Member Author

sbrossie commented Apr 4, 2017

See discussion a out catalog api in this comment

killbillio added a commit that referenced this issue Apr 5, 2017
Fix analytis reports
Fix issue with catalog use. See #70

Signed-off-by: Kill Bill core team <[email protected]>
@sbrossie
Copy link
Member Author

sbrossie commented Aug 7, 2017

The fix above is a partial fix: It allows to pass the subscriptionStartDate, but analytics code converts that date from LocalDate to DateTime using toDateTimeAtStartOfDay.

When creating new catalog entries and right away subscribing to plans, we have a lot of chances to hit this problem -- reported on the mailing list several times.

I am suggesting to make a fix at KB core level

@Arulraj12
Copy link

Hi,
Is this issue still open in 0.18.14?
If there, what is the workaround solution and how long need to wait for subscription like 30 second sleep?

@sbrossie
Copy link
Member Author

sbrossie commented Feb 7, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants