Fail to update castopod

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

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

Hi @magostinelli,

You already found the root cause yourself → the writable/session directory contains 1.6 million session files :open_mouth: , 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):
find /var/www/castopod/writable/session -type f -delete
  1. Then retry the upgrade:
yunohost app upgrade castopod

:crossed_fingers:

1 Like

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

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?

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
1 Like

@magostinelli can you try upgrading from testing branch?

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.

1 Like

I tried, another error:

https://paste.yunohost.org/raw/esajanujod

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

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

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

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

sudo yunohost app shell castopod
php spark cache:clear
exit

then attempt updating from testing or main branch?

1 Like

It worked!
I used the stable repo.

Thanks for your support!

1 Like

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