gdavej
2021-09-15T08:45:25Z
Today, I had a problem running SkyElite, it gave me an error "SkyElite Server not running! SkyEite will be closed". This error is presumably caused by the port 7667 not being available. I'll attach the relevant portion of the log below. This is the first time, I've experienced this issue, despite running SkyElite every single time I run MSFS, which for months, has been practically daily. I have seen a similar error message with the MSFS Mobile Companion App, which uses the hard-coded port 5000, in that case, I was able to edit the Python code to use a different port, which worked fine. Obviously this hack is not possible with SkyElite, but is there a way that the port can be modified through some configuration file? It seems clear that some process on my laptop is grabbing a port that should be free, I've searched for this process, but so far, it has eluded me. Can you suggest how I can discover this offending process?

2021-09-15 15:18:05:6755 [INFO]: Listening on URL http://*:7667
2021-09-15 15:18:05:6914 [INFO]: SkyConnector created
2021-09-15 15:18:06:0065 [INFO]: SkyConnector started
2021-09-15 15:18:06:0225 [INFO]: SkyConnector StartSimConnectThread
2021-09-15 15:18:06:0385 [INFO]: Starting host...
2021/09/15 15:18:06:4814 [INFO]: Unable to connect to the simulator
2021/09/15 15:18:06:5915 [ERROR]: [Main BuildWebHost Exception]: An attempt was made to access a socket in a way forbidden by its access permissions.
Aviator
2021-09-15T09:37:15Z
Hello,

Lets go step by step please.

I can see lately that windows is blocking some ports and this was not happening that often before.

I had the same problem affecting to several apps and, in my case the problem was caused by Microsoft Hyper-V machine.

Do you have Microsoft Hyper-V installed in your system or did you install any recently software that could be affecting to this?

Next steps fixed the issue in my machine ... if you have Hyper-V installed:

1. Disable hyper-v (which will required a couple of restarts)
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V

2. When you finish all the required restarts, reserve the port you want so hyper-v doesn't reserve it back
netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1

3. Re-Enable hyper-V (which will require a couple of restart)
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

This command: netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1
Allows to "somehow" reserve ports used by your application, so they will be not forbidden anymore. But it has to be executed with the application or service which is causing the issue, stopped.

So steps 1 and 3 are an example for Hyper-V but if there is other service causing the issue just stop that service, execute step 2 and then re-start the service.

Please, be aware that none of above issues are caused by SkyElite, its just Microsoft driving us crazy, but unfortunately there is no easy way to discover it.

Thanks.
gdavej
2021-09-15T11:33:05Z
Originally Posted by: Aviator 



Do you have Microsoft Hyper-V installed in your system or did you install any recently software that could be affecting to this?

Please, be aware that none of above issues are caused by SkyElite, its just Microsoft driving us crazy, but unfortunately there is no easy way to discover it.



It looks like I don't have Hyper-V installed, I assume you mean the app in the Windows Features window? Do you know what commands I can use to try to isolate the culprit? I am pretty sure though that this will not be a constant problem just an occasional irritant, The MSFS Mobile Companion App, that I mentioned earlier, uses the hard coded port 5000 and most times I get the same error when I try to use it; so I have an alternate version that uses port 6001, most times that works, but occasionally that port too has been stolen by some process.

Of course, this issue is caused by pesky little Windows, certainly not SkyElite, which personally I think is a great app.

Aviator
2021-09-15T11:51:25Z
Hello,

Please try to execute next command opening a command line window in administrator mode:

netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1

After it, reboot the computer and try SkyElite again, if it doesn't fix it we'll try some other thing.

Thanks.
gdavej
2021-09-15T13:56:38Z
Originally Posted by: Aviator 

Hello,

Please try to execute next command opening a command line window in administrator mode:

netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1

After it, reboot the computer and try SkyElite again, if it doesn't fix it we'll try some other thing.

Thanks.



I tried that command, but no luck, I get an error...

C:\WINDOWS\system32>netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1
The process cannot access the file because it is being used by another process.


I tried to find the process using netstat -a -n -o | find "7667" but this didn't return anything. I also tried running CurrPorts, again nothing.

Aviator
2021-09-15T14:13:38Z
Try to use this command in Windows Poweshell console please:

Get-Process -Id (Get-NetTCPConnection -LocalPort 7667).OwningProcess

Let me know what it shows
gdavej
2021-09-15T14:24:14Z
Originally Posted by: Aviator 

Try to use this command in Windows Poweshell console please:

Get-Process -Id (Get-NetTCPConnection -LocalPort 7667).OwningProcess

Let me know what it shows



Not familiar with this command, or powershell. I just entered the command exactly as you entered...

PS C:\WINDOWS\system32> Get-Process -Id (Get-NetTCPConnection -LocalPort 7667).OwningProcess
>>
Get-NetTCPConnection : No MSFT_NetTCPConnection objects found with property 'LocalPort' equal to '7667'. Verify the
value of the property and retry.
At line:1 char:18
+ Get-Process -Id (Get-NetTCPConnection -LocalPort 7667).OwningProcess
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (7667:UInt16) [Get-NetTCPConnection], CimJobException
+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_LocalPort,Get-NetTCPConnection

Get-Process : Cannot bind argument to parameter 'Id' because it is null.
At line:1 char:17
+ Get-Process -Id (Get-NetTCPConnection -LocalPort 7667).OwningProcess
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-Process], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetProcessC
ommand
Aviator
2021-09-15T14:47:10Z
Hello,

Unfortunately unless you stop the service which is blocking the port you wont be able to reserve the port with the command I sent.

Try to reboot windows in safe mode:
https://support.microsof...9-8644-1ce4-b3e5e56fe234 

And then exclude the port:
netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1

Not sure if you will be able to do this in safe mode, but worth to try.

There is a way to change SkyElite port, by editing this file: "..\SkyElite for MFS2020\Server\appsettings.json"
And then change only the server section.

But I have to warn that this could cause issues later in future updates, So I think is better to try to fix the original port before changing it in SkyElite.

Thanks.
gdavej
2021-09-16T03:54:49Z
Originally Posted by: Aviator 

Hello,

Unfortunately unless you stop the service which is blocking the port you wont be able to reserve the port with the command I sent.

Try to reboot windows in safe mode:
https://support.microsof...9-8644-1ce4-b3e5e56fe234 

And then exclude the port:
netsh int ipv4 add excludedportrange protocol=tcp startport=7667 numberofports=1

Not sure if you will be able to do this in safe mode, but worth to try.

There is a way to change SkyElite port, by editing this file: "..\SkyElite for MFS2020\Server\appsettings.json"
And then change only the server section.

But I have to warn that this could cause issues later in future updates, So I think is better to try to fix the original port before changing it in SkyElite.

Thanks.



As I anticipated, as soon as I shutdown, and restart, the problem with SkyElite starting goes away. Since this has only been a problem once in the 6-7 months I've been running SkyElite, I think the best solution is to keep the server change via the json edit as a backup if the problem happens again.

I want to thank you for all your help, and your speedy responses. I consider SkyElite an essential tool to supplement my flights in MSFS, hence my frustration yesterday when it failed to start.