0

I have a functionality where I am sending emails from a Job class file. But it's always going to the faild_jobs table by logging the following ...

ErrorException: file_put_contents(/home/runcloud/webapps/apiv2/storage/framework/views/a3ec55b820a51da4c32fecf3d29285507a159c23.php): failed to open stream: Permission denied in /home/runcloud/webapps/apiv2/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:135

This is what happens when I am trying this on our staging server but in my local, it's working fine.

The same thing is happening when I am trying to Log::info() from the same job class file.

Also, for sometimes, it's also giving the following issue on the faild_jobs table ...

Illuminate\Queue\MaxAttemptsExceededException: App\Jobs\CurlSendEmail has been attempted too many times or run too long. The job may have previously timed out. in /home/runcloud/webapps/apiv2/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:648

What should I need to do to make it work?

  • Does this answer your question? [How to set up file permissions for Laravel?](https://stackoverflow.com/questions/30639174/how-to-set-up-file-permissions-for-laravel) – Clément Baconnier Jan 21 '22 at 15:17
  • https://stackoverflow.com/questions/36460874/laravel-5-errorexception-failed-to-open-stream-permission-denied here is an answer to the issue as well :) it is always helpful to simply copy paste the error message for a quick look – Frevelman Jan 21 '22 at 15:30
  • Thank you for your valuable responses, guys. But it was something else. The supervisor that is responsible to run the job, has an entry `user=forge`, in the config, which I did not notice. I have just changed the user to the correct one `user=runcloud` and the issue is now solved. – Sourav Chakraborty Jan 24 '22 at 13:03

0 Answers0