marticliment / UniGetUI

UniGetUI: The Graphical Interface for your package managers. Could be terribly described as a package manager manager to manage your package managers
https://www.marticliment.com/unigetui/
MIT License
10.51k stars 343 forks source link

[BUG] API "Nancy self host was unable to start" error in logs #2378

Open redactedscribe opened 2 weeks ago

redactedscribe commented 2 weeks ago

Please confirm these before moving forward

UniGetUI Version

3.1.0 beta 1

Windows version, edition and architecture

Windows 11 Pro

Describe your issue

Not sure what this means, but maybe it should be brought to your attention. See the logs.

Steps to reproduce the issue

-

UniGetUI Log

...
[01/07/2024 17:22:29] Randomly-generated background API auth token for the current session: 206m3w9k0dnbfubg38gwfovrf4q28uply2ti6v9p0013tfhd61v6a645wdx3cpdm
[01/07/2024 17:22:29] An error occurred while initializing the API
[01/07/2024 17:22:29] Nancy.Hosting.Self.AutomaticUrlReservationCreationFailureException: The Nancy self host was unable to start, as no namespace reservation existed for the provided url(s).

                      Please either enable UrlReservations.CreateAutomatically on the HostConfiguration provided to 
                      the NancyHost, or create the reservations manually with the (elevated) command(s):

                      netsh http add urlacl url="http://+:7058/" user="Everyone"

                         at Nancy.Hosting.Self.NancyHost.StartListener()
                         at Nancy.Hosting.Self.NancyHost.Start()
                         at UniGetUI.Interface.BackgroundApiRunner.Start() in C:\SomePrograms\WingetUI-Store\src\UniGetUI.Interface.BackgroundApi\BackgroundApi.cs:line 73
...

Package Managers Logs

\-

Relevant information

No response

Screenshots and videos

No response

marticliment commented 2 weeks ago

Are you running 2 or more parallel instances of UniGetUI?

redactedscribe commented 2 weeks ago

I just ended the only process of WingetUI.exe (and looked for any mentions of UniGetUI) and launched the program again. Still the error occurs.

marticliment commented 2 weeks ago

Do you know if you use any program that uses the port 7058? Can you check if your firewall is blocking localhost:7058

redactedscribe commented 2 weeks ago

My firewall does not block any localhost I believe.

I just checked and I do see a local port in use for 7058 bound to ensserver.exe (EaseUS backup software). I ended that process and restarted UniGetUI. Unfortunately the log error remains.

Maybe this is an elevation issue again? "you can run nancy as a user - config.urlreservations.user = username". Or perhaps this is related to using a VPN (self-host things sometimes don't work without specifically configuring / allowing them)?

Not sure what Nancy is used for but UniGetUI appears to work fine despite the error.

marticliment commented 2 weeks ago

Nancy is used for "Widgets for UniGetUI" and the "Share Packages" feature, UniGetUI should be able to work without it (in fact, it can be disabled from the settings).

If it is only localhost there should be no need to reserve the port, but perhaps EaseUS software already has this port reserved for itself

redactedscribe commented 2 weeks ago

I was looking and looking and couldn't find it. If anyone else is wondering, it's here:

WingetUI_2024-07-01_20-46-16

"Widgets for UniGetUI" is for use with Dev Home (another software).

I will probably just disable this feature. Thanks for your help.

Edit: Disabled. No more error. Not exactly a solution, but good enough for my purposes.