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

Occasional Pager NullPointerException from recurly-java-client #278

Open
gstanek opened this issue Aug 20, 2024 · 0 comments
Open

Occasional Pager NullPointerException from recurly-java-client #278

gstanek opened this issue Aug 20, 2024 · 0 comments
Labels
bug? Potentially a bug

Comments

@gstanek
Copy link

gstanek commented Aug 20, 2024

Describe the bug

We see occasional NullPointerExceptions propagated out of the recurly-client-java. The relevant observed stack trace is:

java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "com.recurly.v3.Pager.getNext()" because "pager" is null
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at com.sproutsocial.revenue.internal.account.v1.service.AccountServiceImpl.getAccountResponse(AccountServiceImpl.java:872)
	at com.sproutsocial.revenue.internal.account.v1.service.AccountServiceImpl.getAccountsBatches(AccountServiceImpl.java:281)
	at com.sproutsocial.revenue.internal.account.v1.service.AccountServiceImpl.lambda$getAccounts$0(AccountServiceImpl.java:239)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.sproutsocial.revenue.commons.multithreading.MdcThreadPoolExecutor$1.run(MdcThreadPoolExecutor.java:99)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
	Caused by: java.lang.NullPointerException: Cannot invoke "com.recurly.v3.Pager.getNext()" because "pager" is null
	at com.recurly.v3.Pager.clone(Pager.java:93)
	at com.recurly.v3.Pager.getNextPage(Pager.java:89)
	at com.sproutsocial.revenue.internal.client.RecurlyClientImpl.executePaginatedQueryInEnv(RecurlyClientImpl.java:740)
	at com.sproutsocial.revenue.internal.client.RecurlyClientImpl.getPaginatedEntitiesById(RecurlyClientImpl.java:685)
	at com.sproutsocial.revenue.internal.client.RecurlyClientImpl.listInvoicesByAccountCode(RecurlyClientImpl.java:536)
	at com.sproutsocial.revenue.internal.account.v1.service.AccountServiceImpl.lambda$getAccountResponse$6(AccountServiceImpl.java:835)
	... 5 common frames omitted

Specifically of note:

	Caused by: java.lang.NullPointerException: Cannot invoke "com.recurly.v3.Pager.getNext()" because "pager" is null
	at com.recurly.v3.Pager.clone(Pager.java:93)
	at com.recurly.v3.Pager.getNextPage(Pager.java:89)

Our theory is some sort of network exception prevents this.client.makeRequest from returning an instantiated pager object, leading to the NullPointerException within the clone method.

To Reproduce

This does not happen consistently or often (the rate has been a few times a month). Given the stack trace, this bug appears to be entirely within the context of the recurly-client-java code.

Expected behavior

The recurly java client does not encounter NullPointerExceptions, causing failed transactions.

Your Environment

  • Which version of this library are you using?
    <dependency>
      <groupId>com.recurly.v3</groupId>
      <artifactId>api-client</artifactId>
      <version>4.51.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  • Which version of the language are you using?
    Java 17
@gstanek gstanek added the bug? Potentially a bug label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Potentially a bug
Projects
None yet
Development

No branches or pull requests

1 participant