qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.42k stars 4k forks source link

qbittorent failed to listen on selected port 2024 (windows edgecase, workaround available) #20317

Open igor-hara opened 10 months ago

igor-hara commented 10 months ago

qBittorrent & operating system versions

So I've recently installed Portmaster everything is enabled for connections

Windows 11 Pro v: 22H2 (10.0.22621)

What is the problem?

qbittorent failed to listen on selected ort 2024

qBittorent won't download torrents anymore, cuz it can't connect on selected port. I've noticed in previous versions that after restart or wake up window torrenting i.e. download won't start automaticly but I had to change ports

Steps to reproduce

  1. Turn on the windows
  2. Open qBittorent
  3. Torrents doesn't download automaticly
  4. Change new port (Random btn) -> Ok or Apply
  5. remove old torrents and download new ones
  6. Change port again
  7. Resume or Force Resume
  8. Nothing changes

Additional context

No response

Log(s) & preferences file(s)

No response

xavier2k6 commented 5 months ago

@igor-hara you did not specify what version of qBittorent you were using, please update to qBittorrent 4.6.5 & if you can reproduce - please provide logs/settings etc.

If you can't reproduce or the issue has been resolved in the meantime - feel free to close this ticket.

xavier2k6 commented 3 months ago

@luzpaz don't apply any Stale labels to tickets, this is currently limited to PR's.

Saya47 commented 2 months ago

This happened to me once, I rebooted my system and the issue was gone. Now it's back and I keep restarting but to no avail. I Updated to 4.6.6 and still happens. Weird that all a suddent this happens out of nowhere, I changed nothing on my end.

27-Aug-24 21:08 - Failed to listen on IP. IP: "192.168.1.150". Port: "UDP/52541". Reason: "An attempt was made to access a socket in a way forbidden by its access permissions"

I have also tried different ports too. @xavier2k6

Saya47 commented 2 months ago

OK I didn't think this would be related but this actually worked:

net stop hns net start hns

https://stackoverflow.com/questions/10461257/an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissi

Saya47 commented 2 months ago

Another thing I could add is this time it happened after my power went out, last time it was a BSOD, so Windows goes crazy, I don't think this is related to qBittorrent at all.

luzpaz commented 2 months ago

This is such a weird edgecase

xavier2k6 commented 2 months ago

Another thing I could add is this time it happened after my power went out, last time it was a BSOD, so Windows goes crazy, I don't think this is related to qBittorrent at all.

Please provide more details of OS, if you are using a VPN etc.

Maybe you need to run sfc /scannow in an elevated command prompt..

Saya47 commented 2 months ago

Another thing I could add is this time it happened after my power went out, last time it was a BSOD, so Windows goes crazy, I don't think this is related to qBittorrent at all.

Please provide more details of OS, if you are using a VPN etc.

Maybe you need to run sfc /scannow in an elevated command prompt..

Winver: image

SFC: image

I do not use any VPN, I have proxy (V2Ray) always running on my machine but I have configured qBittorrent to never use it, but now that you mention it I did check for my port being occupied by other programs, and when qBittorrent was showing the red globe icon (qBittorrent failed to listen on... error) I checked and this is the only thing I saw:

netstat -ano | findstr ":52541" TCP 127.0.0.1:52541 127.0.0.1:10808 TIME_WAIT 0

I don't know what this means but qBittorrent does not listen on localhost, it listens on LAN IP, and 127.0.0.1:10808 is my proxy (V2Ray) so what program was listening on this port and was trying to access my proxy? I do not know, but I kept checking and the entry was gone from netstat but qBittorrent still couldn't listen on the port. hmm.. this is all weird to me, but these are just my observations that I wanted to share.