<?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[&quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data]]></title><description><![CDATA[<p dir="auto">Anyone else seeing this behavior?</p>
<p dir="auto">Having trouble with files in the cache directory under <code>/app/data/storage/framework/cache/data</code> being created with <code>root/root</code>, stalling background jobs and causing frequent disconnects in the frontend.</p>
<p dir="auto"><img src="/assets/uploads/files/1740010951712-87c4b643-2bfd-4d62-9de6-69f5f04d2ef2-image.png" alt="87c4b643-2bfd-4d62-9de6-69f5f04d2ef2-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1740010985039-1c56fd36-66d7-4f36-b2ff-dbd748ae1494-image.png" alt="1c56fd36-66d7-4f36-b2ff-dbd748ae1494-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">After changing the user/group for <code>cache/data</code> directory recursively to www-data/www-data, things are working for a moment. Then the same thing happens again. I had a quick go around and couldn't find any obvious misalignment in the configuration or running processes.</p>
]]></description><link>https://forum.cloudron.io/topic/13321/failed-to-open-stream-permission-denied-for-cache-data</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 05:43:20 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/13321.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Feb 2025 01:02:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Wed, 18 Mar 2026 18:36:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> apologies, I jumped the gun on that last post. You were right.</p>
<p dir="auto">I had a look at the box source code (<code>src/scheduler.js</code>, <code>src/docker.js</code>) and the manifest command IS respected by the scheduler. The <code>php artisan schedule:run</code> on my instance came from a custom crontab entry carried over when we migrated from a standalone install to Cloudron over 2 years ago. That entry must have slipped through unnoticed, but it explains everything.</p>
<p dir="auto">After removing it, the scheduler container (now suffixed <code>-housekeeping</code> instead of <code>-crontab.0</code>) correctly runs <code>cron.sh</code>:</p>
<pre><code>$ docker inspect --format '{{.Config.Cmd}}' 1af144bb-fbf4-434d-8edd-bb4b95c00ef5-housekeeping
Cmd: [/bin/sh -c /app/pkg/cron.sh]
</code></pre>
<p dir="auto">Things are working correctly with <code>cron.sh</code> + gosu now <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f62c.png?v=13d69e59554" class="not-responsive emoji emoji-android emoji--grimacing" style="height:23px;width:auto;vertical-align:middle" title=":grimacing:" alt="😬" /></p>
<p dir="auto">I should have caught this sooner. In my defense (barely), the Cron tab of the app doesn't mention that commands run as root. I eventually found it in the documentation at the bottom of the Cron page. A small note in the Cron tab itself would probably help others avoid the same mistake.</p>
<p dir="auto">Cheers,<br />
JD</p>
]]></description><link>https://forum.cloudron.io/post/122147</link><guid isPermaLink="true">https://forum.cloudron.io/post/122147</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Wed, 18 Mar 2026 18:36:09 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Wed, 18 Mar 2026 18:26:40 GMT]]></title><description><![CDATA[<p dir="auto">Wait one, I have a suspicion ...</p>
]]></description><link>https://forum.cloudron.io/post/122143</link><guid isPermaLink="true">https://forum.cloudron.io/post/122143</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Wed, 18 Mar 2026 18:26:40 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Wed, 18 Mar 2026 18:14:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> you're right that <code>cron.sh</code> itself uses gosu. That part is fine. The issue isn't with <code>cron.sh</code>.</p>
<p dir="auto">The issue is the <strong>sidecar container</strong> that the scheduler addon creates. On the host:</p>
<pre><code>$ docker ps --format '{{.Names}} {{.Command}}' | grep 1af144bb
1af144bb-fbf4-434d-8edd-bb4b95c00ef5-crontab.0  "/bin/sh -c 'php /ap…"
1af144bb-fbf4-434d-8edd-bb4b95c00ef5             "/app/pkg/start.sh"
</code></pre>
<p dir="auto">The sidecar doesn't run <code>/app/pkg/cron.sh</code>. It runs <code>php artisan schedule:run</code> directly:</p>
<pre><code>$ docker inspect --format 'Cmd: {{.Config.Cmd}}
  User: "{{.Config.User}}"
  Image: {{.Config.Image}}' 1af144bb-fbf4-434d-8edd-bb4b95c00ef5-crontab.0

