Koozali.org: home of the SME Server

SME 9.2 freshclam update failed

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SME 9.2 freshclam update failed
« Reply #30 on: August 28, 2017, 05:03:52 AM »
maybe we could implement a faster and functional mirror script that run every weeks to choose first mirror in the freshclam conf file...

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: SME 9.2 freshclam update failed
« Reply #31 on: August 28, 2017, 10:42:10 AM »
The problem for us down here is that freschlam.conf has this
DatabaseMirror db.local.clamav.net
DatabaseMirror database.clamav.net

For us down here that resolves to one IP and that is not even in our hemisphere, any issues with the route to there, whooshaka, we are effed..hence why I temporarily set my *.conf to:

DatabaseMirror db.DE.clamav.net
DatabaseMirror database.clamav.net

At least allowed updates Now back to default, all is working as it should
--
qui scribit bis legit

Offline p-jones

  • *
  • 594
  • +0/-0
Re: SME 9.2 freshclam update failed
« Reply #32 on: August 28, 2017, 11:08:43 AM »
Quote
hence why I temporarily set my *.conf to:

DatabaseMirror db.DE.clamav.net
DatabaseMirror database.clamav.net

Problem I encountered doing this is that freshclam.conf gets regenerated even without a reboot/reconfigure, nuking the workaround. Probably why someone reported the workaround only worked for a while.

I guess this will need to go into a new template fragment to be useful so it survives...a task for more time...

In response to a previous comment by TerryF, yes, this is also affecting NZ and is a pain in the proverbials.....
...

guest22

Re: SME 9.2 freshclam update failed
« Reply #33 on: August 28, 2017, 11:10:42 AM »
I guess we need to fix this soonish. Is there no one in the Clam community thinking about a work around?

Offline p-jones

  • *
  • 594
  • +0/-0
Re: SME 9.2 freshclam update failed
« Reply #34 on: August 28, 2017, 11:17:44 AM »
TerryF has posted the link to the Clam community which contains their workaround, albeit not a strong workaround however as I found, the templating system seems to add an additional layer of complexity to the workaround.

IMHO, the whole situation is less than satisfactory at present but that is one of the joys of the open-source community we must live with.....
...

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: SME 9.2 freshclam update failed
« Reply #35 on: August 28, 2017, 11:28:50 AM »
Code: [Select]
config setprop clamav DatabaseMirror your_preferred_mirror
expand-template /etc/freshclam.conf

am I missing anything obvious or this is the right way to change the DatabaseMirror property?

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: SME 9.2 freshclam update failed
« Reply #36 on: August 28, 2017, 12:00:12 PM »
p-jones & Terry

with deference to Stefano I wrote this while you were replying

I took the cue from Terrys earlier message & external link.
Yes it seems freshclam.conf does get regenerated
I made a custom template & all works fine now using db.de.clamav.net

mkdir -p /etc/e-smith/templates-custom/etc/freshclam.conf
cp /etc/e-smith/templates/etc/freshclam.conf/DatabaseMirror /etc/e-smith/templates-custom/etc/freshclam.conf/
nano -w /etc/e-smith/templates-custom/etc/freshclam.conf/DatabaseMirror

edit to read

{
# Uncomment the following line and replace XY with your country
# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
# Default: There is no default, which results in an error when running freshclam

    $OUT = "DatabaseMirror db.de.clamav.net\n";

# database.clamav.net is a round-robin record which points to our most
# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
# not working. DO NOT TOUCH the following line unless you know what you
# are doing.
    $OUT .= "DatabaseMirror db.de.clamav.net";
}

Save
Ctrl + o

signal-event email-update
refreshclam

Should work OK after that.
When external issues are resolved later, remove the custom template & run
signal-event email-update


I even wonder (not tried coz I'm busy enough) if it's just as simple/easier to change the db property for clamav
config show clamav
config setprop clamav DatabaseMirror db.de.clamav.net
signal-event email-update
« Last Edit: August 30, 2017, 11:58:46 AM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: SME 9.2 freshclam update failed
« Reply #37 on: August 28, 2017, 12:12:52 PM »
Sweet janet..

Code: [Select]
config setprop clamav DatabaseMirror your_preferred_mirror
expand-template /etc/freshclam.conf

am I missing anything obvious or this is the right way to change the DatabaseMirror property?

No, but for a quick  and easy fix to run freshclam once to ensure an update, for me it was easier and quicker to just add the databasemirror to something that is up and working and the clam ML gave the answer.

DatabaseMirror 180.92.182.5
DatabaseMirror db.local.clamav.net
DatabaseMirror database.clamav.net

I didn't even delete the default setting of "local" just added a  DatabaseMirror=working_ipaddress before it, see clamav ML.

I hunted the problem down, the why etc, I found a quick and easy solutiuon that allowed me to update clam on 4 systems, and to stop the effing failure emails filling up my inbox..

It worked for me, and that all that matters :-)

