Failed to update virus definitions

Introduce yourself to us and other members here, or share your own product reviews, suggestions, and tips and tricks of using QNAP products.
Locked
nookcv
New here
Posts: 2
Joined: Mon Oct 10, 2016 11:30 pm

Failed to update virus definitions

Post by nookcv »

I was having a problem where I kept getting these notifications:
[Antivirus] Failed to update virus definitions. Please, create a volume and try again.
I worked out what I needed to do. In short, I had some free space left on my NAS. So, I followed the error message and created a volume:
  1. Log onto NAS Web interface.
  2. Open Storage and Snapshots app.
  3. Click on Storage/Snapshots menu item on the left.
  4. Click on the "Create (New) ▾" button.
  5. Click on New Volume.
  6. Select Thick Volume.
  7. Location: Storage Pool 1
  8. Click Next.
  9. Volume Alias: SystemVol
  10. Volume capacity: 25GB.
  11. Bytes per inode: 4K.
  12. Click Next.
  13. Click Finish.
I'm sure your steps will be a little different. For example, my wizard skipped from the Select Type step to the Configure step. The basic idea is to create a small volume that the NAS can use to store its files.

Watching the volume in Storage & Snapshots, I could see the volume being created and formatted. Its status changed to "Creating Default Folders..." for a while. I waited for this process to complete and the volume status to change to ✓ Ready.

Now I want to check on the antivirus app. You can close or minimize the Storage & Snapshots app using the task bar at the top of the QNAP Web page.
  1. Open Control Panel. For clarity, this is the NAS app in the QNAP Web interface.
  2. Click on the Applications menu.
  3. Click on the Antivirus menu option. This should start you on the Overview tab.
  4. I clicked on the Update now button. That took a while. But, eventually, it finished.
  5. I checked the box to Enable antivirus.
  6. In the Update section, I checked the box to Check and update automatically once a day.
  7. Click the Apply button at the bottom.
You might want to poke around in the Antivirus settings to see if everything is to your liking. I also checked on the scan schedule and started a full scan. But what I outlined above is basically it. Those steps fixed my issue.

Now, I had no idea what was meant by "Please, create a volume and try again," when I started. So, I actually went through a longer process of discovery before things made sense to me.

I started with this thread: TS-469U-RP Failed to update virus definition and, specifically, this post about tracing the antivirus update script was helpful.

If you are not familiar with SSH, try to search and learn some of the basics online. Basically, it is a command prompt for your NAS. One thing you will need is an SSH client. PuTTY works for me on Windows. On Mac and Linux, you should be able to use 'ssh' from a terminal.
  1. Enter the IP address for your NAS.
  2. Accept the fingerprint the first time you connect.
  3. Enter the same user name and password you use to access the Web interface.
This will provide you with a shell for the NAS.

From there, I followed the example in the post. It helps if you're familiar with what the terminal normally looks like.

I wasn't sure about the network connectivity. So, I started with this command:

Code: Select all

/sbin/curl --connect-timeout 10 -I clamav.net

That produced a 302 which seems fine for 'clamav.net'.
[~] # /sbin/curl --connect-timeout 10 -I clamav.net
HTTP/1.1 302 Moved Temporarily
Date: Fri, 21 Sep 2018 14:57:01 GMT
Server: Apache
Location: http://www.clamav.net/
Content-Type: text/html; charset=iso-8859-1
X-Cache: MISS from barracuda.my.domain
Via: 1.1 barracuda.my.domain (http_scan_byf/3.3.1)
Connection: keep-alive
Next, I moved on to stepping through the update script.

Code: Select all

/bin/sh -xxxx /etc/init.d/antivirus.sh update_db

