threefoldtecharchive / jumpscaleX_archived

Apache License 2.0
1 stars 6 forks source link

Use monkey.patch_all() in kosmos cmd #749

Closed AhmedHanafy725 closed 5 years ago

AhmedHanafy725 commented 5 years ago

Uncomment line 7,8 here to use monkey.patch_all()

Result:

1- All Builders:

'NoneType' object has no attribute 'fork_exec'

### 2- BCDB:
- `j.data.bcdb.test()`

Traceback (most recent call last): File "", line 1, in File "/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py", line 340, in test self._test_run(name=name) File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSFactoryTools.py", line 33, in _test_run res = self.test_run(name=name, obj_key=obj_key, die=die, **kwargs) File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSFactoryTools.py", line 111, in __test_run self.test_run(name=name, obj_key=obj_key, kwargs) File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSFactoryTools.py", line 102, in __test_run self._code_run(name=name, path=tpath, obj_key=obj_key, die=die, kwargs) File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSFactoryTools.py", line 55, in _code_run res = method(self=self, **kwargs) File "/sandbox/lib/jumpscale/Jumpscale/data/bcdb/tests/10_export.py", line 10, in main j.servers.zdb.test_instance_start() File "/sandbox/lib/jumpscale/Jumpscale/servers/zdb/ZDBServers.py", line 51, in test_instance_start zdb.start() File "/sandbox/lib/jumpscale/Jumpscale/servers/zdb/ZDBServer.py", line 56, in start self.startupcmd.start() File "/sandbox/lib/jumpscale/Jumpscale/servers/startupcmd/StartupCMD.py", line 542, in start self._tmux_start(toexec) File "/sandbox/lib/jumpscale/Jumpscale/servers/startupcmd/StartupCMD.py", line 581, in _tmux_start j.servers.tmux.server File "/sandbox/lib/jumpscale/Jumpscale/servers/tmux/Tmux.py", line 59, in server rc, out, err = j.core.tools.execute("tmux ls", die=False) File "/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py", line 1295, in execute executable="/bin/bash", File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1288, in _execute_child self.pid = _posixsubprocess.fork_exec( AttributeError: 'NoneType' object has no attribute 'fork_exec'

'NoneType' object has no attribute 'fork_exec'


### 3- sal.process
- `j.sal.process.getProcessPid("redis")`

Traceback (most recent call last): File "", line 1, in File "/sandbox/lib/jumpscale/Jumpscale/sal/process/SystemProcess.py", line 616, in getProcessPid (exitcode, output, err) = j.sal.process.execute(command, die=False, showout=False) File "/sandbox/lib/jumpscale/Jumpscale/sal/process/SystemProcess.py", line 108, in execute replace=replace, File "/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py", line 1295, in execute executable="/bin/bash", File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1288, in _execute_child self.pid = _posixsubprocess.fork_exec( AttributeError: 'NoneType' object has no attribute 'fork_exec'

'NoneType' object has no attribute 'fork_exec'

### 4- sal.ubuntu
`j.sal.ubuntu.apt_install("vim")`

Traceback (most recent call last): File "", line 1, in File "/sandbox/lib/jumpscale/Jumpscale/sal/ubuntu/Ubuntu.py", line 114, in apt_install self.apt_update() File "/sandbox/lib/jumpscale/Jumpscale/sal/ubuntu/Ubuntu.py", line 320, in apt_update j.sal.process.execute("apt-get update", False) File "/sandbox/lib/jumpscale/Jumpscale/sal/process/SystemProcess.py", line 108, in execute replace=replace, File "/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py", line 1295, in execute executable="/bin/bash", File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1288, in _execute_child self.pid = _posixsubprocess.fork_exec( AttributeError: 'NoneType' object has no attribute 'fork_exec'

'NoneType' object has no attribute 'fork_exec'


### 5- clients:
`j.clients.zdb.test()`

Traceback (most recent call last): File "", line 1, in File "/sandbox/lib/jumpscale/Jumpscale/clients/stor_zdb/ZDBClientFactory.py", line 86, in test j.servers.zdb.test_instance_start() File "/sandbox/lib/jumpscale/Jumpscale/servers/zdb/ZDBServers.py", line 51, in test_instance_start zdb.start() File "/sandbox/lib/jumpscale/Jumpscale/servers/zdb/ZDBServer.py", line 56, in start self.startupcmd.start() File "/sandbox/lib/jumpscale/Jumpscale/servers/startupcmd/StartupCMD.py", line 542, in start self._tmux_start(toexec) File "/sandbox/lib/jumpscale/Jumpscale/servers/startupcmd/StartupCMD.py", line 581, in _tmux_start j.servers.tmux.server File "/sandbox/lib/jumpscale/Jumpscale/servers/tmux/Tmux.py", line 59, in server rc, out, err = j.core.tools.execute("tmux ls", die=False) File "/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py", line 1295, in execute executable="/bin/bash", File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1288, in _execute_child self.pid = _posixsubprocess.fork_exec( AttributeError: 'NoneType' object has no attribute 'fork_exec'

`j.clients.sshkey.test()`

Traceback (most recent call last): File "", line 1, in File "/sandbox/lib/jumpscale/Jumpscale/clients/sshkey/SSHKeys.py", line 54, in test sshkey_client.generate() File "/sandbox/lib/jumpscale/Jumpscale/clients/sshkey/SSHKey.py", line 77, in generate j.sal.process.execute(cmd, timeout=10) File "/sandbox/lib/jumpscale/Jumpscale/sal/process/SystemProcess.py", line 108, in execute replace=replace, File "/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py", line 1295, in execute executable="/bin/bash", File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1288, in _execute_child self.pid = _posixsubprocess.fork_exec( AttributeError: 'NoneType' object has no attribute 'fork_exec'

'NoneType' object has no attribute 'fork_exec'

### 6- tools
bash
`j.tools.bash.test()`

Traceback (most recent call last): File "", line 1, in File "/sandbox/lib/jumpscale/Jumpscale/sal/bash/BashFactory.py", line 41, in test bash = self.get(path="/tmp/") File "/sandbox/lib/jumpscale/Jumpscale/sal/bash/BashFactory.py", line 33, in get return Bash(executor=executor, path=path, profile_name=profile_name) File "/sandbox/lib/jumpscale/Jumpscale/sal/bash/Bash.py", line 30, in init self.profile = Profile(self, profilepath) File "/sandbox/lib/jumpscale/Jumpscale/sal/bash/Profile.py", line 26, in init self.load() File "/sandbox/lib/jumpscale/Jumpscale/sal/bash/Profile.py", line 63, in load , currentenv, = self.executor.execute("source %s && printenv" % self.profile_path) File "/sandbox/lib/jumpscale/Jumpscale/tools/executor/ExecutorLocal.py", line 88, in execute cmd, die=die, showout=showout, timeout=timeout, replace=replace, interactive=interactive File "/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py", line 1295, in execute executable="/bin/bash", File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1288, in _execute_child self.pid = _posixsubprocess.fork_exec( AttributeError: 'NoneType' object has no attribute 'fork_exec'


## Conclusion:
Any module that use subprocess will get error in forking execution from system.
rkhamis commented 5 years ago

Thanks, @AhmedHanafy725