qbittorrent / qBittorrent

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

V5.0.0 WebUI can't bind to port 8080 (Windows 10) #21473

Open ssmith131 opened 1 month ago

ssmith131 commented 1 month ago

qBittorrent & operating system versions

qBittorrent: 5.0.0 x64 Operating system: Windows 10 Pro 10.0.19045 (Feature update 22H2) Qt: 6.7.3 Libtorrent: 1.2.19.0 Boost: 1.86.0 OpenSSL: 3.3.2 zlib: 1.3.1

What is the problem?

Upgraded from v4.6.7 (64 bit on Windows 10) to v5.0.0 (64 bit on Windows 10) and noticed the WebUI was working. Going into the WebUI settings, it lists the error: WebUI configuration failed. Reason: Unable to bind to IP: 192.168.0.*, port 8080. Reason: Unknown error. I confirmed nothing is listening on port 8080 and I get the same error with different ports. WebUI issue - Screenshot 2024-10-01 145012

Steps to reproduce

  1. Start qBittorrent v5.0.0 (64 bit) on Windows 10
  2. Click on settings (gear icon)
  3. Select WebUI
  4. Error is displayed above the IP address and port settings

Additional context

WebUI issue - Screenshot 2024-10-01 145012

Log(s) & preferences file(s)

qbittorrent WebUI issue.log

HanabishiRecca commented 1 month ago

WebUI configuration failed. Reason: Unable to bind to IP: 192.168.0.*, port 8080. Reason: Unknown error.

It has nothing to do with the port. The listening address should be a concrete IP. No wildcards are allowed here.

googie-g15 commented 1 month ago

Same issue for me, except with localhost:8765. I tried changing it to 0.0.0.0:8765 since the tooltip specifies that as an acceptable option but it still failed with the same error. I've also checked to see if something else was occupying port 8765 but there's nothing there.

HanabishiRecca commented 1 month ago

0:0:0:0

You mean 0.0.0.0?

googie-g15 commented 1 month ago

0:0:0:0

You mean 0.0.0.0?

oops, yeah I fixed the comment, thanks

HanabishiRecca commented 1 month ago

Post the log please.

googie-g15 commented 1 month ago

Last portions of the log read as follows:

(I) 2024-10-07T10:37:44 - IP geolocation database loaded. Type: DBIP-Country-Lite. Build time: Mon Sep 30 17:47:11 2024.
(N) 2024-10-07T10:37:44 - Using custom WebUI. Location: "C:\Program Files\qBittorrent\vuetorrent".
(W) 2024-10-07T10:37:44 - Couldn't load WebUI translation for selected locale (en).
(N) 2024-10-07T10:37:44 - WebUI: HTTPS setup successful
(C) 2024-10-07T10:37:44 - WebUI: Unable to bind to IP: localhost, port: 8765. Reason: Unknown error
(I) 2024-10-07T10:37:44 - Detected external IP. IP: "146.70.174.195"
(W) 2024-10-07T10:40:18 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP: no router found"
(W) 2024-10-07T10:40:18 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP: no router found"
(W) 2024-10-07T10:40:18 - UPnP/NAT-PMP port mapping failed. Message: "could not map port using UPnP: no router found"
HanabishiRecca commented 1 month ago

WebUI: Unable to bind to IP: localhost, port: 8765. Reason: Unknown error

localhost is not an IP address, so it's not an acceptable value there. Post the log where you use 0.0.0.0:8765 or such.

googie-g15 commented 1 month ago

Ah, I see, I used to have localhost set there and it worked just fine,. And it looks like I got 0.0.0.0:8765 working! Not sure what changed vs the first time I tried that but everything's working as expected as of now.

ssmith131 commented 1 month ago

WebUI configuration failed. Reason: Unable to bind to IP: 192.168.0.*, port 8080. Reason: Unknown error.

It has nothing to do with the port. The listening address should be a concrete IP. No wildcards are allowed here.

Thanks, that was it! FWIW, that wildcard IP4 address must have worked with v4.6.7 as I didn't update any settings following the upgrade to v5.0.0.

HanabishiRecca commented 1 month ago

I belive there was a quirk in older Qt versions, silently falling back to 0.0.0.0 on incorrect IP values (any garbage string basically). And if you think about it, it's only for the better that it's gone.

On the qBittorrent side, there was never intentional support for that. We have only 2 special cases: * (1 literal char, not a real wildcard) and empty string, both alias to 0.0.0.0.

https://github.com/qbittorrent/qBittorrent/blob/87644441ad88b251913402ece9fd4b6b78f59ff0/src/webui/webui.cpp#L91-L92

Rokpirnatz commented 1 month ago

I've got the same issue however I am using ddns.

If I rollback to previous (4.xxx) version the WebUI works, and when updated to 5.0.0 it stops working and returns error 522 when trying to reach it.