Skip to content

0x800700b7 : Cannot create a file when that file already exists. (Win 11) #1433

Closed

Description

@UncleUncleRj

Brief description of your issue

Using winget list or winget upgrade shows the same error (see below). Winget previously worked fine and I'm unaware of what changes were made.

Steps to reproduce

winget list
winget upgrade [xxxx]

Expected behavior

Commands should execute correctly

Actual behavior

The following error is produced:

Failed to open the predefined source; please report to winget maintainers.
An unexpected error occurred while executing the command:
0x800700b7 : Cannot create a file when that file already exists.

Environment

Windows Package Manager v1.0.11694
Windows: Windows.Desktop v10.0.22449.1000
Package: Microsoft.DesktopAppInstaller v1.15.11694.0

Windows 11
Powershell 7 x64 (Administrator)

Activity

  1. nono-was-taken commented on Sep 5, 2021

    @nono-was-taken

    Got the same issue here and I'm also unaware of any changes made.

    Windows Package Manager v1.0.11694
    Windows: Windows.Desktop v10.0.22000.168
    Package: Microsoft.DesktopAppInstaller v1.15.11694.0

  2. added
    Issue-Bug
    on Sep 7, 2021
  3. DiegoMagdaleno commented on Sep 8, 2021

    @DiegoMagdaleno

    Same issue:

    Winget version: v1.0.11694
    Windows version: OS Build 22449.1000
    Package: Microsoft.DesktopAppInstaller v1.15.11694.0

  4. Echo64 commented on Sep 10, 2021

    @Echo64

    Same issue here as well, tried removing the following sources: "msstore" and "newstore", but issue persists. Just upgraded to the new Windows 11 Dev build, no changes. Running with "--source winget" results in the same error message.

    Winget version: v1.0.11694
    Windows: Windows.Desktop v10.0.22454.1000
    Package: Microsoft.DesktopAppInstaller v1.15.11694.0

    Should also note that I have the same setup on my work computer running the same insider build of Windows 11 Dev and it works fine using "--source winget", there might be something local interfering with this.

  5. jonasjancarik commented on Sep 14, 2021

    @jonasjancarik

    Same issue - removing and adding winget source doesn't help (winget source remove winget and winget source add -n winget -a https://winget.azureedge.net/cache). winget list still results in Failed to open the predefined source; please report to winget maintainers. An unexpected error occurred while executing the command: 0x800700b7 : Cannot create a file when that file already exists.

    Winget version: v1.0.11694
    Windows version: Windows.Desktop v10.0.22454.1000

  6. joshieecs commented on Sep 16, 2021

    @joshieecs

    I am having the same issue.

    I tracked down the log files, located here:

    %LocalAppData%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\

    Here is the relevant line in the log:

    [FAIL] E:\BA\98\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\Schema\1_0\Interface_1_0.cpp(184)\AppInstallerCLI.exe!00007FF666030B45: (caller: 00007FF66602CD33) Exception(1) tid(4354) 800700B7 Cannot create a file when that file already exists.
    

    The exception is being raised in this function:

    SQLite::rowid_t Interface::AddManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::filesystem::path& relativePath)
    {
    auto manifestResult = GetExistingManifestId(connection, manifest);
    // If this manifest is already present, we can't add it.
    THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), manifestResult.has_value());
    SQLite::Savepoint savepoint = SQLite::Savepoint::Create(connection, "addmanifest_v1_0");
    auto [pathAdded, pathLeafId] = PathPartTable::EnsurePathExists(connection, relativePath, true);
    // If we get false from the function, this manifest path already exists in the index.
    THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), !pathAdded);

    The run up to the failure opens an SQLite database (index.db) in the Microsoft.Winget.Source package in %ProgramFiles%\WindowsApps, which contains the metadata for all the packages in the community repo (in the most normalized SQLite db file I have ever seen!)

    Then it starts going through ARP entries.

    I have over 100 log files like this. They are mostly the same. I am including the earliest one I have with the line starting [FAIL].

    It logs downloading the MSIX packages for Winget.Source and Winget.MSStore, and integrating the msstore and winget to newstore db. The newer logs do not have that part, so I have included one example from 9-16 for comparison. Though if you remove those packages, winget will reacquire them with the proper winget source add command.

    At only 70 lines, I am dropping it in an expando. Files for download below.

    WinGet-2021-09-14-05-46-45.584.log
    C:\Users\Joshua\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-2021-09-14-05-46-45.584.log
    
    2021-09-14 05:46:45.587 [CORE] Subkey 'Software\Policies\Microsoft\Windows\AppInstaller' was not found
    2021-09-14 05:46:45.587 [CORE] Setting action: Get, Type: UserFile, Name: settings.json
    2021-09-14 05:46:45.602 [CORE] Settings loaded from settings.json
    2021-09-14 05:46:45.602 [CORE] Valid setting. Field: .visual.progressBar Value: rainbow
    2021-09-14 05:46:45.602 [CORE] Setting .source.autoUpdateIntervalInMinutes not found. Using default
    2021-09-14 05:46:45.602 [CORE] Setting .experimentalFeatures.experimentalCmd not found. Using default
    2021-09-14 05:46:45.602 [CORE] Setting .experimentalFeatures.experimentalArg not found. Using default
    2021-09-14 05:46:45.602 [CORE] Valid setting. Field: .experimentalFeatures.experimentalMSStore Value: 1
    2021-09-14 05:46:45.602 [CORE] Setting .telemetry.disable not found. Using default
    2021-09-14 05:46:45.602 [CORE] Setting .installBehavior.preferences.scope not found. Using default
    2021-09-14 05:46:45.602 [CORE] Setting .installBehavior.requirements.scope not found. Using default
    2021-09-14 05:46:45.602 [CORE] Setting .network.downloader not found. Using default
    2021-09-14 05:46:45.602 [CORE] Setting .network.doProgressTimeoutInSeconds not found. Using default
    2021-09-14 05:46:45.603 [CORE] Valid setting. Field: .installBehavior.preferences.locale Value: [en-US]
    2021-09-14 05:46:45.603 [CORE] Setting .installBehavior.requirements.locale not found. Using default
    2021-09-14 05:46:45.603 [CORE] Valid setting. Field: .experimentalFeatures.packagedAPI Value: 1
    2021-09-14 05:46:45.604 [CORE] WinGet, version [1.0.11694], activity [{8A186E88-FF20-4C9C-959A-CF7D6E1622E3}]
    2021-09-14 05:46:45.604 [CORE] OS: Windows.Desktop v10.0.22454.1000
    2021-09-14 05:46:45.604 [CORE] Command line Args: "C:\Users\Joshua\AppData\Local\Microsoft\WindowsApps\winget.exe" upgrade
    2021-09-14 05:46:45.604 [CORE] Package: Microsoft.DesktopAppInstaller v1.15.11694.0
    2021-09-14 05:46:45.604 [CORE] IsCOMCall:0; Caller: winget-cli
    2021-09-14 05:46:45.611 [CLI ] WinGet invoked with arguments: 'upgrade'
    2021-09-14 05:46:45.611 [CLI ] Found subcommand: upgrade
    2021-09-14 05:46:45.611 [CLI ] Leaf command to execute: root:upgrade
    2021-09-14 05:46:45.611 [CLI ] Executing command: upgrade
    2021-09-14 05:46:45.611 [CORE] Setting action: Get, Type: Secure, Name: user_sources
    2021-09-14 05:46:45.617 [CORE] Setting action: Get, Type: Standard, Name: sources_metadata
    2021-09-14 05:46:45.618 [REPO] Default source requested, multiple sources available, creating aggregated source.
    2021-09-14 05:46:45.618 [REPO] Adding to aggregated source: winget
    2021-09-14 05:46:45.618 [REPO] Source past auto update time [5 mins]; it has been at least 3006 mins
    2021-09-14 05:46:46.769 [CORE] Examining extension: PFN = Microsoft.Winget.MSStore.Source_8wekyb3d8bbwe, ID = IndexDB
    2021-09-14 05:46:46.773 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
    2021-09-14 05:46:46.773 [CORE] Found matching extension.
    2021-09-14 05:46:46.777 [CORE] Downloading to path: C:\Users\Joshua\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix
    2021-09-14 05:46:46.778 [CORE] Started applying motw to C:\Users\Joshua\AppData\Local\Temp\WinGet\Microsoft.Winget.Source_8wekyb3d8bbwe.msix with zone: 3
    2021-09-14 05:46:46.782 [CORE] Finished applying motw
    2021-09-14 05:46:46.782 [CORE] WinINet downloading from url: https://winget.azureedge.net/cache/source.msix
    2021-09-14 05:46:47.321 [CORE] Download completed.
    2021-09-14 05:46:47.321 [CORE] Starting AddPackage operation #0: file:///C:/Users/Joshua/AppData/Local/Temp/WinGet/Microsoft.Winget.Source_8wekyb3d8bbwe.msixSkipSmartScreen: 1
    2021-09-14 05:46:47.324 [CORE] Begin waiting for deployment #0
    2021-09-14 05:46:47.324 [CORE] Begin blocking for deployment #0
    2021-09-14 05:46:48.293 [CORE] Successfully deployed #0
    2021-09-14 05:46:48.310 [CORE] Examining extension: PFN = Microsoft.Winget.MSStore.Source_8wekyb3d8bbwe, ID = IndexDB
    2021-09-14 05:46:48.314 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
    2021-09-14 05:46:48.314 [CORE] Found matching extension.
    2021-09-14 05:46:48.351 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2021.914.1113.201_neutral__8wekyb3d8bbwe\Public\index.db'
    2021-09-14 05:46:48.351 [SQL ] Opening SQLite connection: 'file:/C:/Program Files/WindowsApps/Microsoft.Winget.Source_2021.914.1113.201_neutral__8wekyb3d8bbwe/Public/index.db?immutable=1' [1, 40]
    2021-09-14 05:46:48.352 [REPO] Opened SQLite Index with version [1.3], last write [2021-09-14 05:12:56.000]
    2021-09-14 05:46:48.383 [REPO] Adding to aggregated source: msstore
    2021-09-14 05:46:48.383 [REPO] Source past auto update time [5 mins]; it has been at least 3006 mins
    2021-09-14 05:46:48.757 [CORE] Examining extension: PFN = Microsoft.Winget.MSStore.Source_8wekyb3d8bbwe, ID = IndexDB
    2021-09-14 05:46:48.757 [CORE] Found matching extension.
    2021-09-14 05:46:48.760 [REPO] Remote source data was not newer than existing, no update needed
    2021-09-14 05:46:48.771 [CORE] Examining extension: PFN = Microsoft.Winget.MSStore.Source_8wekyb3d8bbwe, ID = IndexDB
    2021-09-14 05:46:48.771 [CORE] Found matching extension.
    2021-09-14 05:46:48.785 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.MSStore.Source_2021.328.455.669_neutral__8wekyb3d8bbwe\Public\index.db'
    2021-09-14 05:46:48.785 [SQL ] Opening SQLite connection: 'file:/C:/Program Files/WindowsApps/Microsoft.Winget.MSStore.Source_2021.328.455.669_neutral__8wekyb3d8bbwe/Public/index.db?immutable=1' [1, 40]
    2021-09-14 05:46:48.787 [REPO] Opened SQLite Index with version [1.2], last write [2021-03-27 22:55:28.000]
    2021-09-14 05:46:48.813 [REPO] Adding to aggregated source: newstore
    2021-09-14 05:46:48.813 [REPO] Source past auto update time [5 mins]; it has been at least 3006 mins
    2021-09-14 05:46:49.073 [CORE] Setting action: Set, Type: Standard, Name: sources_metadata
    2021-09-14 05:46:49.074 [REPO] Creating PredefinedInstalledSource with filter [None]
    2021-09-14 05:46:49.074 [REPO] Creating new SQLite Index [4294967295.4294967295] at ':memory:'
    2021-09-14 05:46:49.074 [SQL ] Opening SQLite connection: ':memory:' [6, 0]
    2021-09-14 05:46:49.103 [REPO] Examining ARP entries for Machine | X64
    2021-09-14 05:46:49.118 [REPO] Examining ARP entries for Machine | X86
    2021-09-14 05:46:49.130 [REPO] Examining ARP entries for User | X64
    2021-09-14 05:46:49.379 [FAIL] E:\BA\98\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\Schema\1_0\Interface_1_0.cpp(184)\AppInstallerCLI.exe!00007FF62BA00B45: (caller: 00007FF62B9FCD33) Exception(1) tid(4ee8) 800700B7 Cannot create a file when that file already exists.
    
    
    2021-09-14 05:46:49.467 [CLI ] Caught wil::ResultException: E:\BA\98\s\external\pkg\src\AppInstallerRepositoryCore\Microsoft\Schema\1_0\Interface_1_0.cpp(184)\AppInstallerCLI.exe!00007FF62BA00B45: (caller: 00007FF62B9FCD33) Exception(1) tid(4ee8) 800700B7 Cannot create a file when that file already exists.
    

    💾 WinGet-2021-09-14-05-46-45.584.log
    💾 WinGet-2021-09-16-00-13-39.031.log

  7. Echo64 commented on Sep 19, 2021

    @Echo64

    Update: This issue resolved itself once I upgraded to v1.0.12576

  8. joshieecs commented on Sep 19, 2021

    @joshieecs

    The issue is also resolved for me with v1.0.12576
    thanks fam

  9. DiegoMagdaleno commented on Sep 20, 2021

    @DiegoMagdaleno

    Can confirm this issue is fixed with v1.0.12576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-Bug

Type

No type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions