lithnet / access-manager

Access Manager provides web-based access to local admin (LAPS) passwords, BitLocker recovery keys, and just-in-time administrative access to Windows computers in a modern, secure, and user-friendly way.
Other
238 stars 20 forks source link

IP/Port conflicts not gracefully handled during setup/installation/usage #178

Closed PrzemyslawKlys closed 1 year ago

PrzemyslawKlys commented 1 year ago

Describe the bug It seems that if there is an IP/Port conflict between AM and other software, it's not gracefully handled.

We found it the hard way where the app would no longer work properly, and it was hard to "find" the issue as the logs aren't clear that it's about IP/PORT conflict.

image

In our case, McAfee is using the 8081 and 8082 ports. PID 2924 is related to macmnsvc.exe. Updated the ports in Lithnet manager and registry path. After saving the config service able to start.

To Reproduce Steps to reproduce the behavior:

Set AM to conflict PORT with another application

Expected behavior A clear and concise description of what you expected to happen.

APP will no longer work

Screenshots If applicable, add screenshots to help explain your problem.

Access Manager installation

Logs

Error:

Log Name:      Application

Source:        .NET Runtime

Date:          9/27/2022 9:46:18 AM

Event ID:      1026

Task Category: None

Level:         Error

Keywords:      Classic

User:          N/A

Computer:     JP.local

Description:

Application: Lithnet.AccessManager.Service.exe

CoreCLR Version: 4.700.20.51601

.NET Core Version: 3.1.10

Description: The process was terminated due to an unhandled exception.

Exception Info: Microsoft.AspNetCore.Server.HttpSys.HttpSysException (32): The process cannot access the file because it is being used by another process.

   at Microsoft.AspNetCore.Server.HttpSys.UrlGroup.RegisterPrefix(String uriPrefix, Int32 contextId)

   at Microsoft.AspNetCore.Server.HttpSys.UrlPrefixCollection.RegisterAllPrefixes(UrlGroup urlGroup)

   at Microsoft.AspNetCore.Server.HttpSys.HttpSysListener.Start()

   at Microsoft.AspNetCore.Server.HttpSys.MessagePump.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)

   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)

   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)

   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)

   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)

   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)

   at Lithnet.AccessManager.Service.Program.Main(String[] args) in D:\dev\git\lithnet\access-manager\src\Lithnet.AccessManager\Lithnet.AccessManager.Service\Program.cs:line 28

-----------------------------------------------------------------------------------------
Log Name:      Application

Source:        Application Error

Date:          9/27/2022 9:46:21 AM

Event ID:      1000

Task Category: (100)

Level:         Error

Keywords:      Classic

User:          N/A

Computer:      JP.local

Description:

Faulting application name: Lithnet.AccessManager.Service.exe, version: 1.0.7925.0, time stamp: 0x604fdc3f

Faulting module name: KERNELBASE.dll, version: 10.0.17763.3287, time stamp: 0x2637e772

Exception code: 0xe0434352

Fault offset: 0x0000000000039319

Faulting process id: 0x20

Faulting application start time: 0x01d8d255ee8fbb73

Faulting application path: C:\Program Files\Lithnet\Access Manager Service\Lithnet.AccessManager.Service.exe

Faulting module path: C:\Windows\System32\KERNELBASE.dll

Report Id: ef728fb5-9925-4926-95b3-9d3af91797be

Faulting package full name:

Faulting package-relative application ID:
ryannewington commented 1 year ago

@PrzemyslawKlys We agree the error message is pretty terrible - it's coming from a built-in asp.net component. We've wrapped the error message in v2 and added some additional helper text.

PrzemyslawKlys commented 1 year ago

@ryannewington any workaround to install AM if the ports are taken for v1? Currently facing an issue where we can't install AM because antivirus took over the ports. While changing it in the registry works, if the antivirus is already installed that doesn't work.