and yes janet it did cross my mind to do a custom template, being me, the quick dirty way was easierr :-)
--
qui scribit bis legit

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: SME 9.2 freshclam update failed
« Reply #38 on: August 28, 2017, 12:14:19 PM »
I would not change the second mirror host..

BTW, if you really want to change it, just edit your fragment to use some info you can store in the db..

something like

Code: [Select]
{
# Uncomment the following line and replace XY with your country
# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
# Default: There is no default, which results in an error when running freshclam

    $OUT = "DatabaseMirror $clamav{DatabaseMirror}\n";

# database.clamav.net is a round-robin record which points to our most
# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
# not working. DO NOT TOUCH the following line unless you know what you
# are doing.
   $OUT = "DatabaseMirror $clamav{DatabaseMirror2}\n";
}

in this way you can keep your custom fragment and edit both the lines; just store the info with
Code: [Select]
config setprop clamav DatabaseMirror2 your_other_mirror

finally, since the second line is a fall back, setting the same value for both lines makes no sense to me..

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: SME 9.2 freshclam update failed
« Reply #39 on: August 28, 2017, 12:23:45 PM »
for all the guys in the other part of the world, take a look here:
https://www.clamav.net/documents/mirrors

is there anyone interested directly (or not) to create a new clamav mirror?

another (partial) solution is to setup a private mirror (see https://www.clamav.net/documents/private-local-mirrors) and use it for all your servers.. in this way you have only one machine to keep updated, all others will update from your server

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: SME 9.2 freshclam update failed
« Reply #40 on: August 28, 2017, 12:31:05 PM »
Thanks Stefano..

Even tried downloading the cvd files from the clam site, no joy, why? because the url resolves to the ip in Ireland that we are being directed to by the conf file etc for updates  hate them :-)
« Last Edit: August 28, 2017, 12:33:08 PM by TerryF »
--
qui scribit bis legit

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: SME 9.2 freshclam update failed
« Reply #41 on: August 28, 2017, 12:59:53 PM »
try using db.us.clamav.net ad your databasemirror

Code: [Select]
stefano@stefano-HP ~ $ host db.us.clamav.net
db.us.clamav.net is an alias for db.us.big.clamav.net.
db.us.big.clamav.net has address 155.98.64.87
db.us.big.clamav.net has address 168.143.19.95
db.us.big.clamav.net has address 194.8.197.22
db.us.big.clamav.net has address 194.186.47.19
db.us.big.clamav.net has address 198.148.78.4
db.us.big.clamav.net has address 200.236.31.1
db.us.big.clamav.net has address 204.130.133.50
db.us.big.clamav.net has address 207.57.106.31
db.us.big.clamav.net has address 208.72.56.53
db.us.big.clamav.net has address 64.6.100.177
db.us.big.clamav.net has address 64.22.33.90
db.us.big.clamav.net has address 69.12.162.28
db.us.big.clamav.net has address 69.163.100.14
db.us.big.clamav.net has address 104.131.196.175
db.us.big.clamav.net has address 128.199.133.36
db.us.big.clamav.net has address 150.214.142.197

BTW, we'd modify the DatabaseMirror fragment to use a list of hosts

Code: [Select]
{


# Uncomment the following line and replace XY with your country
# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
# Default: There is no default, which results in an error when running freshclam

    foreach my $host (split(',', ${clamav}{DatabaseMirror}))
            {
                $OUT .= "DatabaseMirror $host\n";
            }

# database.clamav.net is a round-robin record which points to our most
# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
# not working. DO NOT TOUCH the following line unless you know what you
# are doing.
    $OUT .= "DatabaseMirror database.clamav.net";
}


storing all the mirrors we want with
Code: [Select]
config setprop clamav DatabaseMirror host1,host2,...,hostn

the order of the hostnames will define their priority

NB: not tested, just an idea
Edit: corrected my code, now it's working as expected
« Last Edit: August 28, 2017, 05:08:46 PM by Stefano »

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: SME 9.2 freshclam update failed
« Reply #42 on: August 28, 2017, 01:11:22 PM »
just keeping thinking loud, maybe mine is not a solution, 'cause in freshclam.conf's man page there's no mention about how many lines will be used..

it says
Quote
DatabaseMirror STRING
 DatabaseMirror specifies to which mirror(s) freshclam should connect. You should  have  at  least  two  entries:  db.XY.clamav.net  (or db.XY.ipv6.clamav.net   for   IPv6)  and  database.clamav.net  (in  this  order).  Please  replace  XY  with  your  country  code  (see http://www.iana.org/cctld/cctld-whois.htm). database.clamav.net is a round-robin record which points to our most reliable mirrors. It’s used as a fall back in case db.XY.clamav.net is not working.
Default: database.clamav.net

so, we must have at least 2 lines.. but for other directives man page says explicitly:
Quote
This option can be used multiple times. (cfr DatabaseCustomURL)

anyone here have any idea?

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: SME 9.2 freshclam update failed
« Reply #43 on: August 28, 2017, 04:52:06 PM »
--
qui scribit bis legit

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: SME 9.2 freshclam update failed
« Reply #44 on: August 28, 2017, 09:08:24 PM »
Light at the end of the tunnel :-)

