# ERROR	pieces:trash	emptying trash failed

**URL:** <https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859>\
**Category:** troubleshooting\
**Tags:** error-codes, storagenode\
**Created:** [April 13, 2020, 11:39am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859 "2020-04-13T11:39:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kollo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kollo/32/66_2.png) [@kollo](https://forum.storj.io/u/kollo)\
**Post date:** [April 13, 2020, 11:39am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/1 "2020-04-13T11:39:34Z")

</div>

If I receive this error : **ERROR pieces:trash emptying trash failed**

Can I empty **storage/trash** folder on my own. Or data can be rolled back/needs to be deleted by satellite so leave them intact?

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [April 13, 2020, 4:37pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/2 "2020-04-13T16:37:40Z")

</div>

Don’t remove it yourself, it may be needed to restore data. The expired parts will be caught in the next bloom filter and removed next time. No need to do anything.

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [April 13, 2020, 4:40pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/3 "2020-04-13T16:40:41Z")

</div>

> [@BrightSilence](#):
>
> it may be needed to restore data

Can you elaborate on that on how it can be used to restore data ?

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [April 13, 2020, 4:44pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/4 "2020-04-13T16:44:40Z")

</div>

If an error is made by the satellite and it sends a faulty or empty bloom filter. Pieces may be moved to trash that shouldn’t be removed. This must then be corrected, hence why the trash folder exists. It’s a contingency. Likely not needed, but you should still never delete anything on your own.

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [April 13, 2020, 4:53pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/5 "2020-04-13T16:53:48Z")

</div>

> [@BrightSilence](#):
>
> This must then be corrected, hence why the trash folder exists

This is what I was trying to say but in not so many words.

> [@When we see in log real delete operations?](https://forum.storj.io/t/when-we-see-in-log-real-delete-operations/4933/4):
>
> Who says this is a feature? The 7 day delay only applies to files deleted through garbage collection. Not deletions processed by the node immediately. Now I know there is an issue where not all deletes get processed fast enough by the satellites and as a result some of the normal deletes will get caught in garbage collection instead of being processed right away. But this is something that needs to be fixed. It’s not the intended way of how things should work. However, I’m pretty sure that the…

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [April 13, 2020, 8:24pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/6 "2020-04-13T20:24:05Z")

</div>

I guess I tripped over the wording around offering a feature to recover files. This is a fallback that only Storjlabs could use to trigger recovery of data. Its not something that the customer or node operator would use. It’s only meant to recover from garbage collector problems. Not to recover deleted customer files, but to recover pieces on nodes that were incorrectly removed.

---

<div class="post-metadata">

**Author:** ![kollo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kollo/32/66_2.png) [@kollo](https://forum.storj.io/u/kollo)\
**Post date:** [April 13, 2020, 10:06pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/7 "2020-04-13T22:06:41Z")

</div>

Ok, so to recap. Data from trash dir shouldn’t be deleted by hand as it can be used to recover files.

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [April 13, 2020, 10:10pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/8 "2020-04-13T22:10:46Z")

</div>

I’m too much of a perfectionist to agree with that recap, but your conclusion is correct. Don’t delete data from trash.

---

<div class="post-metadata">

**Author:** ![Sasha](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/sasha/32/69_2.png) [@Sasha](https://forum.storj.io/u/Sasha)\
**Post date:** [May 12, 2020, 3:41am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/9 "2020-05-12T03:41:24Z")

</div>

> [@BrightSilence](#):
>
> If an error is made by the satellite and it sends a faulty or empty bloom filter. Pieces may be moved to trash that shouldn’t be removed. This must then be corrected, hence why the trash folder exists. It’s a contingency. Likely not needed, but you should still never delete anything on your own.

I wonder if you still get paid the storage that is in trash for this 7+ days period it’s sitting in the trash folder before certain files get removed.

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [May 12, 2020, 5:33am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/10 "2020-05-12T05:33:50Z")

</div>

I currently have 65GB on a very active node that hasn’t been offline in a while.  
The payment for this amount to stay in the trash for 1 week would be 0.024$… Can’t say it’s nothing but it’s not much either.  
However, the idea is that most pieces in the trash are only there because a node failed to delete it when the request from the satellite arrived. So basically it’s your node’s fault that there is data that shouldn’t be there. And therefore it is probably not paid. Especially as it could be used to cheat the system if you compile your own software that ignores all deletes and just moves the file to the trash.

Apart from that I am actually suprised that I have 65GB in my trash! My node is quite performant so it shouldn’t have missed that many deletes.

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [May 12, 2020, 5:42am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/11 "2020-05-12T05:42:54Z")

</div>

Do you mean if such an empty bloom filter is sent or during normal operation? During normal operation data only goes to trash if your node was either offline or unable to respond to a delete request in time. I doubt you’ll be paid for that data, since the satellite has already marked it as deleted and informed your node of that.

---

<div class="post-metadata">

**Author:** ![Sasha](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/sasha/32/69_2.png) [@Sasha](https://forum.storj.io/u/Sasha)\
**Post date:** [May 13, 2020, 1:15am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/12 "2020-05-13T01:15:55Z")

</div>

I have over 158 GB in trash sitting there for a long time and it just increases over time, which to me is wasted space hosted on the node.

I actually checked this morning and it’s now 169.8 GB…

 ![trash](https://storj-s3.bcdn.literatehosting.net/original/2X/3/3dc7558b68d7418a216008b3e71e873e60b814b2.png)

---

<div class="post-metadata">

**Author:** ![Sasha](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/sasha/32/69_2.png) [@Sasha](https://forum.storj.io/u/Sasha)\
**Post date:** [May 13, 2020, 1:22am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/13 "2020-05-13T01:22:17Z")

</div>

The issue that I see is, you don’t get paid upload ingress and if data is uploaded and deleted, uploaded and deleted… you are utilizing a lot of bandwidth, hdd writes and deletes and SNO’s are not paid for X GB’s of data.

Also if GB’s of data sits in the trash folder for 10+ days, again this is wasted storage not available to SNO.

Looking at OP’s post I also checked my log and I didn’t find any type of error. So I don’t have the reported issue but I have noticed large amounts of data sitting in the trash folder for a long time.

 ![trash](https://storj-s3.bcdn.literatehosting.net/original/2X/3/3dc7558b68d7418a216008b3e71e873e60b814b2.png)

date format: DD/MM/YYYY

I actually didn’t notice this until now, but some of these folders are VERY VERY OLD… ☹

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [May 13, 2020, 5:41am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/14 "2020-05-13T05:41:14Z")

</div>

Folder age doesn’t indicate anything, the file age is relevant.

It’s not a problem if customers upload and delete and upload and delete… That’s how the system is designed and is a legitimate usage. You still get paid for the stored data.

However, I agree that it needs investigating why there are so many pieces in the trash although a node doesn’t see an error and is online all the time. Mine still has 67GB.  
But I think they are/will check it out.

---

<div class="post-metadata">

**Author:** ![nerdatwork](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/nerdatwork/32/1135_2.png) [@nerdatwork](https://forum.storj.io/u/nerdatwork)\
**Post date:** [May 13, 2020, 6:19am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/15 "2020-05-13T06:19:24Z")

</div>

> [@kevink](#):
>
> why there are so many pieces in the trash although a node doesn’t see an error and is online all the time

Node has to delete a piece under a time limit if it doesn’t then it gets moved in to trash.

---

<div class="post-metadata">

**Author:** ![BrightSilence](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brightsilence/32/6048_2.png) [@BrightSilence](https://forum.storj.io/u/BrightSilence)\
**Post date:** [May 13, 2020, 7:12am UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/16 "2020-05-13T07:12:25Z")

</div>

The folders are created only once. There are 1024 folders per satellite that will be reused over and over. Deleting them would be a waste of resources since those same folders will be needed again and they don’t take up space anyway. The files are deleted after 7 days. Normal upload and delete cycles don’t end up in trash. So yes you won’t get paid much if data is uploaded and immediately deleted. But it also won’t end up in trash taking up space.

---

<div class="post-metadata">

**Author:** ![Sasha](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/sasha/32/69_2.png) [@Sasha](https://forum.storj.io/u/Sasha)\
**Post date:** [May 15, 2020, 12:00pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/17 "2020-05-15T12:00:03Z")

</div>

Trash folder now has grown to 273.6 GB

---

<div class="post-metadata">

**Author:** ![donald.m.motsinger](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/donald.m.motsinger/32/71_2.png) [@donald.m.motsinger](https://forum.storj.io/u/donald.m.motsinger)\
**Post date:** [May 15, 2020, 3:38pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/18 "2020-05-15T15:38:34Z")

</div>

> [@Sasha](#):
>
> Also if GB’s of data sits in the trash folder for 10+ days, again this is wasted storage not available to SNO.

That’s not true, there are no files older than 8 days in there. Check for yourself with

`for i in {1..10}; do c=$(find /mnt/storagenode1/node/storage/trash/ -mindepth 1 -type f -mtime -$i |wc -l); echo "Day $i: $c"; done`

Of course, you’ll need to change the path to your trash folder accordingly.

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [May 15, 2020, 3:51pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/19 "2020-05-15T15:51:57Z")

</div>

So how to interpret this output of your command:

```auto
for i in {1..30}; do c=$(find /media/STORJ3/STORJ/storage/trash/ -mindepth 1 -type f -mtime -$i |wc -l); echo "Day $i: $c"; done
Day 1: 2186
Day 2: 2966
Day 3: 4677
Day 4: 25144
Day 5: 25144
Day 6: 25144
Day 7: 26374
Day 8: 26374
Day 9: 26374
Day 10: 26374

```

---

<div class="post-metadata">

**Author:** ![donald.m.motsinger](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/donald.m.motsinger/32/71_2.png) [@donald.m.motsinger](https://forum.storj.io/u/donald.m.motsinger)\
**Post date:** [May 15, 2020, 4:01pm UTC](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859/20 "2020-05-15T16:01:54Z")

</div>

There are 2186 files younger than 1 day, 2966 files younger than 2 days, etc. Files younger than 1 days are of course also younger than 2 days, that’s why the numbers increase.

[Next page](https://forum.storj.io/t/error-pieces-trash-emptying-trash-failed/5859.md?page=2)
