How to troubleshoot MetaDefender Core Service startup issues in Linux?
Issue: The MetaDefender Core service (ometascan
) fails to start. This issue can be caused by various reasons, such as incorrect configuration settings, permission issues, or missing dependencies.
Symptoms:
- MetaDefender Core service fails to start or crashes immediately after starting.
- Error messages related to PostgreSQL or configuration files appear in system logs.
- Logs indicate permission errors or misconfigured parameters.
- The service remains in a stopped state after an attempted restart.
Common Causes and Solutions:
1. Incorrect Permissions on PostgreSQL Configuration Files
Cause: If the postgresql.conf
or related files are modified using the root account, the MetaDefender Core service may not have the required permissions to read them.
Solution:
- Check the ownership and permissions of the PostgreSQL configuration files:
ls -l /var/lib/ometascan/pg_data/postgresql.conf
- Ensure that the owner is the ometascan user:
chown metascan:metascan /var/lib/ometascan/pg_data/postgresql.conf
sudo chmod 644 /var/lib/ometascan/pg_data/postgresql.conf
- Restart the MetaDefender Core service:
systemctl restart ometascan.service
2. Customizing PostgreSQL Configuration
Cause: If users need to customize the PostgreSQL configuration without modifying the default postgresql.conf
file.
Solution:
- Instead of modifying
/var/lib/ometascan/pg_data/postgresql.conf
, create a new configuration file:
sudo touch /usr/lib/ometascan/postgres/postgresql.conf
- Add the required configuration settings to this file.
- Ensure the correct ownership and permissions:
chown metascan:metascan /usr/lib/ometascan/postgres/postgresql.conf
chmod 644 /usr/lib/ometascan/postgres/postgresql.conf
- Restart the MetaDefender Core service:
systemctl restart ometascan.service
3. Invalid Parameter in MetaDefender Core Configuration File
Cause: If the customer adds an incorrect or unsupported parameter in the MetaDefender Core configuration file, the service may fail to start.
Solution:
- Check the MetaDefender Core logs for error messages related to invalid configuration parameters:
cat /var/log/ometascan/ometascan.log | grep error
- Review the MetaDefender Core configuration file (
/etc/ometascan/ometascan.conf
) and ensure all parameters are correctly set. - If unsure, revert the configuration file to its default state and restart the service:
mv /etc/ometascan/ometascan.conf /etc/ometascan/ometascan.conf.bak
cp /etc/ometascan/ometascan.conf.default /etc/ometascan/ometascan.conf
systemctl restart ometascan.service
4. PostgreSQL Database Not Running or Corrupted
Cause: The MetaDefender Core service may fail to start if the required PostgreSQL database is not running or is corrupted.
Solution:
- Check the status of the PostgreSQL service:
systemctl status ometascan-pg.service
- If PostgreSQL is not running, start it:
systemctl start ometascan-pg.service
- If the database is corrupted, consider restoring from a backup (-d option should be point to your db.
- If using standalone: it will be metadefender_core_xxx with xxx is the first six letters of the deployment id after MSCW in lowercase.
- If using shared: it will be metadefender_core:
pg_restore -U postgres -d ometascan /backup/ometascan.dump
5. MetaDefender Core Service Fails Due to Port Conflicts
Cause: If another application is using the same port as the MetaDefender Core service, the service will fail to bind to its configured port.
Solution:
- Check for port conflicts:
netstat -tulnp | grep <OMT_PORT>
- If another process is using the port, either stop the conflicting service or change the MetaDefender Core port in
/etc/ometascan/ometascan.conf
. - Restart the MetaDefender Core service:
systemctl restart ometascan.service
Additional Troubleshooting Steps:
- Check system logs for additional clues:
journalctl -xe | grep ometascan.service
- Ensure all dependencies are installed and up to date.
- Verify disk space availability using
df -h
.
If the issue persists, contact technical support with relevant log files and error messages.
If Further Assistance is required, please proceed to log a support case or chatting with our support engineer.