Please make sure that “/” is writable by the web-server. [Magento 2.4 Sitemap]

Elasticsearch files
Firstly, let’s address the elasticsearch files. Those are only temporary files that you would have downloaded in order to install Elasticsearch. This is why I recommended downloading the files to your “My Documents” directory (e.g. /home/god/). As they’re only used to installing elasticsearch, you don’t need them anymore. So, just delete them.

Sitemap
As you’ve clearly identified, magento2 user has appropriate permissions to write to the /var/www/html/ Directory :+1: However, you should ask yourself:

"But who is trying to write to the /var/www/html/ Directory?" :thinking:

If memory serves, crontab is responsible for actually creating the sitemap files. Therefore, in your case you should check that you have setup crontab under the correct user. Because if you accidently setup crontab up as god user (for example), then it’s god user trying to write the file, not magento2 user.

Check out this excerpt I wrote in 2019.

Regards,

1 Like