winget SQL error

Copper Contributor

Hi,

The winget command fails with SQL error

 

Spoiler

An unexpected error occurred while executing the command:

SQL logic error

0x87af0001 : SQL error or missing database

 

Is there a way to solve this issue ?

(Windows 11 22523, Winget v1.2.3411-preview)

3 Replies

@plo3000 I was recently having the same issue. Seems like it has to do with the cache for apps installed from the MS Store being corrupted. I was able to resolve it by deleting %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db

If that doesn't fix it, you can better diagnose the issue by taking a look at the logs in %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\

Here are my relevant logs for reference:

Spoiler
2022-02-24 15:58:00.760 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\teomi\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db'
2022-02-24 15:58:00.760 [SQL ] Opening SQLite connection: 'C:\Users\teomi\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' [2, 0]
2022-02-24 15:58:00.761 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\SQLiteWrapper.cpp(173)\WindowsPackageManager.dll!00007FF841A8121A: (caller: 00007FF841A821B6) Exception(1) tid(2b64) 87AF0001 SQL error or missing database
Msg:[SQL logic error]

2022-02-24 15:58:00.761 [CLI ] Caught wil::ResultException: D:\a\_work\1\s\external\pkg\src\AppInstallerRepositoryCore\SQLiteWrapper.cpp(173)\WindowsPackageManager.dll!00007FF841A8121A: (caller: 00007FF841A821B6) Exception(1) tid(2b64) 87AF0001 SQL error or missing database
Msg:[SQL logic error]

 

Thank you @jamonith , I was having the same issue and your solution worked for me

Worked like a charm, thanks!