# Error while reading piece from cache

**URL:** <https://forum.autonomys.xyz/t/error-while-reading-piece-from-cache/1974>\
**Category:** Support\
**Tags:** gemini, error, farmer\
**Created:** [October 7, 2023, 6:20pm UTC](https://forum.autonomys.xyz/t/error-while-reading-piece-from-cache/1974 "2023-10-07T18:20:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![animu2746](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/animu2746/32/1378_2.png) [@animu2746](https://forum.autonomys.xyz/u/animu2746)\
**Post date:** [October 7, 2023, 6:20pm UTC](https://forum.autonomys.xyz/t/error-while-reading-piece-from-cache/1974/1 "2023-10-07T18:20:06Z")

</div>

## Issue Report

Error while reading piece from cache, might be a disk corruption

### Environment

ubuntu 20.0

- **Operating System:** r7 5800x 64gb ram, ssd 2x u2
- **Pulsar/Advanced CLI/Docker:** adv cli

### Problem

I got this error when plot. Anything to do or check?

```auto
:piece_cache: Error while reading piece from cache, might be a disk corruption error=Checksum mismatch disk_farm_index=0 key=Key(b"\x90\xb2\xce\x05\x08\xcc0\0\0\0\0\0\0") offset=952

```

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/nazar-pc/32/6_2.png) [@nazar-pc](https://forum.autonomys.xyz/u/nazar-pc)\
**Post date:** [October 7, 2023, 6:28pm UTC](https://forum.autonomys.xyz/t/error-while-reading-piece-from-cache/1974/2 "2023-10-07T18:28:49Z")

</div>

This generally shouldn’t happen, especially on SSDs.  
There are two possibilities: data is corrupted on disk or not.

If data is corrupted it might be corrupted before writing. It usually happens due to memory issues (high overclock for example), in which case application thinks it operates on correct data, but it is not or it did correct computation, but during writes corrupted bits were written.

If data is not corrupted it could be either memory issues that corrupted in-memory data, but plots is fine, or could be storage medium error and more rarely some other hardware issues with motherboard, CPU or PSU.

I’d recommend starting with memory test and if it succeeds `subspace-farmer` has a `scrub` command that wil read through the farm and will try to find and correct errors it encounters. After scrub and restart farmer will fill replace broken data with correct ones.

---

<div class="post-metadata">

**Author:** ![Rabinovitch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.autonomys.xyz/rabinovitch/32/99_2.png) [@Rabinovitch](https://forum.autonomys.xyz/u/Rabinovitch)\
**Post date:** [November 13, 2023, 8:16pm UTC](https://forum.autonomys.xyz/t/error-while-reading-piece-from-cache/1974/3 "2023-11-13T20:16:15Z")

</div>

And scrub will look like this:

```auto
2023-11-13T19:03:38.782961Z WARN single_disk_farm{disk_farm_index=0}: subspace_farmer::single_disk_farm: Failed to decode sector metadata, replacing with dummy expired sector metadata path=/media/SN750-4/plot0/metadata.bin error=Could not decode `SectorMetadataChecksummed.0`:
        Could not decode `SectorMetadata::history_size`:
                Could not decode `HistorySize.0`:
                        cannot create non-zero number from 0
 sector_index=764
2023-11-13T19:03:45.229348Z INFO single_disk_farm{disk_farm_index=0}: subspace_farmer::single_disk_farm: Checked 720/765 sectors

```