Cmd: [/bin/sh -c php /app/code/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1]
User: ""
Image: cloudron/net.freescout.cloudronapp:202603171110280000
</code></pre>
<p dir="auto">No user is set (empty string), so it defaults to root. The gosu in <code>cron.sh</code> is never reached because the sidecar bypasses <code>cron.sh</code> entirely.</p>
<p dir="auto">This is easy to verify on any box with a freescout app running:</p>
<pre><code>docker inspect --format '{{.Config.Cmd}}' &lt;app-id&gt;-crontab.0
</code></pre>
<p dir="auto">This is what creates the root-owned cache files under <code>storage/framework/cache/data/</code>.</p>
]]></description><link>https://forum.cloudron.io/post/122139</link><guid isPermaLink="true">https://forum.cloudron.io/post/122139</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Wed, 18 Mar 2026 18:14:32 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Wed, 18 Mar 2026 02:10:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/neoplex" aria-label="Profile: neoplex">@<bdi>neoplex</bdi></a> not sure I understand. <code>cron.sh</code> does run as root. This is intentional because an app can run with multiple users. The <code>cron.sh</code> can decide what to do.</p>
<p dir="auto"><a href="https://git.cloudron.io/packages/freescout-app/-/blob/master/cron.sh?ref_type=heads#L10" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/packages/freescout-app/-/blob/master/cron.sh?ref_type=heads#L10</a> is running it via gosu which basically is run-as "www-data". The cron script is thus not being run as root.</p>
]]></description><link>https://forum.cloudron.io/post/122087</link><guid isPermaLink="true">https://forum.cloudron.io/post/122087</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Wed, 18 Mar 2026 02:10:38 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Tue, 17 Mar 2026 18:13:41 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a>, thanks for picking up the patch!</p>
<p dir="auto">So, that one cleaned up the queue worker side of things (which was genuinely broken), but the root-owned cache files started appearing again. I've spent some more time on this and I FINALLY found the culprit ...</p>
<p dir="auto">Turns out it's not anything inside the app container. It's the <strong>scheduler sidecar</strong>.</p>
<p dir="auto">On the host:</p>
<pre><code>$ docker ps --format '{{.Names}} {{.Command}}' | grep &lt;app-id&gt;
&lt;app-id&gt;-crontab.0  "/bin/sh -c 'php /ap…"
&lt;app-id&gt;             "/app/pkg/start.sh"
</code></pre>
<pre><code>$ docker inspect --format '{{.Config.Cmd}}' &lt;app-id&gt;-crontab.0
[/bin/sh -c php /app/code/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1]

