Opened 2 years ago

Closed 2 years ago

#23314 closed defect (worksforme)

`make test-stem` starts up tor on 9050: Address already in use

Reported by: asn Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords: tor-tests stem
Cc: atagar Actual Points:
Parent ID: Points: 0.1
Reviewer: Sponsor:

Description

I tried to run the little-t-tor stem tests using make test-stem. The unittests finished successfuly but all the integration tests failed because stem couldn't start up tor. It was trying to launch tor with a socksport on 9050 but it was failing because my system tor was already occupying that port:

======================================================================
                          INTEGRATION TESTS                           
======================================================================

Setting up a test instance...
  making test directory (/home/f/Computers/tor/stem/test/data)... done
  configuring logger (/home/f/Computers/tor/stem/test/data/log)... done
  writing torrc (/home/f/Computers/tor/stem/test/data/torrc)... done
    # configuration for stem integration tests
    DataDirectory /home/f/Computers/tor/stem/test/data
    SocksListenAddress 127.0.0.1:1112
    DownloadExtraInfo 1
    Log notice stdout
    Log notice file /home/f/Computers/tor/stem/test/data/tor_log

Starting ./src/or/tor...

  Aug 24 14:20:28.564 [notice] Tor 0.3.2.0-alpha-dev (git-40acdc357e08ab03) running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.1t, Zlib 1.2.8, Liblzma N/A, and Libzstd N/A.
  Aug 24 14:20:28.564 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
  Aug 24 14:20:28.564 [notice] This version is not a stable Tor release. Expect more bugs than usual.
  Aug 24 14:20:28.564 [notice] Read configuration file "/home/f/Computers/tor/stem/test/data/torrc".
  Aug 24 14:20:28.567 [warn] Skipping obsolete configuration option 'SocksListenAddress'
  Aug 24 14:20:28.567 [notice] Opening Socks listener on 127.0.0.1:9050
  Aug 24 14:20:28.567 [warn] Could not bind to 127.0.0.1:9050: Address already in use. Is Tor already running?
  Aug 24 14:20:28.567 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
  Aug 24 14:20:28.567 [err] Reading config failed--see warnings above.
  failed to start tor: Process terminated: Failed to bind one of the listener ports.


Shutting down tor... done

I think stem should start up tor on a different non-default port, or just use SocksPort auto.

Cheers!

Child Tickets

Change History (2)

comment:1 Changed 2 years ago by atagar

Hi asn, thanks for pointing this out! Actually, Stem is *trying* to use a non-standard port but tor's ignoring it...

"Aug 24 14:20:28.567 [warn] Skipping obsolete configuration option 'SocksListenAddress'"
https://www.torproject.org/docs/tor-manual.html.en#SocksListenAddress
https://gitweb.torproject.org/stem.git/tree/test/runner.py#n60

Simple to fix.

comment:2 Changed 2 years ago by atagar

Resolution: worksforme
Status: newclosed

Oh wait, I did this months ago. You're simply out of date. ;)

https://gitweb.torproject.org/stem.git/commit/?id=e35286dd

Note: See TracTickets for help on using tickets.