[SOLVED] Windows Update Problem

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
Maxslg
Messages: 4
Registration: June 22, 2023 - 08:59

July 10, 2023 - 10:10

Good morning,
I am experiencing a problem with WAPT's Windows Update which is not working.
I initially tried using a wsus package to unlock updates, but it didn't work.
Next, I executed the command "wapt-get waptwa-scan" and it returned this:

Code: Select all

wapt-get waptwua-scan
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
2023-07-10 09:27:55,696 INFO User Groups:[]
2023-07-10 09:27:55,696 DEBUG Host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt not found, not using it for auth on repo global
2023-07-10 09:27:55,696 INFO WAPT base directory : C:\Program Files (x86)\wapt
2023-07-10 09:27:55,696 INFO Package cache dir : C:\Program Files (x86)\wapt\cache
2023-07-10 09:27:55,696 INFO WAPT DB Structure version: 20210420
2023-07-10 09:27:55,696 CRITICAL Bad persistent dir for package Maj windows
2023-07-10 09:27:55,696 CRITICAL Bad persistent dir for package wsus-all
Ensure wuauserv Auto Update option is disabled
Scanning with windows updates rules:
{
 "direct_download":false,
 "default_allow":false,
 "include_potentially_superseded_updates":false,
 "filter":"Type='Software' or Type='Driver'",
 "download_scheduling":"1d",
 "install_scheduling":"2h",
 "install_delay":"None",
 "postboot_delay":"10m"
}
2023-07-10 09:27:56,228 DEBUG Host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt not found, not using it for auth on repo wapt
2023-07-10 09:27:56,228 INFO Main repository: https://SRV-WAPT.mairie.mdm/wapt
2023-07-10 09:27:56,228 DEBUG Unable to get or create host key: [WinError 5] Accès refusé: 'C:\\Program Files (x86)\\wapt\\private\\03000200-0400-0500-0006-000700080009.pem'
2023-07-10 09:27:56,228 DEBUG Host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt not found, not using it for auth on repo wapt-host
2023-07-10 09:27:56,228 DEBUG Host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt not found, not using it for auth on repo waptwua
2023-07-10 09:27:56,228 INFO WAPTWUA repository: https://SRV-WAPT.mairie.mdm/wapt
2023-07-10 09:27:56,235 DEBUG Starting new HTTPS connection (1): srv-wapt.mairie.mdm:443
2023-07-10 09:27:56,281 DEBUG https://srv-wapt.mairie.mdm:443 "HEAD /waptwua/wsusscn2.cab HTTP/1.1" 200 0
2023-07-10 09:27:56,281 DEBUG New wsusscn2cab.cab date : 2023-06-13T04:25:13+00:00
Windows updates rules have been changed
2023-07-10 09:27:56,281 DEBUG Scanning installed / not installed Updates
2023-07-10 09:27:56,281 DEBUG DB Start transaction
2023-07-10 09:27:56,281 DEBUG DB rollback
2023-07-10 09:27:56,297 DEBUG Error at DB exit attempt to write a readonly database, rollbacking
['  File "C:\\Program Files (x86)\\wapt\\common.py", line 335, in set_param\n    self.execute(\'insert or replace into wapt_params(name,value,create_date,ptype) values (?,?,?,?)\', (name, value, datetime2isodate(), ptype))\n', '  File "C:\\Program Files (x86)\\wapt\\common.py", line 385, in execute\n    return self.db.execute(query, args)\n']
re-enabling wuauserv previous state: 2
FATAL ERROR : AttributeError: __enter__
Traceback (most recent call last):
  File "<string>", line 1495, in main
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 914, in scan_updates_status
    for update in self.updates():
  File "C:\Program Files (x86)\wapt\waptwua\client.py", line 801, in updates
    self.wapt.write_param('waptwua.status', 'SCANNING')
  File "C:\Program Files (x86)\wapt\common.py", line 8123, in write_param
    self.waptdb.set_param(name, value)
  File "C:\Program Files (x86)\wapt\common.py", line 335, in set_param
    self.execute('insert or replace into wapt_params(name,value,create_date,ptype) values (?,?,?,?)', (name, value, datetime2isodate(), ptype))
  File "C:\Program Files (x86)\wapt\common.py", line 385, in execute
    return self.db.execute(query, args)
