Failed to open stream: Permission denied
-
Hello
My issue looks the same as https://forum.cloudron.io/topic/13321/failed-to-open-stream-permission-denied-for-cache-data/7 but I don't think a solution as been provided

Jan 10 17:23:32 => Run cron tasks Jan 10 17:23:32 In Filesystem.php line 122: Jan 10 17:23:32 2026-01-10T16:23:32Z Jan 10 17:23:32 file_put_contents(/app/code/storage/framework/cache/data/71/e7/71e745d13645 Jan 10 17:23:32 beba997b5011324db8ee58db0e30): Failed to open stream: Permission deniedI'm running Freescout 1.8.201 and emails are not automatically fetched. I've to click on Manage > Tools Fetch Emails to get them.
On Manage > Status I can read:
Non-writable files found/app/code/storage/framework/cache/data/71/e7/71e745d13645beba997b5011324db8ee58db0e30
Run the following command (read more):
sudo chown -R www-data:www-data /app/code
on storage/framework/cache/data/
I've tried sudo chown -R www-data:www-data /app/code but it anwsers "Read only file system"
I've also tried sudo chmod 775 -R /app/code/ with same results.Do you have any idea what I can test ?
Generate Diagnostics Data
-
S sebastienserre referenced this topic
-
Rebooting mail service and then Freescout app is solving the issue.
I will monitor to see if it's definitively fixed. -
The error just came back....
-
So
/app/codeis read-only in Cloudron, however/app/code/storageis linked into/app/data/, which is read-write. So the correct chown would be against/app/data/storage/in this case. The startup code of the app does this already, which is why it works after a restart.Then the question remains, who changes permissions on that cache folder. Do you have some custom cron job or so which may run as root maybe? Which plugins have you installed, which could interfere here?
-
Hello @nebulon
I've a cron here:

Here the list of Freescout module:

In the Workflows, I only have rule like "if email is XXXX then apply tag XXXX"
-
Ah I see, that custom cron is most likely the root case then, since it runs the scheduler as root instead of www-data. Either way the package already comes with this cron job: https://git.cloudron.io/packages/freescout-app/-/blob/master/cron.sh?ref_type=heads
So you should be fine with just removing your custom cron setting there, if I read that correctly, and that hopefully solves the issue.
-
I've removed and will monitor few days .
Thanks -
Removed it and no emails are fetch.
What's strange is I'm checking the emails on the Sogo Webmail (on Cloudron) and the email is mark as read... but not available on Freescout -
The error gone thank you @nebulon
I now have an issue on mails which are not fetched
This is now like if Cron tasks were not correctly done. The email is mark as read but not available in Freescout.- Setting unread an email
- Visiting the URL https://example.com/system/cron/04c3f0b4a3771c3d76a2fac9a70b71a7 is fetching the unread emails.
and the email is in Freescout but as per Freescout
Cron Commands Make sure that you have the following line in your crontab: * * * * * php /app/code/artisan schedule:run >> /dev/null 2>&1 Alternatively cron job can be executed by requesting the following URL every minute (this method is not recommended as some features may not work as expected, use it at your own risk): https://example.com/system/cron/04c3f0b4a3771c3d76a2fac9a70b71a7So I really do not know what I have to do

-
Though this is exactly what the cronjob from the package already does. Cloudron runs that every minute. So at max it should take 1 minute for freescout to catch up on the emails.
You can also trigger the cloudron's cron job in the top right menu, if you open a webterminal into the app. Just to see if this fetches the mails correctly.
-
yes but without the external cron no emails are fetch.
-
I feel there is something else happening here, since both are running the same command. Can you run the cron shipped via the package (via the webterminal) and see if it shows any errors? We use freescout for the Cloudron support ticket and no further cron schedule should be required. Do you see any errors at all (besides the permissions issues, which are to be expected if you run some parts as root and they update cache files, which is wrong in the first place)