Clamscan Error: The scan is not started

NethServer Version: NethServer release 7.9.2009 (final) (last updated February 15)
Module: Clamscan 1.0.2
Running in a VM, 4 CPU, 8Gb RAM

Hi,

I installed Clamscan as per the instructions in the wiki.
When trying to run a scan “now” I get a popup telling me “The scan is not started”. Running the command in terminal as requested renders the following output:

[root@myhost ~]#  echo '{"action":"scanFileSystemNow","status":"enabled","Quarantine":"disabled","FilesystemScanFilesystems":"/","FilesystemScan":"now","MaxScanFile":"45","FilesystemScanExclude":"/boot\n/proc\n/sys\n/usr/share/doc"}' | /usr/bin/setsid /usr/bin/sudo /usr/libexec/nethserver/api/nethserver-clamscan/update | jq
{
  "steps": 2,
  "pid": 24325,
  "args": "",
  "event": "nethserver-clamscan-now"
}
{
  "step": 1,
  "pid": 24325,
  "action": "S05generic_template_expand",
  "event": "nethserver-clamscan-now",
  "state": "running"
}
{
  "progress": "0.50",
  "time": "0.056387",
  "exit": 0,
  "event": "nethserver-clamscan-now",
  "state": "done",
  "step": 1,
  "pid": 24325,
  "action": "S05generic_template_expand"
}
{
  "step": 2,
  "pid": 24325,
  "action": "S10nethserver-clamscan-now",
  "event": "nethserver-clamscan-now",
  "state": "running"
}
{
  "progress": "1.00",
  "time": "0.00495",
  "exit": 1280,
  "event": "nethserver-clamscan-now",
  "state": "done",
  "step": 2,
  "pid": 24325,
  "action": "S10nethserver-clamscan-now"
}
{
  "pid": 24325,
  "status": "failed",
  "event": "nethserver-clamscan-now"
}
{
  "type": "EventError",
  "id": 1613580007,
  "message": "`clamscan_now_action_failed`"
}
[root@myhost ~]#

Scheduling the scan produces a couple of log entries about logfiles (var/log/clamav/clamscan-errors.log and var/log/clamav/clamscan.log) not existing and “Failed to start clamscan-nethgui.service: Unit not found. update”

Clamav is running fine when started from the command line and when invoked through NextCloud.

Any suggestions as to what could be wrong?

Groeten,
René

Same here, root cause is the optional installation of nethserver-httpd-admin which provides the httpd-admin.service which is still a Requisite to run Scan now.
Update the database has the same issue.

@stephdl why not run /sbin/e-smith/nethserver-clamscan and /usr/share/clamav/freshclam-sleep xnow;/usr/bin/clamav-unofficial-sigs.sh directly in nethserver-clamscan-now and nethserver-clamscan-freshclam-update ?

3 Likes

So… installing the ‘Old Server Manager’ application would solve the problem with running Scan now?

Yes, but I think this is going to be fixed.
So you may want to wait a while…

Would it also explain the fact that a scheduled scan doesn’t seem to do anything?

Do not think so, the cron invokes /sbin/e-smith/nethserver-clamscan directly:

cat /etc/cron.d/clamscan
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at NethServer official site: https://www.nethserver.org
#
#

# nethserver-clamscan filesystem scan
34      17      *       *       *       root    /sbin/e-smith/nethserver-clamscan

My error :smirk:
I interpreted the ‘Hour’ setting for the daily scan as being the exact hour…
Looking at the cron file made me realise that I was wrong…

When I wait long enough (I helped it a bit by not complying to the first line in the file) for the time that it is started, it does run.

However, the result is (from clamscan.log):

	Thu Feb 18 16:50:01 2021
Scanned Folder: /ERROR: Can't open file or directory

Is there a way to run it more verbose so it will tell what folder cannot be opened?

I found the --verbose option… Which doesn’t work for a perl script :blush:

Will be not complying to the first line in the cron file again :grin:

The cron just started here and is scanning now…

Did “hacked” this test setup to get the buttons working so maybe it is because I was able to (manual)update the database and run an initial (manual)scan

Did you see my update: Clamscan Error: The scan is not started
It is starting via cron, but gives an immediate error.

could you try to update the database from the command line ?:

/usr/share/clamav/freshclam-sleep xnow;/usr/bin/clamav-unofficial-sigs.sh

------------------------------------
	Thu Feb 18 17:03:01 2021
Scanned Folder: //var/lib/clamav-unofficial-sigs/dbs-lmd/sigpack.tgz: Php.Exploit.C99-27 FOUND

----------- SCAN SUMMARY -----------
Known viruses: 4016139
Engine version: 0.103.0
Scanned directories: 15958
Scanned files: 88413
Infected files: 1
Data scanned: 6628.50 MB
Data read: 3702.37 MB (ratio 1.79:1)
Time: 1305.196 sec (21 m 45 s)
Start Date: 2021:02:18 17:03:01
End Date:   2021:02:18 17:24:46

Almost sure it is the missing database

I ran the command. clamav-unofficial-sigs.sh is in /usr/sbin, so ran it from there.

The funny thing is, I can’t really see any real difference in the logs of this run of the db update and previous ones (apart from ‘x hours have not yet elapsed’). But… now the scan did run completely (made my laptop sound like it was ready for lift off). Result:

------------------------------------
	Thu Feb 18 17:26:01 2021
Scanned Folder: //var/lib/nethserver/nextcloud/9268A0AC-3256-4608-8EB9-A38276518976/files/eicar_com.zip: Win.Test.EICAR_HDB-1 FOUND
/var/lib/clamav-unofficial-sigs/dbs-lmd/sigpack.tgz: Php.Exploit.C99-27 FOUND

----------- SCAN SUMMARY -----------
Known viruses: 8571332
Engine version: 0.103.0
Scanned directories: 17386
Scanned files: 101404
Infected files: 2
Data scanned: 6344.86 MB
Data read: 4235.92 MB (ratio 1.50:1)
Time: 1034.680 sec (17 m 14 s)
Start Date: 2021:02:18 17:26:01
End Date:   2021:02:18 17:43:16

So, updating the database from the command line seems to have done something… :partying_face:

Thank you very much, Mark!!

@mark_nl need to check thank for diving it

Will open a PR just to show I think is the issue…

Do with it what you want: I won’t be disappointed. :grinning:

1 Like

please @mark_nl @Reheer what is the output of

  [root@ns7loc2 ~]# rpm -qa | grep nethserver-http
nethserver-httpd-3.12.0-1.ns7.noarch
nethserver-httpd-admin-service-2.7.0-1.ns7.noarch

[root@ns7loc2 ~]# systemctl status httpd-admin.service

[root@ns7loc2 ~]# cat /etc/nethserver-release 
NethServer release 7.9.2009 (final)

On my vm I got it working ???

[root@myhost files]# rpm -qa | grep nethserver-http
nethserver-httpd-3.12.0-1.ns7.noarch
[root@myhost files]# systemctl status httpd-admin.service
Unit httpd-admin.service could not be found.
[root@myhost files]# cat /etc/nethserver-release
NethServer release 7.9.2009 (final)
[root@myhost files]# 

I have not installed the ‘Old Server Manager’ application, as this is not a default.

you miss it, why ?

ok got it, a fix is coming

2 Likes

released as nethserver-clamscan-1.0.3-1.ns7.sdl.noarch.rpm

1 Like