<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Fider: old installs carry a large `logs` table inside their own database]]></title><description><![CDATA[<p dir="auto">Posting this because it cost us a nightly backup and I do not think it is documented anywhere.</p>
<h3>What happens</h3>
<p dir="auto">Fider has a logger that writes every log entry into a <code>logs</code> table <strong>inside its own Postgres database</strong>. It is controlled by <code>LOG_SQL</code>, which does not mean "log SQL statements", it means "send logs to SQL". Upstream Fider defaults it to <code>true</code>, and there is no retention, pruning or size cap anywhere in that code path.</p>
<p dir="auto">Cloudron's Fider package up to and including 2.x also set <code>LOG_LEVEL=DEBUG</code>. Fider traces every SQL statement it executes at DEBUG, and each of those trace lines then becomes another row in that same table. On an install with almost no activity this still produced roughly 24 million rows and 22 GB over thirteen months, in a database where every other table was under 120 kB.</p>
<p dir="auto">Because Cloudron takes a full <code>pg_dump</code> of the app database on every backup, that table is dumped and uploaded in full every night. Ours reached 27 GB and took over three hours of the nightly run on its own, and one night the run died inside it and everything scheduled behind it kept a stale backup.</p>
<h3>Two reasons it can go unnoticed for a long time</h3>
<ol>
<li><strong>Package 3.0.0 fixed it, but the changelog does not say so.</strong> 3.0.0 (2026-05-06) sets <code>LOG_LEVEL=INFO</code> and <code>LOG_SQL=false</code>. Its release note reads only "Remove built-in OIDC integration". Nothing tells you your database has been accumulating this, or that the update stops it.</li>
<li><strong>3.0.0 is a major version bump, so it does not install automatically</strong>, even with automatic updates enabled. Ours sat on 2.1.0 for 85 days after the fix was published, still writing. If you have not manually approved a Fider major update recently, you are probably still on 2.x and still writing.</li>
</ol>
<p dir="auto">And the important one: <strong>updating does not clean up what already accumulated.</strong> The fix stops new rows. The existing table stays, and stays in your backups, until you remove it yourself.</p>
<h3>How to check</h3>
<p dir="auto">From the app's Web Terminal:</p>
<pre><code class="language-sh">psql $CLOUDRON_POSTGRESQL_URL -c "SELECT relname, pg_size_pretty(pg_total_relation_size(relid)) \
  FROM pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC LIMIT 5;"
</code></pre>
<p dir="auto">If <code>logs</code> is at the top and measured in GB, this is you.</p>
<p dir="auto">Server wide, from an ssh session on the box, to see whether any app has a disproportionate dump:</p>
<pre><code class="language-sh">find /home/yellowtent/appsdata -maxdepth 2 -name '*dump' -type f -printf '%s\t%p\n' | sort -rn | head
</code></pre>
<h3>How to diagnose</h3>
<p dir="auto">Confirm it is the log table and not real content, and check whether it is still growing:</p>
<pre><code class="language-sh">psql $CLOUDRON_POSTGRESQL_URL -c "SELECT count(*) FROM posts;"
psql $CLOUDRON_POSTGRESQL_URL -c "SELECT max(created_at) FROM logs;"
</code></pre>
<p dir="auto">If the newest log row is from before your last Fider update, writing has already stopped and you are only carrying dead weight. If it is from the last few minutes, you are still on an affected package and should update first, otherwise it will simply refill.</p>
<p dir="auto">Check your package version in the app's About panel. 3.0.0 or later is fixed.</p>
<h3>How to fix</h3>
<p dir="auto">Update to 3.0.0 or later first, so it cannot refill. That is a major update and needs manual approval.</p>
<p dir="auto">Then, if you do not want the old log rows, from the Web Terminal:</p>
<pre><code class="language-sh">psql $CLOUDRON_POSTGRESQL_URL -c "TRUNCATE TABLE logs;"
</code></pre>
<p dir="auto"><code>TRUNCATE</code> returns the disk space immediately. <code>DELETE</code> would not: it leaves dead tuples behind and needs a <code>VACUUM FULL</code> afterwards, which rewrites the whole table and needs free space equal to its size. If you would rather keep recent entries, use <code>DELETE FROM logs WHERE created_at &lt; now() - interval '30 days';</code> and then <code>VACUUM FULL logs;</code>, and be aware of the exclusive lock that takes.</p>
<p dir="auto">Nothing in Fider reads this table, so on an install where you have never used it for anything, truncating is safe. Take a backup first regardless.</p>
<p dir="auto">For us the whole thing was instant: 22 GB to 9.7 MB, and the app's backup went from 3 hours 24 minutes to 19 seconds.</p>
<h3>Two suggestions for the package</h3>
<ul>
<li>Worth a note in the 3.0.0 changelog, or the docs, telling existing installs to prune. The fix is silent, so anybody who updated already still has the table and no reason to suspect it.</li>
<li>A one time cleanup in the package update, or at least a <code>postInstallMessage</code>, would catch the installs that will never read this post.</li>
</ul>
]]></description><link>https://forum.cloudron.io/topic/15766/fider-old-installs-carry-a-large-logs-table-inside-their-own-database</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 14:16:12 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/15766.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Aug 2026 13:27:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fider: old installs carry a large `logs` table inside their own database on Mon, 03 Aug 2026 16:51:53 GMT]]></title><description><![CDATA[<p dir="auto">I guess it's a bit late now since 3.0.0 is already out but thanks for the write up.</p>
]]></description><link>https://forum.cloudron.io/post/127663</link><guid isPermaLink="true">https://forum.cloudron.io/post/127663</guid><dc:creator><![CDATA[joseph]]></dc:creator><pubDate>Mon, 03 Aug 2026 16:51:53 GMT</pubDate></item></channel></rss>