# Error when restoring and taking snapshot

**URL:** <https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860>\
**Category:** Support\
**Created:** [January 14, 2022, 8:21am UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860 "2022-01-14T08:21:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![francois072](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@francois072](https://kopia.discourse.group/u/francois072)\
**Post date:** [January 14, 2022, 8:21am UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860/1 "2022-01-14T08:21:02Z")

</div>

Why am I getting this error when restoring files?

```auto
Error: error restoring: restore error: copy directory contents: error reading directory: unable to open object: k9b59b41c1081bef57b0a54a843240b31: unexpected content error: error getting cached content: invalid (offset=9771212,length=187) for blob "qfac8d6304c4b80294441b2124bce1c23-sab66b54666e2296310c" of size 0.

```

I also get a red error message in the snapshot logs, but the logs aren’t long enough to find the error again.

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [January 14, 2022, 3:26pm UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860/2 "2022-01-14T15:26:56Z")

</div>

Seems that you have some zero-length file in the repository. Is this a filesystem or cloud?

---

<div class="post-metadata">

**Author:** ![francois072](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@francois072](https://kopia.discourse.group/u/francois072)\
**Post date:** [January 14, 2022, 3:54pm UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860/3 "2022-01-14T15:54:51Z")

</div>

It is a filesystem.  
I did the snapshot and restore as a test of Kopia-ui

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [January 14, 2022, 4:10pm UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860/4 "2022-01-14T16:10:22Z")

</div>

So it’s a brand new repo on a regular filesystem? Or is the filesystem special in any way (network-based, cloud-based) ?

Can you locate the file in the repository directory (will be under `<repo-dir>/q/fa` subdirectory) and see what the length is? Kopia seems to be thinking it’s zero.

---

<div class="post-metadata">

**Author:** ![francois072](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@francois072](https://kopia.discourse.group/u/francois072)\
**Post date:** [January 14, 2022, 4:51pm UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860/5 "2022-01-14T16:51:03Z")

</div>

Regular filesystem.

 ![image](https://global.discourse-cdn.com/free1/uploads/kopia/original/1X/1b369cebeb83162f62ea17f3e888f2bdc0dc9c1e.png)

---

<div class="post-metadata">

**Author:** ![stpr](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@stpr](https://kopia.discourse.group/u/stpr)\
**Post date:** [January 14, 2022, 11:14pm UTC](https://kopia.discourse.group/t/error-when-restoring-and-taking-snapshot/860/6 "2022-01-14T23:14:00Z")

</div>

What kind of filesystem is this (FAT, ext4, btrfs)? The path almost indicates a removable drive, is this correct? I encountered something like this before, but in my case, it was a hardware problem. I had a USB flash drive that would refuse to copy the file contents and would get stuck. Can you rule out that you are using a external drive, and that the drive is problem free? Also, kopia should have logs for the snapshot you look, can you see if there are any errors mentioned in the logs?