sqlite3.OperationalError: attempt to write a readonly database

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1677, in <module>
  File "<string>", line 1496, in main
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 2534, in __exit__
    registry_set(HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update', 'AUOptions', self.old_au_options)
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 3542, in registry_set
    with reg_openkey_noredir(root, path, sam=KEY_WRITE, create_if_missing=True) as key:
AttributeError: __enter__
Exception at 005B3BE5: EPyAttributeError:
AttributeError: __enter__. 

The errors are, in principle, here:

Code: Select all

DEBUG Host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt not found, not using it for auth on repo wapt

Unable to get or create host key: [WinError 5] Accès refusé: 'C:\\Program Files (x86)\\wapt\\private\\03000200-0400-0500-0006-000700080009.pem'

DEBUG Error at DB exit attempt to write a readonly database, rollbacking

sqlite3.OperationalError: attempt to write a readonly database
I've searched the forum and the internet and I can't find anything.
Can you help me?
THANKS.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

July 10, 2023 - 10:31

Did you run the wapt-get waptwa-scan command as an administrator?

a priori, if we look at the messages:

Code: Select all

sqlite3.OperationalError: attempt to write a readonly database 
And

Code: Select all

[WinError 5] Accès refusé: 'C:\\Program Files (x86)\\wapt\\private\\03000200-0400-0500-0006-000700080009.pem'
It would seem that this is not the case.
Maxslg
Messages: 4
Registration: June 22, 2023 - 08:59

July 10, 2023 - 10:56

Indeed, here is the new result:

Code: Select all

wapt-get waptwua-scan
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
2023-07-10 10:41:08,407 INFO User Groups:[]
2023-07-10 10:41:08,439 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.pem for repo global auth
2023-07-10 10:41:08,439 INFO WAPT base directory : C:\Program Files (x86)\wapt
2023-07-10 10:41:08,439 INFO Package cache dir : C:\Program Files (x86)\wapt\cache
2023-07-10 10:41:08,439 INFO WAPT DB Structure version: 20210420
Ensure wuauserv Auto Update option is disabled
Scanning with windows updates rules:
{
 "direct_download":false,
 "default_allow":false,
 "include_potentially_superseded_updates":false,
 "filter":"Type='Software' or Type='Driver'",
 "download_scheduling":"1d",
 "install_scheduling":"2h",
 "install_delay":"None",
 "postboot_delay":"10m"
}
2023-07-10 10:41:08,909 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.pem for repo wapt auth
2023-07-10 10:41:08,909 INFO Main repository: https://SRV-WAPT.mairie.mdm/wapt
2023-07-10 10:41:08,909 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.pem for repo wapt-host auth
2023-07-10 10:41:08,909 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.pem for repo waptwua auth
2023-07-10 10:41:08,909 INFO WAPTWUA repository: https://SRV-WAPT.mairie.mdm/wapt
2023-07-10 10:41:08,909 DEBUG Loading ssl context with cert C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt and key C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.pem
2023-07-10 10:41:08,924 DEBUG Starting new HTTPS connection (1): srv-wapt.mairie.mdm:443
2023-07-10 10:41:08,956 DEBUG https://srv-wapt.mairie.mdm:443 "HEAD /waptwua/wsusscn2.cab HTTP/1.1" 200 0
2023-07-10 10:41:08,971 DEBUG New wsusscn2cab.cab date : 2023-06-13T04:25:13+00:00
   Connecting to local update searcher using offline wsusscn2 file...
   Offline Update searcher ready...
Some windows updates have been installed/uninstalled since last scan
2023-07-10 10:41:37,501 DEBUG Scanning installed / not installed Updates
2023-07-10 10:41:37,501 DEBUG DB Start transaction
2023-07-10 10:41:37,501 DEBUG DB commit
Looking for updates with filter: Type='Software' or Type='Driver'
Waiting for WUA search to complete
Done searching
2023-07-10 10:48:10,619 DEBUG DB Start transaction
2023-07-10 10:48:10,619 DEBUG DB commit
WUA Search completed !
2023-07-10 10:48:10,666 DEBUG DB Start transaction
2023-07-10 10:48:10,666 DEBUG DB commit
Updates scan done.
2023-07-10 10:48:10,666 DEBUG DB Start transaction
2023-07-10 10:48:10,666 DEBUG DB commit
2023-07-10 10:48:10,681 DEBUG Already installed 07609d43-d518-4e77-856e-d1b316d1b8a8 : Mise à jour de sécurité de MSXML 6.0 RTM (925673)
2023-07-10 10:48:10,681 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,697 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,697 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,703 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,703 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,703 DEBUG DB Start transaction
2023-07-10 10:48:10,703 DEBUG DB commit
2023-07-10 10:48:10,797 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,797 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,804 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,804 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,804 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,804 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,819 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,819 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,819 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,835 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,835 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:10,835 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
Writing status in local wapt DB
2023-07-10 10:48:10,851 DEBUG DB Start transaction
2023-07-10 10:48:10,851 DEBUG DB commit
2023-07-10 10:48:10,851 DEBUG DB Start transaction
2023-07-10 10:48:10,851 DEBUG DB commit
2023-07-10 10:48:10,851 DEBUG DB Start transaction
2023-07-10 10:48:10,851 DEBUG DB commit
2023-07-10 10:48:10,866 DEBUG DB Start transaction
2023-07-10 10:48:10,866 DEBUG DB commit
2023-07-10 10:48:12,624 DEBUG DB Start transaction
2023-07-10 10:48:12,624 DEBUG DB commit
2023-07-10 10:48:12,624 DEBUG DB Start transaction
2023-07-10 10:48:12,624 DEBUG DB commit
2023-07-10 10:48:12,640 DEBUG DB Start transaction
2023-07-10 10:48:12,640 DEBUG DB commit
2023-07-10 10:48:12,640 DEBUG DB Start transaction
2023-07-10 10:48:12,640 DEBUG DB commit
2023-07-10 10:48:12,640 DEBUG DB Start transaction
2023-07-10 10:48:12,640 DEBUG DB commit
2023-07-10 10:48:12,640 DEBUG Updating workstation status on remote wapt server
2023-07-10 10:48:12,655 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:12,655 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:12,655 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:12,655 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:12,671 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:12,671 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:12,671 CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")
2023-07-10 10:48:13,172 DEBUG DB Start transaction
2023-07-10 10:48:13,172 DEBUG DB commit
2023-07-10 10:48:13,172 DEBUG Loading ssl context with cert C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.crt and key C:\Program Files (x86)\wapt\private\03000200-0400-0500-0006-000700080009.pem
2023-07-10 10:48:13,172 DEBUG Starting new HTTPS connection (1): srv-wapt.mairie.mdm:443
2023-07-10 10:48:13,210 DEBUG https://srv-wapt.mairie.mdm:443 "HEAD /ping HTTP/1.1" 200 0
2023-07-10 10:48:13,310 DEBUG host_info timing: 0.0846402645111084 s
2023-07-10 10:48:13,411 DEBUG host_networking timing: 0.08461189270019531 s
2023-07-10 10:48:13,426 DEBUG host_capabilities timing: 0.01563549041748047 s
2023-07-10 10:48:13,527 DEBUG host_metrics timing: 0.10027432441711426 s
2023-07-10 10:48:13,527 DEBUG Stores cert chain check in cache
2023-07-10 10:48:13,527 DEBUG wapt_status timing: 0.0 s
2023-07-10 10:48:13,542 DEBUG installed_softwares timing: 0.015625 s
2023-07-10 10:48:13,542 DEBUG installed_packages timing: 0.0 s
2023-07-10 10:48:13,542 DEBUG packages_audit_status timing: 0.0 s
2023-07-10 10:48:13,542 DEBUG last_update_status timing: 0.0 s
2023-07-10 10:48:13,542 DEBUG authorized_certificates timing: 0.0 s
2023-07-10 10:48:13,558 DEBUG configurations timing: 0.015624523162841797 s
2023-07-10 10:48:13,558 DEBUG wuauserv_status timing: 0.0 s
2023-07-10 10:48:13,558 DEBUG waptwua_status timing: 0.0 s
2023-07-10 10:48:13,558 DEBUG waptwua_updates timing: 0.0 s
2023-07-10 10:48:13,558 DEBUG waptwua_updates_localstatus timing: 0.0 s
2023-07-10 10:48:13,558 DEBUG waptwua_updates_localstatus timing: 0.0 s
2023-07-10 10:48:13,558 INFO Updated data keys : ['host_info', 'host_metrics', 'packages_audit_status', 'last_update_status', 'wuauserv_status', 'waptwua_status']
2023-07-10 10:48:13,558 INFO Supplied data keys : ['uuid', 'computer_fqdn', 'status_revision', 'host_info', 'host_metrics', 'packages_audit_status', 'last_update_status', 'wuauserv_status', 'waptwua_status', 'status_hashes']
2023-07-10 10:48:13,589 DEBUG Starting new HTTPS connection (1): srv-wapt.mairie.mdm:443
2023-07-10 10:48:13,674 DEBUG https://srv-wapt.mairie.mdm:443 "POST /update_host HTTP/1.1" 200 1347
2023-07-10 10:48:13,674 DEBUG DB Start transaction
2023-07-10 10:48:13,674 DEBUG DB commit
2023-07-10 10:48:13,674 DEBUG DB Start transaction
2023-07-10 10:48:13,674 DEBUG DB commit
2023-07-10 10:48:13,674 DEBUG DB Start transaction
2023-07-10 10:48:13,674 DEBUG DB commit
2023-07-10 10:48:13,674 DEBUG DB Start transaction
2023-07-10 10:48:13,689 DEBUG DB commit
2023-07-10 10:48:13,689 DEBUG DB Start transaction
2023-07-10 10:48:13,689 DEBUG DB commit
2023-07-10 10:48:13,689 INFO Status on server https://SRV-WAPT.mairie.mdm updated properly
2023-07-10 10:48:13,689 INFO update_server_status successful (data size 9292)
(1, False, 5)
None
re-enabling wuauserv previous state: 2 
Both errors have disappeared, but this error

Code: Select all

"CRITICAL Bad time install_delay: None ValueError("could not convert string to float: 'None'")" 
appeared 7 times
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

July 10, 2023 - 11:04

What value did you use for install_delay?
Maxslg
Messages: 4
Registration: June 22, 2023 - 08:59

July 10, 2023 - 11:32

Indeed, I realized this when rereading the error. I changed the value to "1d" and now the updates are working and the wsus package is functioning.

Thank you for your prompt response, have a good day.
Locked