- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Advanced Reporting goes to 404
I'm getting an error in my Magento 2.4.2-p1 when I run n98-magerun2 sys:cron:run analytics_collect_data and overnight in the cron table.
Run Magento\Analytics\Cron\CollectData::execute
Cron-job "analytics_collect_data" threw exception Magento\Framework\Exception\FileSystemException
In File.php line 226:
Directory "/tmp/analytics/tmp" cannot be created Warning!mkdir(): Permission denied
In my development environment I've set the var folder to permissions 777 and manually created the tmp/analytics/tmp folder all with permissions set to 777 but I still get the error.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Advanced Reporting goes to 404
Hello @nasim_magento
- Make sure that the user running the cron job has permission to create the directory. You can do this by changing the owner of the directory to the user running the cron job.
- Change the permissions on the directory so that the user running the cron job has permission to create files in it. You can do this by using the chmod command.
- Use a different directory for the cron job to store its files. You can specify a different directory in the cron job definition.
Here are the steps on how to change the owner of the directory:
- Open a terminal window.
- Navigate to the directory where the cron job is located.
- Run the following command:
chown -R <username> /tmp/analytics/tmp
Replace <username> with the name of the user running the cron job.
Here are the steps on how to change the permissions on the directory:
- Open a terminal window.
- Navigate to the directory where the cron job is located.
- Run the following command:
chmod -R 777 /tmp/analytics/tmp
- Open the cron job definition file.
- Find the line that starts with analytics_collect_data.
- Add the following option to the line:
--directory=/path/to/new/directory
Replace /path/to/new/directory with the path to the new directory you want to use.
Once you have made the necessary changes, restart the cron job. The cron job should now be able to create the directory and store its files without any errors.
200+ Premium Magento 2 Extensions Need help? Hire Magento Developer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Advanced Reporting goes to 404
How to navigate to the directory where the cron job is located?