Connection.sudo() sometimes raises ThreadException/OSError instead of AuthFailure
See original GitHub issueinvoke.exceptions.ThreadException:
Saw 1 exceptions within threads (OSError):
Thread args: {'kwargs': {'buffer_': ['[sudo] password: '],
'hide': False,
'output': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>},
'target': <bound method Runner.handle_stderr of <fabric.runners.Remote object at 0x7f066e63a9e8>>}
Traceback (most recent call last):
File "/home/amezin/test/.venv/lib/python3.6/site-packages/invoke/util.py", line 233, in run
super(ExceptionHandlingThread, self).run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/amezin/test/.venv/lib/python3.6/site-packages/invoke/runners.py", line 750, in handle_stderr
buffer_, hide, output, reader=self.read_proc_stderr
File "/home/amezin/test/.venv/lib/python3.6/site-packages/invoke/runners.py", line 717, in _handle_output
self.respond(buffer_)
File "/home/amezin/test/.venv/lib/python3.6/site-packages/invoke/runners.py", line 884, in respond
self.write_proc_stdin(response)
File "/home/amezin/test/.venv/lib/python3.6/site-packages/invoke/runners.py", line 960, in write_proc_stdin
self._write_proc_stdin(data.encode(self.encoding))
File "/home/amezin/test/.venv/lib/python3.6/site-packages/fabric/runners.py", line 67, in _write_proc_stdin
return self.channel.sendall(data)
File "/home/amezin/test/.venv/lib/python3.6/site-packages/paramiko/channel.py", line 846, in sendall
sent = self.send(s)
File "/home/amezin/test/.venv/lib/python3.6/site-packages/paramiko/channel.py", line 801, in send
return self._send(s, m)
File "/home/amezin/test/.venv/lib/python3.6/site-packages/paramiko/channel.py", line 1198, in _send
raise socket.error("Socket is closed")
OSError: Socket is closed
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think what you might be seeing is a different error: I don’t think it’s getting to the sudo auth phase. I’m seeing this on Python 2.7 but only when stdin is redirected from /dev/null. Maybe try again with
pty=True
?@matt-hayden After hours of debugging you just saved me from a mental breakdown. I would also like to add that I only got this error while using multiprocessing.Process even if it’s just one process.