Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#33279 closed defect (worksforme)

Tor Browser cannot bind SOCKS port 9050: How to change browser settings? (not torrc)

Reported by: psisis Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by pospeselr)

I’m having a frustrating problem. I have no router right now, and am at the mercy of the ISP gateway, and they don’t give permission to port 9050. Starting Tor Browser, I instantly get closed unexpectedly/error, with no log message whatsoever. But running tor.exe manually I found the problem. (Permission denied [WSAEACCES])

I changed torrc SOCKS port to 443 and it works, tor.exe is starting. BUT, the actual browser will not start, it gives the same unexpected error. Tor service actually works though, if I enter the local proxy manually into my standard browser it reaches onion links. But that is not really a solution. I have tried looking through prefs.js and sqlite files but could not find any option for either proxy settings or ‘9050’. Can I change the proxy port manually without starting TorBrowser/FF?

(A completely fresh bundle will not start either)

Child Tickets

Change History (9)

comment:1 Changed 8 months ago by pospeselr

Status: newneeds_information

The symptoms as you've described don't really make any sense. The router you're connected to has no bearing on your ability to open a port on localhost.

It sounds like instead your local firewall (ie Windows built-in or some other you've installed) might be blocking the port, or you may have an old lingering tor.exe process already bound to port 9050 and so launching a *new* tor.exe fails. Can you confirm there are no orphaned tor.exe in the process manager (or just reboot) and that you don't have some firewall or anti-virus interfering here?

comment:2 Changed 8 months ago by pospeselr

Description: modified (diff)

comment:3 Changed 8 months ago by boklm

Priority: HighMedium
Severity: CriticalNormal

comment:4 in reply to:  1 Changed 8 months ago by psisis

Replying to pospeselr:

The symptoms as you've described don't really make any sense. The router you're connected to has no bearing on your ability to open a port on localhost.

It sounds like instead your local firewall (ie Windows built-in or some other you've installed) might be blocking the port, or you may have an old lingering tor.exe process already bound to port 9050 and so launching a *new* tor.exe fails. Can you confirm there are no orphaned tor.exe in the process manager (or just reboot) and that you don't have some firewall or anti-virus interfering here?

No, there is none. It worked perfectly fine for years until yesterday. The only change I did was remove my router and connect directly to the wallsocket. Meaning my local IP is given by ISP gateway. Now suddenly it does not work. When I click “Copy Tor Log to Clipboard” it says 0 log messages copied.

I also have a VPN connection in between, so I have bound tor to the VPN IP. Tor.exe starts, but Tor Browser will not. I even added Tor Browser to Windows Firewall and allowed all connections.

Edit: I will add the tor.exe log:

Feb 12 00:51:09.042 [notice] Tor 0.4.2.5 (git-bede4ea1008920d8) running on Windows 8 [or later] with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Feb 12 00:51:09.043 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Feb 12 00:51:09.052 [notice] Configuration file "C:\Users\Psi\AppData\Roaming\tor\torrc" not present, using reasonable defaults.
Feb 12 00:51:09.052 [warn] Path for GeoIPFile (<default>) is relative and will resolve to C:\Users\Psi\<default>. Is this what you wanted?
Feb 12 00:51:09.052 [warn] Path for GeoIPv6File (<default>) is relative and will resolve to C:\Users\Psi\<default>. Is this what you wanted?
Feb 12 00:51:09.053 [notice] Opening Socks listener on 127.0.0.1:9050
Feb 12 00:51:09.053 [warn] Could not bind to 127.0.0.1:9050: Permission denied [WSAEACCES ]
Feb 12 00:51:09.053 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
Feb 12 00:51:09.053 [err] Reading config failed--see warnings above.

Now with SocksPort 443:

Feb 12 00:53:01.083 [notice] Tor 0.4.2.5 (git-bede4ea1008920d8) running on Windows 8 [or later] with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Feb 12 00:53:01.084 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Feb 12 00:53:01.094 [notice] Read configuration file "xxx".
Feb 12 00:53:01.094 [warn] Skipping obsolete configuration option "SocksListenAddress".
Feb 12 00:53:01.099 [notice] Opening Socks listener on 127.0.0.1:443
Feb 12 00:53:01.099 [notice] Opened Socks listener on 127.0.0.1:443
Feb 12 00:53:01.000 [notice] Parsing GEOIP IPv4 file xxx.
Feb 12 00:53:01.000 [notice] Parsing GEOIP IPv6 file xxx.
Feb 12 00:53:01.000 [notice] Bootstrapped 0% (starting): Starting
Feb 12 00:53:03.000 [warn] Your configuration excludes 99% of all possible guards. That's likely to make you stand out from the rest of the world.
Feb 12 00:53:03.000 [notice] Starting with guard context "restricted"
Feb 12 00:53:04.000 [notice] Bootstrapped 3% (conn_proxy): Connecting to proxy
Feb 12 00:53:04.000 [notice] Bootstrapped 4% (conn_done_proxy): Connected to proxy
Feb 12 00:53:04.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
Feb 12 00:53:04.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
Feb 12 00:53:04.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
Feb 12 00:53:04.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Feb 12 00:53:04.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Feb 12 00:53:04.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Feb 12 00:53:05.000 [notice] Bootstrapped 100% (done): Done
Feb 12 00:53:07.000 [warn] Failed to find node for hop #1 of our path. Discarding this circuit.
Feb 12 00:53:07.000 [notice] Our circuit 0 (id: 5) died due to an invalid selected path, purpose General-purpose client. This may be a torrc configuration issue, or a bug.

P.S thanks for fixing the [WSAEACCES]

and Resource Manager says no listening port 9050

Last edited 8 months ago by psisis (previous) (diff)

comment:5 Changed 8 months ago by psisis

And besides the problem not making much sense, is there a possible way to change Tor Browser settings from files or sqlite? It seems to behave somewhat differently from standard FF.

comment:6 in reply to:  5 ; Changed 8 months ago by mcs

Replying to psisis:

And besides the problem not making much sense, is there a possible way to change Tor Browser settings from files or sqlite? It seems to behave somewhat differently from standard FF.

It is difficult to understand your setup, but the default SOCKS port used by Tor Browser when it starts tor is 9150, not 9050. That is configured by the browser via args passed when starting tor.exe, e.g., __SocksPort 127.0.0.1:9150 IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth. It will not normally be stored in torrc.

You should not need to add any SocksPort lines to your torrc file. In the absence of any other unusual configuration, the SOCKS port is derived from the network.proxy.socks_port preference value. You can change it by editing prefs.js within the Tor Browser profile.

comment:7 in reply to:  6 ; Changed 8 months ago by psisis

Replying to mcs:

Replying to psisis:

And besides the problem not making much sense, is there a possible way to change Tor Browser settings from files or sqlite? It seems to behave somewhat differently from standard FF.

It is difficult to understand your setup, but the default SOCKS port used by Tor Browser when it starts tor is 9150, not 9050. That is configured by the browser via args passed when starting tor.exe, e.g., __SocksPort 127.0.0.1:9150 IPv6Traffic PreferIPv6 KeepAliveIsolateSOCKSAuth. It will not normally be stored in torrc.

You should not need to add any SocksPort lines to your torrc file. In the absence of any other unusual configuration, the SOCKS port is derived from the network.proxy.socks_port preference value. You can change it by editing prefs.js within the Tor Browser profile.

I don’t know why you guys give me such a hard time. I outlined the problem clearly, posted my tor.exe output log, and said what I’ve tried. You keep assuming the real issue is deep within my system. A fresh bundle will not start either, and it’s impossible Tor is already running, since it’s on a drive not mounted at startup.

I put user_pref("network.proxy.socks_port", 443); in my prefs.js. And Tor starts now, thank you very much.

Fwiw, Resource Mon says tor.exe is also using port 9151 but that was allowed and never restricted. And inspecting the packets, tor is having TCP/socks traffic from ports ~5470-5700 (tor was completely dead before changing prefs.js)

For clarification, Tor worked literally for years until two days ago. Two days ago I removed my router and hooked up to WAN, nothing else happened, I promise

comment:8 in reply to:  7 Changed 8 months ago by mcs

Resolution: worksforme
Status: needs_informationclosed

Replying to psisis:

I don’t know why you guys give me such a hard time. I outlined the problem clearly, posted my tor.exe output log, and said what I’ve tried. You keep assuming the real issue is deep within my system. A fresh bundle will not start either, and it’s impossible Tor is already running, since it’s on a drive not mounted at startup.

Fair enough. We are not trying to give you a difficult time; we just could not understand what could be interfering with use of the local port 9150 or 9050.

I put user_pref("network.proxy.socks_port", 443); in my prefs.js. And Tor starts now, thank you very much.

I am very happy that Tor Browser is working for you once again!

comment:9 Changed 8 months ago by pospeselr

psisis: could you do a netstat -a -o -n -b from a command prompt (might need to be an elevated Administrator prompt, don't know) and paste the contents? Stackoverflow says that should tell us what processes are binding to which ports.

Note: See TracTickets for help on using tickets.