[Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manually.

Q'center app, Helpdesk app
Post Reply
MatthewFIU
Starting out
Posts: 19
Joined: Wed Oct 19, 2011 7:19 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by MatthewFIU »

Is the following essentially the method you're using? If so, I'll give it a shot on mine with a few different external drives:
viewtopic.php?t=149957#p723468
User avatar
DDGNY
Getting the hang of things
Posts: 68
Joined: Sat Jan 02, 2016 2:22 am
Location: Cleveland, OH

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by DDGNY »

daNutz wrote: Sat Aug 07, 2021 11:03 pm Hi,

Ive had this in the past and manually downloading the latest .cvd from https://database.clamav.net/daily.cvd, importing and then running

Code: Select all

freshclam -u admin -v
in the console and brought everything up to date.
Hi,
For some time now I've been getting errors about virus def's not being able to update on a TS-251+. Hoped it would get fixed in 5.0, but apparently it's not. I can download the daily.cvd, but when I try to do the import a popup appears that says "Incorrect File Format". And when I run freshclam in a console I get:

Code: Select all

freshclam: error while loading shared libraries: libclamav.so.9: cannot open shared object file: No such file or directory
Appreciate any suggestions.
TS-251+: 8GB, 2x6TB WD Red RAID1, Pawtec USB DVD-RW
TR-004: 4x4TB WD Red RAID5
UPS: APC Back-UPS ES 750
witty
Starting out
Posts: 11
Joined: Mon Jan 26, 2015 12:11 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by witty »

MoRiSoVa wrote: Wed Oct 06, 2021 4:46 pm The script is now available on github.
If you find any bugs, please let me know.

https://github.com/MoRiSoVaXZ/CVD_Update
should this in genreral work on a TS-412?
I could not even find opkg - what does this mean?

thanks
MatthewFIU
Starting out
Posts: 19
Joined: Wed Oct 19, 2011 7:19 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by MatthewFIU »

witty wrote: Tue Nov 23, 2021 1:12 am I could not even find opkg - what does this mean?
You need to install Entware, then you can run the opkg command: https://github.com/Entware/Entware/wiki ... n-QNAP-NAS
MatthewFIU
Starting out
Posts: 19
Joined: Wed Oct 19, 2011 7:19 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by MatthewFIU »

I've sought to duplicate @MoRiSoVa's work on a TS-220 using the stock virus scanner and a custom page file created on a slow SSD connected with a USB 3.0 enclosure.

I pointed the scan at a large folder of FLAC files, and it *is* working, rather than stopping prematurely, but it's been going for about 24 hours now, and is only 47% complete!

I checked the page file usage, and it's at about 1GB right now.

I also did some file transfer tests, and noticed with dd (from coreutils-dd) that file transfer speeds with block sizes larger than about 300MB drop off precipitously. I guess this would be expected, as it fills up the QNAP's low amount of RAM during the file transfer, and then starts filing the page file.

I'll have to do some further page file tests with the same SSD connected using an eSATA enclosure, but I would expect similar results. I'll also see if I can connect a faster SSD. The internal drives are RAID 1 HDDs and encrypted, which could also be contributing to the glacially slow scan rate.
Budgie
Know my way around
Posts: 242
Joined: Wed Feb 27, 2008 7:57 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by Budgie »

anhil wrote: Sun Aug 22, 2021 10:12 pm Hi,

I have been plagued for several months by this same antivirus definitions update problem with my TS-569 Pro and waited patiently for a fix from QNAP - in vain.

I do share the opinion of so many in this thread, that it is outrageous by QNAP to release the final firmware known to cause problems to so many and then just call off all support for that NAS model. It may have been forgotten by QNAP that many of us using QNAP NAS at home may also hold a position in the company in which he/she can actually have an impact to the decision, which NAS hardware is going to be purchased to your company.

After this episode with antivirus definitions, I will NEVER again buy another QNAP to home (it will be Asustor of Synology instead) and will make sure that no QNAP ever lands to our company IT department. If somebody asks for my advice, which NAS to buy, you know my answer...

Cheers,
anhil
I too have this problem. I do not have the time or knowledge to follow the various suggestions in this thread. I need NAS devices in our business but I too will avoid Qnap in future. Will have a look at Asustor and thanks for the suggestion.
Budge.
User avatar
Comprax
New here
Posts: 3
Joined: Sun Apr 17, 2022 9:54 am
Location: Amsterdam
Contact:

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by Comprax »

Hi,

I don't know why clamav is not just updated in the firmware but we run our own clamav update mirror for our customers with a Qnap or Synology NAS.

We just edit freshclam.conf automatically after reboot by editing crontab like this:
0 * * * * echo "DatabaseMirror our.private.mirror.url" > /..path to../freshclam.conf && echo "MaxAttempts 2" >> /..path to../freshclam.conf
And make sure it sticks after reboot by using the commands:
crontab /etc/config/crontab && /etc/init.d/crond.sh restart

Works like a charm.
Hope this helps you all figuring this out. Let me know if you need more help.

Ron
favril
New here
Posts: 6
Joined: Thu Nov 20, 2008 4:58 pm

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by favril »

[HOW TO ] Workaround to get old QNAP NAS updating automatically using a self hosted antivirus database mirror in my home network. I use is a Raspberry Pi which acts ad a local web server running on http://db.local.clamav.net/ able to serve database files like http://db.local.clamav.net/main.cvd

Since the Antivirus Failed message appears on all QNAP NAS that are EOL like mine a TS-269 Pro, it's a systemic issue with all QNAP NAS. They're still fixing critical vulnerabilities on old NAS but I think they won't not update ClamAV on our old but still working NAS. There are no public mirror which support old version of clamAV, so you need to build your own. Basically we just need to have a local web server running on http://db.local.clamav.net/ able to serve database files like http://db.local.clamav.net/main.cvd

[Tutorial]

Using a raspberry pi, I've set up : If you host Pi-hole and ClamAV mirror on the same Raspberry or any other hardware, you need to change the webserver port for Pi-hole to keep the 80 port for the mirror. To do this edit the file /etc/lighttpd/lighttpd.conf with vi or nano.

Code: Select all

nano /etc/lighttpd/lighttpd.conf
and change the port

Code: Select all

server.port = 8080
That's right now my working solution.

Some info about ClamAv on QNAP NAS

To diagnose your issue, ssh to your QNAP NAS, then run

Code: Select all

/usr/local/bin/freshclam -v -u admin -l /tmp/.freshclam.log
If it's failing because of outdated mirror you could try to delete file

Code: Select all

sudo rm -rf /usr/share/clamav/*
and then run the previous command.

Freshclam / ClamAV config file is located on

Code: Select all

[~] # cat /etc/config/freshclam.conf
DatabaseMirror db.local.clamav.net
DatabaseMirror db.ch.clamav.net
DatabaseMirror db.cn.clamav.net
DatabaseMirror db.jp.clamav.net
DatabaseMirror db.us.clamav.net
DatabaseMirror database.clamav.net
MaxAttempts 2
Full info about clamav on your QNAP

Code: Select all

[~] #freshclam -v -u admin
Current working dir is /share/CACHEDEV1_DATA/.antivirus/usr/share/clamav
Max retries == 2
ClamAV update process started at Sat Apr 30 12:10:14 2022
Using IPv6 aware code
Querying current.cvd.clamav.net
TTL: 291
Software version from DNS: 0.103.5
WARNING: Your ClamAV installation is OUTDATED!
WARNING: Local version: 0.99.3 Recommended version: 0.103.5
DON'T PANIC! Read http://www.clamav.net/documents/upgrading-clamav
main.cvd version from DNS: 62
main.cvd is up to date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
daily.cvd version from DNS: 26527
daily.cld is up to date (version: 26527, sigs: 1982427, f-level: 90, builder: raynman)
bytecode.cvd version from DNS: 333
bytecode.cvd is up to date (version: 333, sigs: 92, f-level: 63, builder: awillia2)
Database files are located on

Code: Select all

[~] # sudo ls -l /usr/share/clamav/
total 346544
-rw-r--r-- 1 admin administrators    293670 2022-04-22 20:18 bytecode.cvd
-rw-r--r-- 1 admin administrators 184072704 2022-04-30 00:38 daily.cld
-rw-r--r-- 1 admin administrators 170479789 2022-04-22 20:10 main.cvd
-rw------- 1 admin administrators        52 2022-04-30 00:40 mirrors.dat
Hope this help
(edit with sudo added)
Last edited by favril on Sat Apr 30, 2022 6:13 pm, edited 5 times in total.
MatthewFIU
Starting out
Posts: 19
Joined: Wed Oct 19, 2011 7:19 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by MatthewFIU »

Even if you update the definitions, some of these older models don't have enough RAM to run the scan properly. You'd have to get different AV software to be able to.
FSC830
Experience counts
Posts: 2043
Joined: Thu Mar 03, 2016 1:11 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by FSC830 »

favril wrote: Sat Apr 23, 2022 3:35 am ...
If it's failing because of outdated mirror you could try to delete file

Code: Select all

rm -rf /usr/share/clamav/*
and then run the previous command.
...
Updating from my private mirror works again, but only after adding a new host to the mirrors.

The old host is not accessible:

Code: Select all

WARNING: Local version: 0.99.3 Recommended version: 0.103.5
DON'T PANIC! Read http://www.clamav.net/documents/upgrading-clamav
Retrieving http://host01.mywg.localdomain.xxx/main.cvd
Ignoring mirror 192.168.99.99 (due to previous errors)
ERROR: Can't download main.cvd from host01.mywg.localdomain.xxx
Giving up on host01.mywg.localdomain.xxx...
Any idea where (in which file) to reset this f**ing previous error status?
The command quoted did not resolve this issue.
Meanwhile I looked up a lot of files, but I cant find how to reset this entry. Even searching the internet do not provide a solution for this. All related articles refer to a clamav installation at a "normal" host, not at a QNAP NAS.

Regards
favril
New here
Posts: 6
Joined: Thu Nov 20, 2008 4:58 pm

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by favril »

@FSC830 Have you tried to run the command with sudo

Code: Select all

sudo rm -rf /usr/share/clamav/*
From what I've information about clamav mirror are located in the file mirrors.dat file. https://wade.be/2011/03/15/useful-linux ... d-database

QNAP runs on Linux, and clamav can run on any Linux Platform so it's the same program.
favril
New here
Posts: 6
Joined: Thu Nov 20, 2008 4:58 pm

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by favril »

favril wrote: Sat Apr 23, 2022 3:35 am So I've found a viable solution to have my QNAP updating automatically using a self hosted antivirus database mirror in my home network. The workaround I use is a Raspberry Pi which acts ad a local webserver running on http://db.local.clamav.net/ able to serve database files like http://db.local.clamav.net/main.cvd

Using a raspberry pi, I've set up : If you host Pi-hole and ClamAV mirror on the same Raspberry or any other hardware, you need to change the webserver port for Pi-hole to keep the 80 port for the mirror. To do this edit the file /etc/lighttpd/lighttpd.conf with vi or nano.

Code: Select all

nano /etc/lighttpd/lighttpd.conf
and change the port

Code: Select all

server.port = 8080
That's right now my working solution.

To diagnose your issue, ssh to your QNAP NAS, then run

Code: Select all

/usr/local/bin/freshclam -v -u admin -l /tmp/.freshclam.log
If it's failing because of outdated mirror you could try to delete file

Code: Select all

sudo rm -rf /usr/share/clamav/*
and then run the previous command.

Basically we just need to have a local webserver running on http://db.local.clamav.net/ able to serve database files like http://db.local.clamav.net/main.cvd

Since the Antivirus Failed message appears on all QNAP NAS that are EOL like mine a TS-269 Pro, it's a systemic issue with all QNAP NAS. They're still fixing critical vulnerabilities on old NAS but I think they won't not update ClamAV on our old but still working NAS.

Hope this help
(edit with sudo added)
plutoniumhead
New here
Posts: 6
Joined: Mon Apr 09, 2012 2:10 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by plutoniumhead »

I found a workaround for my TS-419P II that requires the Entware qpkg https://www.qnapclub.eu/en/qpkg/556 to be installed.

SSH in, and run the following commands:

Code: Select all

sudo opkg update
sudo opkg install freshclam nano
sudo /opt/bin/nano /opt/etc/freshclam.conf
Find the section that includes 'DatabaseDirectory' and make sure it points to the right location. Here's where mine are:

Code: Select all

# Path to the database directory.
# WARNING: It must match clamd.conf's directive!
# Default: hardcoded (depends on installation options)
# DatabaseDirectory /var/clamav
DatabaseDirectory /share/MD0_DATA/.antivirus/usr/share/clamav
*Be sure to save if you updated the directory.

Rename the outdated freshclam application:

Code: Select all

cd /usr/local/bin
sudo mv freshclam freshclam-outdated
Symlink the new version of freshclam where the system looks for it:

Code: Select all

ln -s /opt/sbin/freshclam freshclam
Manually run freshclam to download the latest definitions (this can take a very long time) and verify that things are working:

Code: Select all

freshclam
*Mine failed the first time, I had to run it twice.

From the Web UI, navigate to the Control Panel and Antivirus. You should see that the definitions are now up to date.
Last edited by plutoniumhead on Wed Mar 15, 2023 9:51 pm, edited 1 time in total.
Budgie
Know my way around
Posts: 242
Joined: Wed Feb 27, 2008 7:57 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by Budgie »

It is exhausting reading this thread so please can I ask a question before going further.
My device is a TS559 Pro II which I understand went EoL at the end of December 2020.
I am not inclined to try and revive the built-in firmware but would like to try using a qpkg package.
Is this likely to work and which qpkg packages should I try and install please.
Regards,
Budge.
Budgie
Know my way around
Posts: 242
Joined: Wed Feb 27, 2008 7:57 am

Re: [Open] TS-669 p Antivirus Failed to update virus definitions. Please try again later or update the definitions manua

Post by Budgie »

Hi,
I have returned to this and am getting an error:-

Code: Select all

[/usr/local/bin] # freshclam
ERROR: Can't open/parse the config file /opt/etc/freshclam.conf
[/usr/local/bin] # /opt/bin/nano /opt/etc/freshclam.conf
[/usr/local/bin] # freshclam
ERROR: No DatabaseMirror or PrivateMirror servers set in freshclam config file.
ERROR: Unable to find DatabaseMirror or PrivateMirror option(s) that specify database server FQDNs.
[/usr/local/bin] #
Please can somebody help me here.
Post Reply

Return to “NAS Management”