[SOLVED] Database is locked

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
srazer
Messages: 10
Registration: Sep 28, 2017 - 8:18 p.m.

January 7, 2019 - 2:16 PM

Hello all,

I frequently apply upgrades from the console and occasionally the clients will freeze. The only thing that fixes it is to restart waptservice. When looking at the log on the client I see:

Code: Select all

Get packages index
90 package(s) in the repository
Packages to be updated : hcrp-vlc(=3.0.5-3),hcrp-adobereader-en(=2019.10.20069-3),hcrp-cisco-jabber(=12.5.0.22884-2)
Exception in thread WaptTaskManager:
Traceback (most recent call last):
  File "c:\wapt\lib\threading.py", line 801, in __bootstrap_inner
    self.run()
  File "c:\wapt\waptservice\service.py", line 1415, in run
    self.update_runstatus('')
  File "c:\wapt\waptservice\service.py", line 1184, in update_runstatus
    self.events.post_event("STATUS",self.wapt.get_last_update_status())
  File "c:\wapt\common.py", line 5043, in get_last_update_status
    status = self.read_param('last_update_status',{"date": "", "running_tasks": [], "errors": [], "upgrades": []},ptype='json')
  File "c:\wapt\common.py", line 6621, in read_param
    return self.waptdb.get_param(name,default,ptype)
  File "c:\wapt\common.py", line 336, in get_param
    q = self.db.execute('select value,ptype from wapt_params where name=? order by create_date desc limit 1',(name,)).fetchone()
OperationalError: database is locked

2019-01-07 07:04:44,927 CRITICAL *********** error OperationalError: database is locked
2019-01-07 07:04:50,526 CRITICAL *********** error OperationalError: database is locked
2019-01-07 07:04:56,131 CRITICAL *********** error OperationalError: database is locked
2019-01-07 07:31:53,586 CRITICAL *********** error OperationalError: database is locked

Any ideas?

Thanks,
Chris Knowles
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

January 8, 2019 - 02:18

Hi Chris,
srazer wrote: Jan 07, 2019 - 2:16 p.m. Hello all,

I frequently apply upgrades from the console and occasionally the clients will freeze. The only thing that fixes it is to restart waptservice. When looking at the log on the client I see:
It seems like a bug. What version of Wapt are you using?

Cheers,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
srazer
Messages: 10
Registration: Sep 28, 2017 - 8:18 p.m.

January 8, 2019 - 2:08 PM

dcardon wrote: Jan 08, 2019 - 02:18
It seems like a bug. What version of Wapt are you using?

Cheers,

Denis
I am using 1.6.2.7.

Chris
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

January 10, 2019 - 5:58 PM

Check if you don't have a Scheduled job (system wide) running some "wapt-get" commands.
In the early versions of wapt, the update of packages index was scheduled by a Windows task (wapt-get enable-tasks command), now the waptservice is doing the job.
Tranquil IT
srazer
Messages: 10
Registration: Sep 28, 2017 - 8:18 p.m.

January 11, 2019 - 8:16 PM

We have a script that runs periodically that pulls the computer's description from AD and replaces the computer's local description. It then runs 'wapt-get update-status' to push the new description to the wapt server.

I'm going to assume that this could be the culprit?


I have updated the script to only call wapt-get update-status when it sees a difference and will stop waptservice first then start it again after. Does this seem like the correct approach?

Thanks,
Chris
Locked