question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Untraceable fatal Exception caused by java.lang.IllegalArgumentException: byteString == null

See original GitHub issue

Originally in Retrofit issues, Jake told me to post this here:

From time to time I am experiencing this fatal error when performing a request. It only happens to one request at a time and I cannot get it to go away until I uninstall and reinstall the application. I am using: com.squareup.retrofit2:retrofit:2.0.0-beta3

and here is the error:

E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher 
    Process: package_name, PID: 4804 
    java.lang.IllegalArgumentException: byteString == null 
    at okio.Buffer.write(Buffer.java:787)
    at com.squareup.okhttp.Cache$Entry.readCertificateList(Cache.java:628)
    at com.squareup.okhttp.Cache$Entry.<init>(Cache.java:555)
    at com.squareup.okhttp.Cache.get(Cache.java:194)
    at com.squareup.okhttp.Cache$1.get(Cache.java:139)
    at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:226) 
    at com.squareup.okhttp.Call.getResponse(Call.java:267) 
    at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:224) 
    at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:195) 
    at com.squareup.okhttp.Call.access$100(Call.java:34) 
    at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:162) 
    at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)

Let me know if you need more information

EDIT: I was able to get the error to stop if I went to system setting and cleared the app cache manually

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
martin-academiacommented, Oct 13, 2020

One thing I noticed: When we were constructing the OkHttpClient, we created the cache with context.cacheDir as the directory. I didn’t realize until I just looked at it that it’s putting its cache files directly in that directory. Our app may be putting other stuff in that directory as well, so there is the potential for a collision. I’m not sure whether that’s the problem or not, but it seems unsafe so I’m going to change my app to put the OkHttp cache in some subdirectory of context.cacheDir.

0reactions
yschimkecommented, Jan 4, 2022

We don’t have a reproduction for this, the suggested one above turned out not to be the case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Camera2 Api..java.lang.IllegalArgumentException: Surface ...
Your onPause() is killing the thread that is being used by the CameraAPI which is causing that error message. That's not the real...
Read more >
Troubleshoot Dataflow errors - Google Cloud
A fatal error has been detected by the Java Runtime Environment ... Certain conditions in your pipeline can cause the job graph to...
Read more >
Throwing an exception in Java - Javamex
We can simply throw an IllegalArgumentException or NullPointerException because if you look at their definitions, you will see that they extend RuntimeException ......
Read more >
Secure Coding Guidelines for Java SE - Oracle
Introduction. Java's architecture and components include security mechanisms that can help to protect against hostile, misbehaving, or unsafe code.
Read more >
Bug descriptions — spotbugs 4.7.3 documentation
To correctly override the equals() method in java.lang. ... a RuntimeException may cause errors, like the caller not being able to examine the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found