killbill / killbill-stripe-plugin

Kill Bill plugin for Stripe
https://killbill.io
Apache License 2.0
17 stars 40 forks source link

Fix null pointer exception #94

Closed Jimmy-Newtron closed 2 years ago

Jimmy-Newtron commented 2 years ago
{"@timestamp":"2022-10-27T09:18:21.348Z","message":"execution of: POST/checkout resulted in exception\nRoute:\n      | Method | Path      | Source                                                      | Name                                 | Pattern   | Consumes | Produces |\n      |--------|-----------|-------------------------------------------------------------|--------------------------------------|-----------|----------|----------|\n      | POST   | /checkout | org.killbill.billing.plugin.stripe.StripeCheckoutServlet:68 | /StripeCheckoutServlet.createSession | /checkout | [*/*]    | [*/*]    |\n\nStacktrace:","logger_name":"org.jooby.Err","thread_name":"catalina-exec-4","level":"ERROR","req.requestURI":"/plugins/killbill-stripe/checkout","req.queryString":"kbAccountId=ace32ae4-4e41-450c-98ab-13a425c64679&paymentMethodTypes=sepa_debit&paymentMethodTypes=card","kb.tenantRecordId":"1","req.requestId":"907dc0f6-2101-428e-852d-33c6ed70e262","req.method":"POST","kb.accountRecordId":"2","req.remoteHost":"10.233.89.229","req.requestURL":"http://kill-bill-cloud-services.hdp-management/plugins/killbill-stripe/checkout","req.userAgent":"KillBill-JavaClient/1.0","stack_trace":"org.jooby.Err: Server Error(500)
    at org.jooby.internal.HttpHandlerImpl.handleErr(HttpHandlerImpl.java:589)
    at org.jooby.internal.HttpHandlerImpl.cleanup(HttpHandlerImpl.java:562)
    at org.jooby.internal.HttpHandlerImpl.handle(HttpHandlerImpl.java:504)
....
....
    at java.lang.Thread.run(Thread.java:748)\nCaused by: java.lang.NullPointerException: null
    at org.killbill.billing.plugin.stripe.StripePaymentPluginApi.buildFormDescriptor(StripePaymentPluginApi.java:760)
    at org.killbill.billing.plugin.stripe.StripeCheckoutServlet.createSession(StripeCheckoutServlet.java:76)
....
Jimmy-Newtron commented 2 years ago

image

Manually run the testHPP with success

@pierre I am sorry to have broken the checkout process, I have learnt only now that the test is a manual one

pierre commented 2 years ago

I am sorry to have broken the checkout process, I have learnt only now that the test is a manual one

No worries, wish we could automate it (maybe with Selenium?).

Were you able to deploy the changes (see kpm command in the README) and confirm the fix, before I do another release?

Jimmy-Newtron commented 2 years ago

Were you able to deploy the changes (see kpm command in the README) and confirm the fix, before I do another release?

I have only run the unit test manually to confirm I don't break the checkout process.

For the deployment it is very complex to use a custom built JAR because I run Kill Bill on Kubernetes container on a remote cluster.

pierre commented 2 years ago

I think we need to find a way to set you up for testing, so I don't have to do releases each time.

Can you set up a local development environment?

See:

Jimmy-Newtron commented 2 years ago

Can you set up a local development environment?

Due to the French school holidays it will be difficult to be done until the 7th November.

I'll promise that I will search a solution for the local testing for any further modifications. I suppose that the null pointer cannot stay like this for long.

pierre commented 2 years ago

Due to the French school holidays it will be difficult to be done until the 7th November.

Je me souviens que je codais à @VIACentraleReseaux pendant les vacances de la Toussaint 😏 🤓 😁

I'll promise that I will search a solution for the local testing for any further modifications. I suppose that the null pointer cannot stay like this for long.

Sounds good! Feel free to reach out to the community group if you need setup help.

pierre commented 2 years ago

@Jimmy-Newtron It looks like CI is now red, can you also take a look once you're back? https://github.com/killbill/killbill-stripe-plugin/actions/runs/3339191148/jobs/5527832127

FWIW spotbug checks are run when running mvn verify.

Jimmy-Newtron commented 2 years ago

FWIW spotbug checks are run when running mvn verify

Learning a lot of new things altogether and it makes me crazy

pierre commented 2 years ago

Learning a lot of new things altogether and it makes me crazy

Enjoy the learnings 😊

@reshmabidikar Might be worth (one day, no rush) explaining some of this? Maybe in this section? https://docs.killbill.io/latest/plugin_development.html#_maven_build_error

Jimmy-Newtron commented 2 years ago

@Jimmy-Newtron It looks like CI is now red, can you also take a look once you're back? https://github.com/killbill/killbill-stripe-plugin/actions/runs/3339191148/jobs/5527832127

FWIW spotbug checks are run when running mvn verify.

https://github.com/killbill/killbill-stripe-plugin/pull/95