If you're experiencing issues with starting a virus scan in cPFence, and receive an error message similar to the following, this may be due to insufficient memory or swap space:
root@testsrv:~# cpfence --full-scan
Starting a full scan on all files...please wait.
Error starting scanning job...please try again.
Diagnosing the Issue
One common cause of this error is low memory or swap space on the server. Servers with a low swap space, such as 512 MB, may encounter issues when trying to run resource-intensive operations like virus scanning. To check your server’s memory and swap usage, use the following command:
root@testsrv:~# free -h
total used free shared buff/cache available
Mem: 7.8Gi 2.0Gi 1.4Gi 2.0Gi 4.3Gi 3.5Gi
Swap: 511Mi 511Mi 0.0Ki
In this example, the swap space is fully used, which can prevent cPFence from initiating the virus scan.
Solution: Increase Swap Size
Increasing the swap size to at least 2 GB can resolve this issue. After increasing the swap space, you can verify the updated configuration by running:
root@testsrv:~# free -h
total used free shared buff/cache available
Mem: 7.8Gi 1.7Gi 1.5Gi 2.3Gi 4.6Gi 3.5Gi
Swap: 2.0Gi 24Mi 2.0Gi
With increased swap space, cPFence should now be able to initiate and complete virus scans without errors.
Need Further Assistance?
If you encounter any issues or need additional help, feel free to reach out to our support team via your client portal.