Blog-Views-Bot icon indicating copy to clipboard operation
Blog-Views-Bot copied to clipboard

OSError: Process terminated: Failed to bind one of the listener ports

Open phonemyatnaing928 opened this issue 5 years ago • 6 comments

File "blog-view.py", line 42, in with TorRequest(proxy_port=proxyPort, ctrl_port=ctrlPort, password=None) as tr: File "/usr/local/lib/python2.7/dist-packages/torrequest.py", line 21, in init self._tor_proc = self._launch_tor() File "/usr/local/lib/python2.7/dist-packages/torrequest.py", line 46, in _launch_tor take_ownership=True) File "/usr/local/lib/python2.7/dist-packages/stem/process.py", line 285, in launch_tor_with_config return launch_tor(tor_cmd, ['-f', '-'], None, completion_percent, init_msg_handler, timeout, take_ownership, close_output, stdin = config_str) File "/usr/local/lib/python2.7/dist-packages/stem/process.py", line 158, in launch_tor raise OSError('Process terminated: %s' % last_problem) OSError: Process terminated: Failed to bind one of the listener ports

phonemyatnaing928 avatar Jun 18 '20 21:06 phonemyatnaing928

I think when you installed Tor, the service of tor is running since the Tor Request package launches the tor service you have to first end the original service. Or change the port in code. To end the service

sudo service tor stop

ap-atul avatar Sep 10 '20 08:09 ap-atul

I am having the same issue, and

sudo service tor stop returns "service command not found."

augustuscrown avatar Nov 18 '20 01:11 augustuscrown

Check for the correct port no of tor service. Change it to that. For stopping the service you can

cd /etc/init.d/
./tor stop

ap-atul avatar Nov 18 '20 04:11 ap-atul

Thanks for the response. I am a n00b, how do I check for the correct port no?

i have the torrc file and everything looks fine ( i just used the default sample file).

I think my problem is the port setting.

edit. i am also on a mac this command doesn't stop tor.

cd /etc/init.d/
./tor stop

When i start by just entering tor in terminal, i cannot stop it. I am just restarting.

however,

brew services start tor and stop tor work fine.

augustuscrown avatar Nov 19 '20 18:11 augustuscrown

Ok. That command will only work on Linux. So now that you can start, restart and stop tor. You can easily check the port no by typing

$ tor

The output will contain port number

Nov 20 11:26:33.409 [notice] Opening Socks listener on 127.0.0.1:9050

ap-atul avatar Nov 20 '20 05:11 ap-atul

wonderful. thanks. now it works but the counter does not work (number of hits doesn't increase), and the ip addresses are all the same.

augustuscrown avatar Nov 20 '20 19:11 augustuscrown