# CLI run of maintenance not working - cannot free up space

**URL:** <https://kopia.discourse.group/t/cli-run-of-maintenance-not-working-cannot-free-up-space/3276>\
**Category:** General Topics\
**Created:** [September 19, 2024, 7:04pm UTC](https://kopia.discourse.group/t/cli-run-of-maintenance-not-working-cannot-free-up-space/3276 "2024-09-19T19:04:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tugdualenligne](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/tugdualenligne/32/469_2.png) [@tugdualenligne](https://kopia.discourse.group/u/tugdualenligne)\
**Post date:** [September 19, 2024, 7:04pm UTC](https://kopia.discourse.group/t/cli-run-of-maintenance-not-working-cannot-free-up-space/3276/1 "2024-09-19T19:04:33Z")

</div>

Hi, I deleted a few snapshots for several hundred Gb of data and cannot get them deleted for a good week now. When I try force a full maintenance whether or not I add the --safety=none tag, I get the following:  
root@kopia3:/app# kopia maintenance run --full  
ERROR maintenance must be run by designated user: root@kopia3

However, maintenance info says:  
kopia maintenance info  
Owner: root@kopia3

So I suspect maintenance should work. Any help / suggestion welcome!

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [September 19, 2024, 7:17pm UTC](https://kopia.discourse.group/t/cli-run-of-maintenance-not-working-cannot-free-up-space/3276/2 "2024-09-19T19:17:14Z")

</div>

What do these commands say?

```auto
$ whoami

$ hostname

```

---

<div class="post-metadata">

**Author:** ![tugdualenligne](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/tugdualenligne/32/469_2.png) [@tugdualenligne](https://kopia.discourse.group/u/tugdualenligne)\
**Post date:** [September 19, 2024, 7:52pm UTC](https://kopia.discourse.group/t/cli-run-of-maintenance-not-working-cannot-free-up-space/3276/3 "2024-09-19T19:52:28Z")

</div>

Thx. I think I found the issue. There might be a bug related to the move-history command  
Let me explain: some of my files where with root@kopia3, other with me@kopia3  
I moved the history from me to root, and set maintenance owner to root. But this generated the error I report in my above message.  
So I tried moving back maintenance owner to me, and… tada! the maintenance run works and seems to delete the files! (need a few hours to confirm in Storj dashboard the data is deleted, but I think it is)

root@kopia3:/app# kopia maintenance set --owner=me@kopia3  
Setting maintenance owner to mee@kopia3  
root@kopia3:/app# kopia maintenance run --full  
Running full maintenance…  
Looking for active contents…  
Looking for unreferenced contents…  
… found 100000 unused contents so far (201.4 GB bytes)  
… found 200000 unused contents so far (402.3 GB bytes)  
… found 300000 unused contents so far (602.8 GB bytes)  
… found 400000 unused contents so far (745.7 GB bytes)  
GC found 459157 unused contents (745.8 GB)  
GC found 0 unused contents that are too recent to delete (0 B)  
GC found 293309 in-use contents (619.2 GB)  
GC found 7093 in-use system-contents (27.4 MB)  
Rewriting contents from short packs…  
Total bytes rewritten 3.6 GB  
Found safe time to drop indexes: 2024-09-16 21:26:27.066234353 +0200 CEST  
Dropping contents deleted before 2024-09-16 21:26:27.066234353 +0200 CEST  
Skipping blob deletion because not enough time has passed yet (59m38s left).  
Compacting an eligible uncompacted epoch…  
Cleaning up no-longer-needed epoch markers…  
Attempting to compact a range of epoch indexes …  
Cleaning up unneeded epoch markers…  
Cleaning up old index blobs which have already been compacted…  
Cleaned up 2 logs.  
Finished full maintenance.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [September 20, 2024, 9:05am UTC](https://kopia.discourse.group/t/cli-run-of-maintenance-not-working-cannot-free-up-space/3276/4 "2024-09-20T09:05:57Z")

</div>

This is interesting indeed. Have you tried to set maintenance ownership again?:

```auto
$ kopia maintenance set --owner=root
$ kopia maintenance set --owner=kopia3

```

and see if it fixes the issue?
