reactorh

Well-Known Member
Aug 2, 2005
56
0
156
Hi,

Do anyone know why i got this error: :confused:

[[email protected] /]# /usr/bin/freshclam --quiet --log-verbose --daemon-notify
ERROR: chdir_inc: Can't create directory main.inc
ERROR: getfile: Can't create new file ./clamav-dc23f6b7610f36a11d4627c5cb32e6e7 in /usr/share/clamav
ERROR: Can't download main.cvd from database.clamav.net
LibClamAV Error: Database Directory: /usr/share/clamav not locked
[[email protected] /]#

And how can i fix it?

Im running:
[[email protected] /]# clamscan -V
ClamAV 0.90.2/3706/Fri Jul 20 09:24:39 2007


Thx :D
 

reactorh

Well-Known Member
Aug 2, 2005
56
0
156
Someone knows how to fix this issue?

Thx :D
 

roba

Member
Jan 20, 2004
12
0
151
Prague, CZ
cPanel Access Level
Root Administrator
I have similiar problem on WHM 11 server:



# ./freshclam
ClamAV update process started at Mon Aug 6 23:49:32 2007
LibClamAV Error: Wrote 0 instead of 512 (main.inc/main.ndb).
ERROR: chdir_inc: Can't unpack main.cvd into main.inc
WARNING: Incremental update failed, trying to download main.cvd
getfile: Can't write 1448 bytes to ./clamav-4e4e26eaa9f621807edca4a6a14d7ab0
ERROR: Can't download main.cvd from database.clamav.net
 

ddeans

Well-Known Member
Feb 13, 2004
296
0
166
Maryland
Did you install clamav your self or through WHM?

Did you recently upgrade to WHM 11, and if so, did you have any trouble with clamav before this?
 

roba

Member
Jan 20, 2004
12
0
151
Prague, CZ
cPanel Access Level
Root Administrator
Did you install clamav your self or through WHM?

Did you recently upgrade to WHM 11, and if so, did you have any trouble with clamav before this?
I got new VPS with version 10 and autoupdate set to STABLE tree. I changed it to RELEASE tree so my WHM/cPanel was updated automatically to version 11. There were no errors.

ClamAV was not installed on version 10. I installed it after upgrade to version 11, via Plugins option in WHM. There is a checkbox "Install and keep updated" under clamavconnector plugin, that is how I installed it.

ClamAV is running, I can see catched emails in the log. Also manual scan initiated from cPanel works. It even updated the program from version 90.something to 91, like day or two after I installed it. But virus database updates are failing every day with the error I posted above.
 

roba

Member
Jan 20, 2004
12
0
151
Prague, CZ
cPanel Access Level
Root Administrator
@OP

Look at your database directory and check if there is .dbLock file, delete it and try to run update again.


@My problem

I tried to run freshclam update to another directory (/tmp), where no current Clamav files were present - update worked without any errors, even incremental update worked (I copied outdated database files to /tmp and ran freshclam on them).

When I delete current database files from ClamAV dir, update works - it downloads new database and notify clamd. But once they are there, update program is unable to work with them. However it does not have problem with creating temp directory, just with saving files into it. I really don't understand it. Permissions are ok, I tried to run it as root or as clamav user... Always same error message (see my first post).
 

RACKSET

Active Member
Apr 28, 2006
44
0
156
localhost
Sorry for bump this up, but I found one reason of this error, added here to help someone else.

If you get some error like:

[[email protected] /]# freshclam
ClamAV update process started at Sun Sep 28 06:46:56 2008
getfile: Can't write 1448 bytes to /usr/share/clamav/clamav-bf2bd27fe72cb94b17e5724741764fb8
WARNING: Can't download main.cvd from database.clamav.net
Maybe user clamav is out of quota. Just dl main.cvd from direct link (to see link run freshclam -vv)

# cd /usr/share/clamav/
# wget http://database.clamav.net/main.cvd
# chown clamav:clamav main.cvd
If you got error (chown: changing ownership of `main.cvd': Disk quota exceeded), user clamav is out of quota. To see clamav quota:

# quota -u clamav

To edit clamav quota:

# edquota clamav

Disk quotas for user clamav (uid 32xxx):
Filesystem blocks soft hard inodes soft hard
/dev/simfs 18032 307200 307200 8 0 0

Change soft,hard values, it should be in KB (not sure), save.

# chown clamav:clamav main.cvd

Done? update clamav:

# freshclam