Service failed to bind to port

Questions and answers on how to get the most out of FFAStrans
lue3099
Posts: 15
Joined: Fri Oct 07, 2022 2:29 am

Service failed to bind to port

Post by lue3099 »

Hello,

I am currently having an issue with the service starting.

I am getting:

Code: Select all

Windows could not start the FFASTrans REST-API Service
service on Local Computer.

Error 1067: The process terminated unexpectedly.
Looking at the log at C:\ProgramData\FFAStrans\Processors\resources\ffastrans_service.out.log
I get: "<timeOfError> API server fail to be created at 'http://desktop-pfkmt5m:65445/api/v2'. Please check for other applications using the same port."

What weird about this is that running:
netstat -ano | findstr :65445

Finds nothing using that port.

I have uninstalled and reinstalled the service. Deleted the folder at "C:\ProgramData\FFAStrans" (After uninstalling).
And made sure there was not residual enteries in registry at "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ffastrans_service"
Installed again to no avail. Multiple system reboots as well.

How can I get this service to start?

Regards,
Lue.
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Service failed to bind to port

Post by emcodem »

Morning Lue,

Welcome to the Forum and thank you for using FFAStrans!

interesting, my first thought here is "antivirus":D
Does the API work when you start it as local application?
emcodem, wrapping since 2009 you got the rhyme?
lue3099
Posts: 15
Joined: Fri Oct 07, 2022 2:29 am

Re: Service failed to bind to port

Post by lue3099 »

Hey emcodem.

I dont run a 3rd part AV just windows defender.
I disabled it, but it did change anything. Same error.

Yeh the local application also doesnt show webui/api.

However I have possibly found the issue.

Its getting the wrong interface IP in options -> configuration -> host. Its picking up my virtual box windows adapter.
Is there away to define the interface that it listens on?
I edited the FFAStrans1-3-0-2\Processors\db\configs\hosts\DESKTOP-PFKMT5M.json file and changed the IP but as soon as I run the application/workflow editor it changes it back to one of my other IP on another adapter.

hmm
lue3099
Posts: 15
Joined: Fri Oct 07, 2022 2:29 am

Re: Service failed to bind to port

Post by lue3099 »

I disabled all the other interfaces and its now getting a normal network IP. (Not a vethernet or a tap device.)
but it still isn't able to bind to port. Both service and as an application
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Service failed to bind to port

Post by emcodem »

It listens on all interfaces 0.0.0.0 (as usually for such operations), no option to define a special one. The IP it displays in the hosts .json is not really connected to the problem. As a shot in the dark, maybe you can try to disable ipv6...
Wait, i'll try to come up with a test program for you
emcodem, wrapping since 2009 you got the rhyme?
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Service failed to bind to port

Post by emcodem »

So here a simple tester that uses the same listening functionality as the rest-service.exe.
testlisten.exe.txt
(1018.5 KiB) Downloaded 144 times
Verify that it does NOT work like this:

Code: Select all

C:\dev\testlisten.exe "0.0.0.0" 65445
You should get a msgbox with some error msg (post the msg pls).

After that, you can try each and every ip address your machine has in ipconfig /all and check if one of the interfaces is the guilty one.

EDIT:
One more thing:
by asking "does it work as application", i mean that you have to uninstall the serivce and tick the box "run as application" in the configuration menu. After that, check again netstat or try calling api page. We need to make sure that user permissions are not guilty here, even if i assume that you tried starting the service as "SYSTEM" user who should have all permissions to listen on 0.0.0.0
emcodem, wrapping since 2009 you got the rhyme?
lue3099
Posts: 15
Joined: Fri Oct 07, 2022 2:29 am

Re: Service failed to bind to port

Post by lue3099 »

Hey Emcodem,

Sorry for the delay. Its started working and then it broke again. Not suire what made it work either which is the fustrating part...
I tried uninstalling the service and clicking "Run as application" but the web api still doesn't work.

That testlisten.exe also presents an error:
testlisten.png
testlisten.png (28.2 KiB) Viewed 2676 times
I made sure ffastrans service and application was shutdown before running it.

This is probably a specific issue to my windows install. Some edge case.

Any suggestions?

Regards,
lue3099
Posts: 15
Joined: Fri Oct 07, 2022 2:29 am

Re: Service failed to bind to port

Post by lue3099 »

An Update...

Its definitly not a ffastrans issue, probably just a windows bug. Some geezers over at googleworkspace github found a stop gap solution.

Restarting the "Host Network Services" releases the port. Even though "netstat -ano | findstr :65445" doesn't show anything.

Code: Select all

net stop hns; net start hns
Regards,
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Service failed to bind to port

Post by emcodem »

Interesting, what Windows Version are you running?
emcodem, wrapping since 2009 you got the rhyme?
lue3099
Posts: 15
Joined: Fri Oct 07, 2022 2:29 am

Re: Service failed to bind to port

Post by lue3099 »

The system is:
Edition Windows 10 Pro
Version 21H2
OS build 19044.2075
Experience Windows Feature Experience Pack 120.2212.4180.0
Post Reply