That produced:
[~] # /bin/sh -xxxx /etc/init.d/antivirus.sh update_db
+ export QNAP_QPKG=antivirus
+ QNAP_QPKG=antivirus
+ rcExe=0
...
+ FindDefVol
++ /sbin/getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info
+ local DEF_VOLMP=/share/CACHEDEV1_DATA
+ '[' '!' -z /share/CACHEDEV1_DATA ']'
+ '[' -d /share/CACHEDEV1_DATA ']'
+ return 1
+ '[' 1 '!=' 0 ']'
+ dbgprintf ' Uppdate failed: no default volume.'
+ return
+ '[' x1520524458 '!=' x0 ']'
+ /sbin/write_log '[Antivirus] Failed to update virus definitions. Please, create a volume and try again.' 1
+ return 1
These trailing lines about a default volume prompted me to search online. That turned up App Default volume does not exist and this post.

That suggested fix triggered my memory because I had gone through the System Logs in the Web interface earlier and saw a warning:
The default network shared folders (Public, Web) do not exist. These shared folders can be restored in "Control Panel > Shared Folders".
I tried to create the default folders following that post. But that failed with:
System default shares have already existed, or the disk volume is not formatted or unmounted.
That prompted me to see if I had any free space left over on my NAS. Since I had some free space, I created a volume. And that leads to my instructions above. Ultimately, I did not have to manually restore the default shared folders because that happened automatically after I created the empty volume. And that is how I figured things out.

Please post your questions below.
AmberMSE
First post
Posts: 1
Joined: Tue Oct 16, 2018 5:18 am

Re: Failed to update virus definitions

Post by AmberMSE »

Nookcv,

Just wanted to say thank you for the directions and explanation! I've been ignoring this error for a while and what you suggested was super easy to follow and fixed the problem.

Amber
kronosm
New here
Posts: 9
Joined: Wed May 08, 2019 8:38 am

Re: Failed to update virus definitions

Post by kronosm »

so I created a new volume but the error still persists. This was working fine for almost a year, I don't remember doing anything differently lately. Thoughts?
User avatar
dolbyman
Guru
Posts: 35013
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: Failed to update virus definitions

Post by dolbyman »

take a peek here and see if it applies

viewtopic.php?f=50&t=146352
Last edited by dolbyman on Thu Apr 30, 2020 3:42 am, edited 1 time in total.
User avatar
graemev
Know my way around
Posts: 199
Joined: Sun Feb 12, 2012 10:17 pm

Re: Failed to update virus definitions

Post by graemev »

OK, I'm now getting this error, the "cause" is:

# /sbin/getcfg Check_FS /share/CACHEDEV1_DATA -d 0 -f /etc/.sm_v2_storage_runtime_info

Which returns a zero in my case because the file /etc/.sm_v2_storage_runtime_info is missing:

# ls -l /etc/.sm*
-rw-r--r-- 1 admin administrators 0 2020-04-29 14:07 /etc/.sm_v2_boot_iscsi_init_start
-rw-r--r-- 1 admin administrators 0 2020-04-29 14:07 /etc/.sm_v2_boot_vjbod_recovery_complete

Could somebody who has this working post the output of:

cat /etc/.sm_v2_storage_runtime_info
(assuming it does not contain anything sensitive, like passwords)

(yes I did the QNAP GUI > Control Panel > Privilege Settings > Shared Folders to click [Restore Default Shared Folders]. mine also existed )

I'm not creating a new volume, as above, because I think that will just cause virus checking to check the new 'basically empty' volume and so make the error message go away but not check your original volume.
clangren
New here
Posts: 2
Joined: Sun Nov 29, 2015 6:02 am

Re: Failed to update virus definitions

Post by clangren »

Adding to this old thread since it came up in my search for the same problem.

This solved it for me: https://www.qnap.com/en/how-to/knowledg ... new-volume

Edit /etc/config/def_share.info to have data for defVolMP. Mine was blank, added "defVolMP = /share/CACHEDEV1_DATA" as suggested and problem solved.

My NAS has only 1 volume so it was CACHEDEV1 as opposed to CACHEDEV2 or some other volume number. Adjust the number as needed.
Locked

Return to “Users' Corner”