torproject / stem

Python controller library for Tor
https://stem.torproject.org/
GNU Lesser General Public License v3.0
257 stars 75 forks source link

SIGNAL response contained unrecognized status code: 514 #78

Closed honzajavorek closed 3 years ago

honzajavorek commented 3 years ago

I'm trying to use stem to control tor as described here, but instead of privoxy, I'm using the built-in HTTP tunnel. This is my tor config:

ControlPort 9051
HTTPTunnelPort 8118

It works locally, but not on the server, i.e. when I run my Python program on a server machine where tor is running as a background service. When I raise logging level, I get a few

[stem] INFO: Error while receiving a control message (SocketClosed): empty socket content

and then it all fails with an exception

stem.ProtocolError: SIGNAL response contained unrecognized status code: 514

Could someone please explain me what could be wrong or help me to debug this? I don't even know where I should look. I raised the logging level of tor itself, but couldn't find anything very interesting there. Attaching the log just in case someone could understand what's going on.

tor.log

atagar commented 3 years ago

Hi Honza. Could you please further explain what you mean by "t works locally, but not on the server"? On first blush if your code is working as desired on one system but not another this sounds like a problem related to the latter's setup, which sadly I can't be of much assistance with.

The article you cited just uses Stem to send tor a NEWNYM signal. For what it's worth you don't necessarily need Stem to do that.

If you have a question related to some Stem specific code I'd be happy to take a look, but there doesn't seem to be much to go off here.

honzajavorek commented 3 years ago

Your code is working as desired on one system but not another this sounds like a problem related to the latter's setup, which sadly I can't be of much assistance with.

That's exactly the situation. I was hoping you could say from the errors I'm getting what I'm doing wrong. Like, something along the lines of "if you're getting 514, that usually means tor isn't ready yet" or something. If the errors don't look familiar in any way, I completely understand this is out of scope of stem. Thanks for your time!

atagar commented 3 years ago

No problem Honza, best of luck tracking it down!