# Fail to update castopod

**URL:** https://forum.yunohost.org/t/fail-to-update-castopod/41546
**Category:** Support apps
**Tags:** castopod, english
**Created:** [February 12, 2026, 7:27pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546 "2026-02-12T19:27:27Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![magostinelli](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@magostinelli](https://forum.yunohost.org/u/magostinelli)
#### Post date: [February 12, 2026, 7:27pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/1 "2026-02-12T19:27:27Z")

</div>

**What app is this about, and its version** : castopod from v1.13.7~ynh1 to 1.14.1~ynh1  
**What YunoHost version are you running** : 12.1.39  
**What type of hardware are you using** : Virtual machine

### Describe your issue

yunohost app upgrade castopod

[https://paste.yunohost.org/raw/nicezasipa](https://paste.yunohost.org/raw/nicezasipa)

find /var/www/castopod/writable/session | wc -l  
1676020

### Share relevant logs or error messages

2026-02-12 19:55:40,096: WARNING - rm: cannot remove ‘/var/www/castopod/writable/session’: Directory not empty  
2026-02-12 19:55:43,400: ERROR - Failed to upgrade castopod: An error occurred inside the app upgrade script

---

<div class="post-metadata">

### Author: ![djez](https://forum.yunohost.org/user_avatar/forum.yunohost.org/djez/32/736_2.png) [@djez](https://forum.yunohost.org/u/djez)
#### Post date: [February 13, 2026, 9:14am UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/2 "2026-02-13T09:14:04Z")

</div>

Hi @magostinelli,

You already found the root cause yourself → the `writable/session` directory contains **1.6 million session files** 😮 , which prevents the `rm` command from completing during the upgrade (the upgrade script uses `--full_replace` which tries to wipe the entire `/var/www/castopod` directory before extracting the new sources).

**To fix this and complete the upgrade:**

1. First, clean up the session files (using `find -delete` which handles millions of files much better than `rm -rf`):

```bash
find /var/www/castopod/writable/session -type f -delete

```

1. Then retry the upgrade:

```bash
yunohost app upgrade castopod

```

🤞

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 13, 2026, 9:39am UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/3 "2026-02-13T09:39:10Z")

</div>

I’m still unsure why Castopod does not run regular garbage collection on stale sessions 🤔

---

<div class="post-metadata">

### Author: ![magostinelli](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@magostinelli](https://forum.yunohost.org/u/magostinelli)
#### Post date: [February 13, 2026, 10:40am UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/4 "2026-02-13T10:40:21Z")

</div>

What appen if I delete the files in the session directory? I hope that castopod continues to work…  
Can I periodically delete old files (\< 7 days) in that directory?

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 13, 2026, 10:44am UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/5 "2026-02-13T10:44:03Z")

</div>

All the clients will be logged out and have to reauth, but other than that it’s a no-op.

I found the culprit for this folder growing too large, I’ll release 1.14.1~ynh2 in a sec that should

- upgrade properly as I ingested @djez proposal
- run periodic session GC from there on

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 13, 2026, 10:55am UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/6 "2026-02-13T10:55:16Z")

</div>

@magostinelli can you try upgrading from `testing` branch?

```auto
sudo yunohost app upgrade castopod -u https://github.com/YunoHost-Apps/castopod_ynh/tree/testing

```

This fix deletes stale sessions and sets up proper session GC so that the problem does not resurface in the future.

---

<div class="post-metadata">

### Author: ![magostinelli](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@magostinelli](https://forum.yunohost.org/u/magostinelli)
#### Post date: [February 13, 2026, 2:46pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/7 "2026-02-13T14:46:11Z")

</div>

I tried, another error:

[https://paste.yunohost.org/raw/esajanujod](https://paste.yunohost.org/raw/esajanujod)

```auto
2026-02-13 15:29:34,240: WARNING - rm: cannot remove '/var/www/castopod/writable/cache': Directory not empty

```

find /var/www/castopod/writable/cache | wc -l  
117733

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 15, 2026, 5:11pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/8 "2026-02-15T17:11:59Z")

</div>

I’ve added clearing cache to upgrade, can you try again from `testing` branch?

---

<div class="post-metadata">

### Author: ![magostinelli](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@magostinelli](https://forum.yunohost.org/u/magostinelli)
#### Post date: [February 16, 2026, 8:26pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/9 "2026-02-16T20:26:14Z")

</div>

Another error:  
`2026-02-16 12:15:31,318: DEBUG - + ynh_hide_warnings ynh_exec_as_app php8.2 spark cache:clear 2026-02-16 12:15:31,318: DEBUG - + ynh_exec_as_app php8.2 spark cache:clear 2026-02-16 12:15:31,318: DEBUG - + sudo -u castopod env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COREPACK_ENABLE_DOWNLOAD_PROMPT=0 NPM_CONFIG_UPDATE_NOTIFIER=false php8.2 spark cache:clear 2026-02-16 12:15:31,360: DEBUG - Could not open input file: spark`

---

<div class="post-metadata">

### Author: ![orhtej2](https://forum.yunohost.org/user_avatar/forum.yunohost.org/orhtej2/32/8943_2.png) [@orhtej2](https://forum.yunohost.org/u/orhtej2)
#### Post date: [February 16, 2026, 10:08pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/10 "2026-02-16T22:08:33Z")

</div>

~~I’ll fix that one~~ (EDIT: Fixed in 1.15.1), in the meanwhile could you:

```auto
sudo yunohost app shell castopod
php spark cache:clear
exit

```

then attempt updating from testing or main branch?

---

<div class="post-metadata">

### Author: ![magostinelli](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@magostinelli](https://forum.yunohost.org/u/magostinelli)
#### Post date: [February 18, 2026, 4:31pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/11 "2026-02-18T16:31:32Z")

</div>

It worked!  
I used the stable repo.

Thanks for your support!

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [March 5, 2026, 4:32pm UTC](https://forum.yunohost.org/t/fail-to-update-castopod/41546/12 "2026-03-05T16:32:10Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
