{"record":{"id":"577a970149a3609e","repo":"Devolutions/UniGetUI","slug":"task-taskname-for-manager-name-did-not-finish","errorCode":null,"errorMessage":"Task {taskName} for manager {Name} did not finish after {PackageListingTaskTimeout} seconds, aborting.  You may disable timeouts from UniGetUI Advanced Settings","messagePattern":"Task (.+?) for manager (.+?) did not finish after (.+?) seconds, aborting\\.  You may disable timeouts from UniGetUI Advanced Settings","errorType":"exception","errorClass":"TimeoutException","httpStatus":null,"severity":"warning","filePath":"src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs","lineNumber":315,"sourceCode":"                }\n        }\n\n        private T RunListingTaskWithTimeout<T>(Func<T> method, string taskName)\n        {\n            List<Process> processes = [];\n            var task = Task.Run(() =>\n            {\n                _listingProcesses.Value = processes;\n                return method();\n            });\n\n            if (!task.Wait(TimeSpan.FromSeconds(PackageListingTaskTimeout)))\n            {\n                if (!Settings.Get(Settings.K.DisableTimeoutOnPackageListingTasks))\n                {\n                    KillListingProcesses(processes);\n                    CoreTools.FinalizeDangerousTask(task);\n                    throw new TimeoutException(\n                        $\"Task {taskName} for manager {Name} did not finish after \"\n                            + $\"{PackageListingTaskTimeout} seconds, aborting.  You may disable \"\n                            + $\"timeouts from UniGetUI Advanced Settings\"\n                    );\n                }\n\n                task.Wait();\n            }\n\n            return task.GetAwaiter().GetResult();\n        }\n\n        /// <summary>\n        /// Returns an array of Package objects that the manager lists for the given query. Depending on the manager, the list may\n        /// also include similar results. This method is fail-safe and will return an empty array if an error occurs.\n        /// </summary>\n        public IReadOnlyList<IPackage> FindPackages(string query) => _findPackages(query, false);\n","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs#L297-L333","documentation":"PackageManager.RunListingTaskWithTimeout is the generic timeout guard for every package-listing task (FindPackages, GetAvailableUpdates, GetInstalledPackages). It runs the manager's *_Unsafe method on a background Task, kills any registered listing subprocesses via KillListingProcesses on expiry, finalizes the dangerous task, and throws TimeoutException with the given taskName. PackageListingTaskTimeout is a hard 60 s. The three public callers catch the exception, unwrap AggregateException, and either retry once via AttemptFastRepair() (when RetryListingTasksOnTimeout is true, the default) or return an empty list on the second attempt. Chocolatey overrides RetryListingTasksOnTimeout to false, so it surfaces as an immediate empty result.","triggerScenarios":"Any of FindPackages(query), GetAvailableUpdates(), or GetInstalledPackages() whose *_Unsafe implementation spawns a manager CLI that does not finish within 60 s while Settings.K.DisableTimeoutOnPackageListingTasks is OFF. Concretely the timeout path fires inside RunListingTaskWithTimeout at line 315; the taskName is one of '_findPackages', '_getAvailableUpdates', '_getInstalledPackages'.","commonSituations":"WinGet/Scoop/Choco index refresh stalling on a metered or proxied network; a listing subprocess stuck on a UAC/elevation prompt; GetAvailableUpdates hitting a fresh `RefreshPackageIndexes` whose own 60 s Wait (line 390-391) already elapsed; very large installed-package sets on slow disks; antivirus injecting latency. Chocolatey specifically will not retry, so a single slow run yields empty results.","solutions":["Enable 'Disable timeouts on package listing tasks' (Settings.K.DisableTimeoutOnPackageListingTasks) in Advanced Settings if listing legitimately takes longer than 60 s.","Run the equivalent CLI manually and time it (e.g. `winget list`, `winget upgrade`, `scoop export`, `choco outdated`) to isolate whether the manager or UniGetUI is the bottleneck.","For Chocolatey specifically, note RetryListingTasksOnTimeout is false — a single timeout yields empty results, so stabilizing the environment (network/proxy/UAC) matters more than for other managers.","If you control the manager integration, override RetryListingTasksOnTimeout => true and RegisterListingProcess(...) so KillListingProcesses can actually terminate hung children on timeout.","Check UniGetUI logs for the TimeoutException line and the preceding AttemptFastRepair warning to see whether the single retry already occurred."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Cheap pre-checks before invoking a listing API that would burn a 60s slot.\nif (!manager.IsReady())\n    return Array.Empty<IPackage>();\n\nif (!Settings.Get(Settings.K.DisableTimeoutOnPackageListingTasks)\n     && !await NetworkIsAvailableAsync()\n     && queryRequiresNetwork(manager))\n{\n    return Array.Empty<IPackage>();\n}","typeGuard":null,"tryCatchPattern":"// Public APIs (FindPackages/GetInstalledPackages/GetAvailableUpdates) are\n// fail-safe and return [] on timeout after one AttemptFastRepair retry.\n// If you call RunListingTaskWithTimeout directly (protected/derived), wrap it:\ntry\n{\n    var packages = RunListingTaskWithTimeout(() => GetInstalledPackages_UnSafe(), \"_getInstalledPackages\");\n}\ncatch (TimeoutException ex) when (!Settings.Get(Settings.K.DisableTimeoutOnPackageListingTasks))\n{\n    Logger.Warn($\"Listing timed out for {Name}: {ex.Message}\");\n    return Array.Empty<IPackage>();\n}","preventionTips":["Rely on the fail-safe public APIs; they retry once via AttemptFastRepair and return [] rather than throwing.","Remember Chocolatey (RetryListingTasksOnTimeout == false) does NOT retry — stabilize its environment.","Call RegisterListingProcess in any *_Unsafe override so KillListingProcesses can actually terminate hung children on timeout.","Set DisableTimeoutOnPackageListingTasks only when listing legitimately exceeds 60 s; otherwise it converts a hung manager into an indefinite UI freeze."],"tags":["timeout","package-manager","cli","network","retry"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}