$ docker inspect --format '{{.Config.User}}' &lt;app-id&gt;-crontab.0
(empty - runs as root)
</code></pre>
<p dir="auto">The sidecar runs <code>php artisan schedule:run</code> directly as root every minute, creating scheduler mutex files and other cache entries under <code>storage/framework/cache/data/</code> owned by <code>root:root</code>. When the app (running as <code>www-data</code>) tries to write to those same directories - permission denied.</p>
<p dir="auto">Two things I noticed:</p>
<ol>
<li>The sidecar doesn't use the manifest's <code>"command": "/app/pkg/cron.sh"</code> - which uses gosu to drop privileges - it hardcodes <code>php artisan schedule:run</code> instead</li>
<li>It runs without a user set, so it defaults to root</li>
</ol>
<p dir="auto">The fix from MR61 is still good to keep, but need to address the sidecar situation. For the freescout app specifically, I've now removed the <code>scheduler</code> addon and switched to running the <code>schedule:run</code> job in the same container via a supervisor-managed process. That eliminates the sidecar container entirely.</p>
<p dir="auto">I've patched and tested the repo accordingly:</p>
<p dir="auto"><a href="https://github.com/pronetivity/cloudron-freescout/commit/6771b826ee45cca6fc75d145f85d9d3da198daae" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pronetivity/cloudron-freescout/commit/6771b826ee45cca6fc75d145f85d9d3da198daae</a></p>
<p dir="auto"><a href="https://github.com/pronetivity/cloudron-freescout/blob/master/LARAVEL-CACHE-FIX.md" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pronetivity/cloudron-freescout/blob/master/LARAVEL-CACHE-FIX.md</a></p>
<p dir="auto">As for the scheduler sidecar - shouldn't it respect the manifest command (or run as the app user)? That would be a nicer fix at the platform level going forward.</p>
<p dir="auto">Cheers,<br />
JD</p>
]]></description><link>https://forum.cloudron.io/post/122067</link><guid isPermaLink="true">https://forum.cloudron.io/post/122067</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Tue, 17 Mar 2026 18:13:41 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Tue, 17 Mar 2026 11:14:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/neoplex" aria-label="Profile: neoplex">@<bdi>neoplex</bdi></a> thank you. Since we host on gitlab, I applied the patch by hand with only the relevant bits - <a href="https://git.cloudron.io/packages/freescout-app/-/merge_requests/61" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/packages/freescout-app/-/merge_requests/61</a></p>
]]></description><link>https://forum.cloudron.io/post/122032</link><guid isPermaLink="true">https://forum.cloudron.io/post/122032</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Tue, 17 Mar 2026 11:14:08 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Tue, 17 Mar 2026 00:38:37 GMT]]></title><description><![CDATA[<p dir="auto">I am also going to leave this here:</p>
<p dir="auto">I finally got around to putting together a fix:</p>
<p dir="auto"><a href="https://github.com/pronetivity/cloudron-freescout/commit/27697c310fb373f1a972c7990f5c00dc3052ee54" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pronetivity/cloudron-freescout/commit/27697c310fb373f1a972c7990f5c00dc3052ee54</a></p>
<p dir="auto">A detailed analysis is available here:</p>
<p dir="auto"><a href="https://github.com/pronetivity/cloudron-freescout/blob/master/LARAVEL-CACHE-FIX.md" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/pronetivity/cloudron-freescout/blob/master/LARAVEL-CACHE-FIX.md</a></p>
<p dir="auto">Disclaimer: the commit also includes a few quality-of-life changes. The actual fix is limited to the caching adjustments.</p>
<p dir="auto">Cheers,<br />
JD</p>
]]></description><link>https://forum.cloudron.io/post/121997</link><guid isPermaLink="true">https://forum.cloudron.io/post/121997</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Tue, 17 Mar 2026 00:38:37 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Mon, 16 Mar 2026 19:14:31 GMT]]></title><description><![CDATA[<p dir="auto">I've fixed this. Will send a patch via existing support email thread.</p>
]]></description><link>https://forum.cloudron.io/post/121977</link><guid isPermaLink="true">https://forum.cloudron.io/post/121977</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Mon, 16 Mar 2026 19:14:31 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Sat, 01 Mar 2025 12:02:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/neoplex" aria-label="Profile: neoplex">@<bdi>neoplex</bdi></a> unfortunately, cannot reproduce. If it's easy to see this, can you please send a mail to <a href="mailto:support@cloudron.io" target="_blank" rel="noopener noreferrer nofollow ugc">support@cloudron.io</a> and we can take a look to debug this further.</p>
]]></description><link>https://forum.cloudron.io/post/102477</link><guid isPermaLink="true">https://forum.cloudron.io/post/102477</guid><dc:creator><![CDATA[joseph]]></dc:creator><pubDate>Sat, 01 Mar 2025 12:02:15 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Wed, 26 Feb 2025 17:00:39 GMT]]></title><description><![CDATA[<p dir="auto">Yep!</p>
<p dir="auto"><img src="/assets/uploads/files/1740589233818-e52e4fb8-64eb-4342-81dd-85a951e2ccb6-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.cloudron.io/post/102361</link><guid isPermaLink="true">https://forum.cloudron.io/post/102361</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Wed, 26 Feb 2025 17:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Mon, 24 Feb 2025 17:51:12 GMT]]></title><description><![CDATA[<p dir="auto">are you on the package 1.13.2 ? just to get that out of the way.</p>
]]></description><link>https://forum.cloudron.io/post/102236</link><guid isPermaLink="true">https://forum.cloudron.io/post/102236</guid><dc:creator><![CDATA[joseph]]></dc:creator><pubDate>Mon, 24 Feb 2025 17:51:12 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Sat, 22 Feb 2025 17:06:14 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1740243973740-366ce633-23cd-4dc7-a54e-950565222abc-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.cloudron.io/post/102152</link><guid isPermaLink="true">https://forum.cloudron.io/post/102152</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Sat, 22 Feb 2025 17:06:14 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Sat, 22 Feb 2025 17:05:02 GMT]]></title><description><![CDATA[<p dir="auto">It's not the cron job. It's this job that's executed by the queue worker.</p>
<p dir="auto"><img src="/assets/uploads/files/1740243769259-c0b8ea48-576f-4aa6-9f83-6b498e6ab62b-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1740243815719-2103d0ee-a6fb-4f86-9f56-77377daeb9d6-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Although the PHP script that the queue worker is being executed with runs as <code>www-data</code>.</p>
<p dir="auto"><img src="/assets/uploads/files/1740243895669-6b3248a9-e6a6-46ae-9e2e-8625c1225ca8-image-resized.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The timestamps match.</p>
]]></description><link>https://forum.cloudron.io/post/102151</link><guid isPermaLink="true">https://forum.cloudron.io/post/102151</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Sat, 22 Feb 2025 17:05:02 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Sat, 22 Feb 2025 10:57:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/neoplex" aria-label="Profile: neoplex">@<bdi>neoplex</bdi></a> are you able to reproduce this by running the cron task manually? You can do this by Web Terminal -&gt; Cron on the top. thanks</p>
]]></description><link>https://forum.cloudron.io/post/102143</link><guid isPermaLink="true">https://forum.cloudron.io/post/102143</guid><dc:creator><![CDATA[joseph]]></dc:creator><pubDate>Sat, 22 Feb 2025 10:57:28 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Fri, 21 Feb 2025 15:40:28 GMT]]></title><description><![CDATA[<p dir="auto">It appears that the directories owned by root are created either on the hour or at 45 minutes past the hour. And it seems to be related to those stalled <code>App\Jobs\UpdateFolderCounters</code> job.</p>
]]></description><link>https://forum.cloudron.io/post/102108</link><guid isPermaLink="true">https://forum.cloudron.io/post/102108</guid><dc:creator><![CDATA[neoplex]]></dc:creator><pubDate>Fri, 21 Feb 2025 15:40:28 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Failed to open stream: Permission denied&quot; for cache&#x2F;data on Thu, 20 Feb 2025 09:49:32 GMT]]></title><description><![CDATA[<p dir="auto">AFAICT, everything in the container runs as www-data user. Not sure who is creating these. Can you make a note of the timestamps of the bad directories, next time around? We should try to correlate with app logs.</p>
]]></description><link>https://forum.cloudron.io/post/102034</link><guid isPermaLink="true">https://forum.cloudron.io/post/102034</guid><dc:creator><![CDATA[joseph]]></dc:creator><pubDate>Thu, 20 Feb 2025 09:49:32 GMT</pubDate></item></channel></rss>