{"record":{"id":"da1e7ebdd248e7ce","repo":"Devolutions/UniGetUI","slug":"task-getinstalledpackages-for-manager-manager-na","errorCode":null,"errorMessage":"Task _getInstalledPackages for manager {Manager.Name} did not finish after {PackageListingTaskTimeout} seconds, aborting.  You may disable timeouts from UniGetUI Advanced Settings","messagePattern":"Task _getInstalledPackages 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/Helpers/BaseSourceHelper.cs","lineNumber":95,"sourceCode":"        /// <summary>\n        /// Loads the sources for the manager. This method SHOULD NOT handle exceptions\n        /// </summary>\n        protected abstract IReadOnlyList<IManagerSource> GetSources_UnSafe();\n\n        public virtual IReadOnlyList<IManagerSource> GetSources() =>\n            TaskRecycler<IReadOnlyList<IManagerSource>>.RunOrAttach(_getSources, 15);\n\n        public virtual IReadOnlyList<IManagerSource> _getSources()\n        {\n            try\n            {\n                var task = Task.Run(GetSources_UnSafe);\n                if (!task.Wait(TimeSpan.FromSeconds(PackageListingTaskTimeout)))\n                {\n                    if (!Settings.Get(Settings.K.DisableTimeoutOnPackageListingTasks))\n                    {\n                        CoreTools.FinalizeDangerousTask(task);\n                        throw new TimeoutException(\n                            $\"Task _getInstalledPackages for manager {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                var sources = task.Result;\n                Factory.Reset();\n\n                foreach (IManagerSource source in sources)\n                {\n                    Factory.AddSource(source);\n                }\n\n                Logger.Debug($\"Loaded {sources.Count} sources for manager {Manager.Name}\");","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/Helpers/BaseSourceHelper.cs#L77-L113","documentation":"BaseSourceHelper._getSources runs each package manager's GetSources_UnSafe on a background Task under a hard 60-second ceiling (PackageListingTaskTimeout = 60). When the underlying CLI (e.g. `winget source list`, `scoop bucket list`, `choco source`) does not return in time, UniGetUI finalizes the 'dangerous task' and throws TimeoutException. The whole body is wrapped in try/catch that logs the error and returns an empty source list, so the visible symptom is a manager reporting no sources rather than a propagated throw. NOTE: the message text is a copy-paste bug — it says '_getInstalledPackages' but the method is '_getSources'.","triggerScenarios":"Calling BaseSourceHelper.GetSources() -> TaskRecycler.RunOrAttach(_getSources) -> _getSources -> Task.Run(GetSources_UnSafe), where GetSources_UnSafe spawns a manager CLI that has not exited within 60 s, AND Settings.K.DisableTimeoutOnPackageListingTasks is OFF. The throw only fires on that exact timeout path; with the setting ON, task.Wait() blocks indefinitely instead.","commonSituations":"Corporate proxy / captive portal blocking the package manager's source-list endpoint; an elevation (UAC/gsudo) prompt for adding/listing sources left unanswered; antivirus holding the spawned process; a slow first-run index rebuild; a flaky VPN dropping the connection mid-list. Often coincides with error 101 for the same manager.","solutions":["Enable the UniGetUI Advanced Setting 'Disable timeouts on package listing tasks' (Settings.K.DisableTimeoutOnPackageListingTasks) so the wait becomes unbounded.","Run the manager CLI directly and time it outside UniGetUI (`winget source list`, `scoop bucket list`, `choco source -r`) to confirm it is the slow step.","Check proxy configuration, VPN/captive-portal state, and any pending UAC/gsudo prompt that the source-listing subprocess may be blocked on.","Inspect UniGetUI logs (Logger.Error 'Error finding sources for manager <Name>') for the TimeoutException and the copy-paste text '_getInstalledPackages' to confirm it is this code path.","Fix the message text in BaseSourceHelper.cs:96 from '_getInstalledPackages' to '_getSources' so diagnostics identify the correct task."],"exampleFix":"// before (BaseSourceHelper.cs:95-99)\nthrow new TimeoutException(\n    $\"Task _getInstalledPackages for manager {Manager.Name} did not finish after \"\n        + $\"{PackageListingTaskTimeout} seconds, aborting.  You may disable \"\n        + $\"timeouts from UniGetUI Advanced Settings\"\n);\n\n// after\nthrow new TimeoutException(\n    $\"Task _getSources for manager {Manager.Name} did not finish after \"\n        + $\"{PackageListingTaskTimeout} seconds, aborting.  You may disable \"\n        + $\"timeouts from UniGetUI Advanced Settings\"\n);","handlingStrategy":"fallback","validationCode":"// Before calling GetSources(), confirm the manager is usable so the 60s\n// timeout is not wasted on a disabled or network-bound manager.\nif (!manager.IsReady())\n    return Array.Empty<IManagerSource>();\n\nif (!Settings.Get(Settings.K.DisableTimeoutOnPackageListingTasks)\n     && !await NetworkIsAvailableAsync())\n{\n    Logger.Warn($\"Skipping source listing for {manager.Name}: no network\");\n    return Array.Empty<IManagerSource>();\n}","typeGuard":null,"tryCatchPattern":"// GetSources() already swallows the TimeoutException and returns [].\n// Only the *_Unsafe/protected path can throw, so guard there:\ntry\n{\n    IReadOnlyList<IManagerSource> sources = manager.SourceHelper.GetSources();\n    if (sources.Count == 0)\n        Logger.Warn($\"{manager.Name} reported no sources (likely timed out)\");\n}\ncatch (TimeoutException ex)\n{\n    Logger.Error($\"Source listing for {manager.Name} timed out: {ex.Message}\");\n}","preventionTips":["Treat an empty source list as a soft failure and surface a 'sources unavailable' notice, not an error dialog.","Keep DisableTimeoutOnPackageListingTasks OFF in normal use so a hung CLI cannot freeze the UI.","Verify the manager CLI (`winget source list` / `scoop bucket list` / `choco source`) returns in well under 60 s before relying on it.","When adding a new manager, override GetSources_UnSafe to be fast and register spawned processes so they can be killed cleanly."],"tags":["timeout","package-manager","sources","cli","network"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}