#1101063 onionshare-cli: stem.SocketError: [Errno 2] No such file or directory

#1101063#5
Date:
2025-03-22 19:31:46 UTC
From:
To:
Dear Maintainer,

while trying to send a single file with onionshare-cli this is what it
does when given
a filename test_file [ does same with ./test_file ]:


$ onionshare-cli test_file
╭───────────────────────────────────────────╮
│    *            ▄▄█████▄▄            *    │
│               ▄████▀▀▀████▄     *         │
│              ▀▀█▀       ▀██▄              │
│      *      ▄█▄          ▀██▄             │
│           ▄█████▄         ███        -+-  │
│             ███         ▀█████▀           │
│             ▀██▄          ▀█▀             │
│         *    ▀██▄       ▄█▄▄     *        │
│ *             ▀████▄▄▄████▀               │
│                 ▀▀█████▀▀                 │
│             -+-                     *     │
│   ▄▀▄               ▄▀▀ █                 │
│   █ █     ▀         ▀▄  █                 │
│   █ █ █▀▄ █ ▄▀▄ █▀▄  ▀▄ █▀▄ ▄▀▄ █▄▀ ▄█▄   │
│   ▀▄▀ █ █ █ ▀▄▀ █ █ ▄▄▀ █ █ ▀▄█ █   ▀▄▄   │
│                                           │
│                  v2.6.3                   │
│                                           │
│          https://onionshare.org/          │
╰───────────────────────────────────────────╯

OnionShare could not connect to Tor:
[Errno 2] No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/stem/socket.py", line 584, in
_make_socket
    control_socket.connect(self.path)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/onionshare_cli/onion.py", line
432, in connect
    self.c = Controller.from_socket_file(path=self.tor_control_socket)
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/stem/control.py", line 1049, in
from_socket_file
    control_socket = stem.socket.ControlSocketFile(path)
  File "/usr/lib/python3/dist-packages/stem/socket.py", line 564, in __init__
    self.connect()
    ~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/stem/socket.py", line 172, in connect
    self._socket = self._make_socket()
                   ~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/stem/socket.py", line 587, in
_make_socket
    raise stem.SocketError(exc)
stem.SocketError: [Errno 2] No such file or directory


the file is there...


$ ls -arlht test_file
-rw-rw-r-- 1 themusicgod1 themusicgod1 2 Mar 22 13:27 test_file


this seems broken.

#1101063#10
Date:
2025-05-31 22:28:28 UTC
From:
To:
Hey,

Thanks for your bugreport.

The traceback does not look like you have issue about the file you share.

It seems like onionshare is unable to connect to a tor server/ start a tor
server and does not find your tor control socket.  So it is possible, that it
is a configuration issue.
Please check if the control socket exists and that the tor process is started
correctly.

Regards,

hefee