I use fabric 2.6.0, paramiko 2.9.2 and invoke 1.4.0
Is this bug or something incompatible I got an error like this.
File "/usr/local/lib/python3.7/dist-packages/paramiko/message.py", line 274, in add_string self.add_int(len(s)) TypeError: object of type 'bool' has no len()
when I set dry=True
I got like this.
>>> conn.run('touch hello.txt', dry=True)
touch hello.txt
<Result cmd='touch hello.txt' exited=0>
Here's the complete Error that I got.
Python 3.7.5 (default, Dec 9 2021, 17:04:37)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from fabric import Connection
>>> conn = Connection('192.168.1.16')
>>> conn.open()
>>> conn.is_connected
True
>>> conn.run('touch hello.txt')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<decorator-gen-3>", line 2, in run
File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 30, in opens
return method(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 723, in run
return self._run(self._remote_runner(), command, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/invoke/context.py", line 102, in _run
return runner.run(command, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/invoke/runners.py", line 380, in run
return self._run_body(command, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/invoke/runners.py", line 431, in _run_body
self.start(command, self.opts["shell"], self.env)
File "/usr/local/lib/python3.7/dist-packages/fabric/runners.py", line 57, in start
self.channel.update_environment(env)
File "/usr/local/lib/python3.7/dist-packages/paramiko/channel.py", line 72, in _check
return func(self, *args, **kwds)
File "/usr/local/lib/python3.7/dist-packages/paramiko/channel.py", line 332, in update_environment
self.set_environment_variable(name, value)
File "/usr/local/lib/python3.7/dist-packages/paramiko/channel.py", line 72, in _check
return func(self, *args, **kwds)
File "/usr/local/lib/python3.7/dist-packages/paramiko/channel.py", line 361, in set_environment_variable
m.add_string(value)
File "/usr/local/lib/python3.7/dist-packages/paramiko/message.py", line 274, in add_string
self.add_int(len(s))
TypeError: object of type 'bool' has no len()
and here my ssh config
Host *
Port 22
User ubuntu
IdentityFile /home/ubuntu/.ssh/id_rsa
when I run ssh 192.168.1.16
from shell can successfully connect with remote machine.