question

penky28_147901 avatar image
penky28_147901 asked Erick Ramirez edited

Getting key cache error on startup, "UTFDataFormatException: malformed input around byte 10"

While starting one of the node in Apache Cassandra, following info observed in log file. I was not clear about " malformed input around byte 10". Can someone shed some light on the below one.

INFO [pool-3-thread-1] 2022-03-02 16:59:35,279 AutoSavingCache.java:263 - Harmless error reading saved cache /usr/sps/casdata/saved_caches/KeyCache-e.db
java.io.UTFDataFormatException: malformed input around byte 10
 at java.io.DataInputStream.readUTF(DataInputStream.java:634) ~[na:1.8.0_301]
 at java.io.DataInputStream.readUTF(DataInputStream.java:564) ~[na:1.8.0_301]
 at org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:216) ~[apache-cassandra-3.11.3.jar:3.11.3]
 at org.apache.cassandra.cache.AutoSavingCache$3.call(AutoSavingCache.java:165) [apache-cassandra-3.11.3.jar:3.11.3]
 at org.apache.cassandra.cache.AutoSavingCache$3.call(AutoSavingCache.java:161) [apache-cassandra-3.11.3.jar:3.11.3]
 at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_301]
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_301]
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_301]
 at java.lang.Thread.run(Thread.java:748) [na:1.8.0_301]

Apache Cassandra 3.11.3 version.

thanks for your help.

-Raghav

cassandra
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

The UTFDataFormatException indicates that the key cache file got corrupted. I'm interested to know why you had to restart the node because it would probably explain what happened to the cache file.

If Cassandra got killed or terminated unexpectedly while the cache file was getting updated, it's likely that the thread updating the file got interrupted and it's incomplete.

It is safe to ignore it for now which is why it is logged at INFO level instead of ERROR. You can delete the file from the saved_caches/ directory the next time you take Cassandra offline and it will just get rebuilt on startup. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.