http://lists.clamav.net/pipermail/clamav-users/2017-August/005038.html

the fix is quite simple, it is
1- to check mirror health and only present on round robin dns healthy mirrors...
2- add at least a second alternative to ftp.heanet.ie ( not depending from it)

From what I understand their default mirror is the famous db.ie.clamav.net has address 193.1.193.64.
Either you have a country with public mirrors, and you will get a list, with some syncing from the ie mirror and other from another
 
Code: [Select]
$ host database.clamav.net
database.clamav.net is an alias for db.local.clamav.net.
db.local.clamav.net is an alias for db.ca.clamav.net.
db.ca.clamav.net has address 67.215.9.147
db.ca.clamav.net has address 200.236.31.1
db.ca.clamav.net has address 172.255.51.117
db.ca.clamav.net has address 207.210.46.249

Code: [Select]
$ host db.us.clamav.net
db.us.clamav.net is an alias for db.us.big.clamav.net.
db.us.big.clamav.net has address 207.57.106.31
db.us.big.clamav.net has address 128.199.133.36
db.us.big.clamav.net has address 200.236.31.1
db.us.big.clamav.net has address 150.214.142.197
db.us.big.clamav.net has address 69.12.162.28
db.us.big.clamav.net has address 69.163.100.14
db.us.big.clamav.net has address 104.131.196.175
db.us.big.clamav.net has address 64.22.33.90
db.us.big.clamav.net has address 208.72.56.53
db.us.big.clamav.net has address 155.98.64.87
db.us.big.clamav.net has address 168.143.19.95
db.us.big.clamav.net has address 204.130.133.50
db.us.big.clamav.net has address 64.6.100.177
db.us.big.clamav.net has address 194.8.197.22
db.us.big.clamav.net has address 194.186.47.19
db.us.big.clamav.net has address 198.148.78.4

Code: [Select]
$ host db.de.clamav.net
db.de.clamav.net has address 195.30.97.3
db.de.clamav.net has address 62.245.181.53
db.de.clamav.net has address 144.76.28.11
db.de.clamav.net has address 213.174.32.130
db.de.clamav.net has address 88.198.17.100
db.de.clamav.net has address 178.63.73.246
db.de.clamav.net has address 62.27.56.14
db.de.clamav.net has address 130.133.110.67
db.de.clamav.net has address 212.227.138.145
db.de.clamav.net has address 62.201.161.84
db.de.clamav.net has address 5.9.253.237
db.de.clamav.net has address 193.27.49.165
db.de.clamav.net has address 84.39.110.99

either you are an unlucky French where all the available mirror sync from the faulty mirror
Code: [Select]
$ host db.fr.clamav.net
db.fr.clamav.net has address 46.29.125.16
db.fr.clamav.net has address 212.180.1.29
db.fr.clamav.net has address 193.51.160.14
db.fr.clamav.net has address 91.193.56.105
db.fr.clamav.net has address 51.15.177.217
db.fr.clamav.net has address 193.52.101.131
db.fr.clamav.net has address 178.32.100.7
db.fr.clamav.net has address 178.33.105.132

or simply there is no local mirror and you are default to the ie ftp.heanet.ie:


Code: [Select]
$ host db.au.clamav.net
db.au.clamav.net has address 193.1.193.64

$ host db.nz.clamav.net
db.nz.clamav.net is an alias for db.au.clamav.net.
db.au.clamav.net has address 193.1.193.64


from our perspective, Stefano suggestion is an easy approach to have a few more alternatives, I would complete it this way :
Code: [Select]
{


# Uncomment the following line and replace XY with your country
# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
# Default: There is no default, which results in an error when running freshclam
    my $localmirrors = ${clamav}{DatabaseMirror} || "db.local.clamav.net";
    foreach my $host (split(',' , $localmirrors ))
            {
                $OUT .= "DatabaseMirror $host\n";
            }

# database.clamav.net is a round-robin record which points to our most
# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
# not working. DO NOT TOUCH the following line unless you know what you
# are doing.
    $OUT .= "DatabaseMirror database.clamav.net";
}

Furthermore we could change the default value
Code: [Select]
db.local.clamav.netto
Code: [Select]
db.local.clamav.net, db.de.clamav.net. db.us.clamav.net,db.jp.clamav.net

this way, we would have 3 regional alternatives from 3 different regions in the world before defaulting on the global one that is mostly already the first one if you have the head downside...