Other services used by core
This lists other services used and potential errors (with fixes).
Elasticsearch
No alive nodes in your cluster
Getting error no alive nodes in your cluster? Run lando fix-elastic-perms then lando restart (you can also just kill the elastic container and do a lando start which is slightly faster). Confirm working by running lando artisan district:rebuild-index after restart.
Ensure your worker is running as that actually does the background task of building indexes.
If the above command did not work or your container refuses to start, you may need to remove associated volumes.
This is common after an image upgrade:
docker volume rm districtcore_data_elasticsearch
docker volume rm districtcore_home_elasticsearch
Linux / WSL and max_map_count
You may also need to set the vm.max_map_count to a higher number before starting ElasticSearch - this can be done per session by sudo sysctl -w vm.max_map_count=262144
ClamAV Anti-Virus
ClamAV Anti-Virus / Can't upload files
Getting 422 error on uploading files or are having issues with not being able to upload files due to virus scan failed in local dev? It is probably due to incorrect permissions on clamav storage folder.
You can confirm this with lando logs -s clamav
This should get you going:
sudo rm -rf storage/clamav \
mkdir -p storage/clamav \
chmod -R 777 storage/clamav \
lando restart
Also ensure storage/app has write permissions chmod -R 777 storage/app. Lastly ensure there is a symlink in public to ../storage/app/public
Container fix
If you are seeing permission issues when dealing with sub-folders, then you may need to run a fix interally on the container. The steps are to:
- SSH into the container
- Change the permissions of the mounted folder from
www-datatoclamav - Run
freshclamto provide the necessary files - Restart docker instances - whilst this changes the folder back to
www-data, the files have read perms hence work
The steps are all automated in scripts/fixes/fix-broken-clamav.sh
Note - this is not a long-term fix
The fix described here to change the permissions of the folder is not a viable long-term fix. Potentially a better fix would be:
- Move the lando definition of clamav to
docker-compose.yml - Provide a dedicated volume instead of a shared folder (this offers better performance too)
It is also worth noting that the current clamav docker image is deprecated and needs replacing.
Getting error An email must have a "From" or a "Sender" header when doing an action that sends email? You need to ensure MAIL_FROM_ADDRESS is set to a valid email address and not null in your .env, after changing, lando restart and should be good.