salt: [BUG] AttributeError: 'Process' object has no attribute '_args_for_getstate'
Description salt-ssh crashes with an exception before doing seemingly anything
Setup Just upgraded to salt 3001, 3000 was working fine
Steps to Reproduce the behavior salt-ssh $host state.highstate test=True
AttributeError: 'Process' object has no attribute '_args_for_getstate'
Traceback (most recent call last):
File "/usr/local/bin/salt-ssh", line 33, in <module>
sys.exit(load_entry_point('salt==3001', 'console_scripts', 'salt-ssh')())
File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/scripts.py", line 499, in salt_ssh
client.run()
File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/cli/ssh.py", line 26, in run
ssh.run()
File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/client/ssh/__init__.py", line 787, in run
for ret in self.handle_ssh():
File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/client/ssh/__init__.py", line 604, in handle_ssh
routine.start()
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/utils/process.py", line 755, in __getstate__
args = self._args_for_getstate
AttributeError: 'Process' object has no attribute '_args_for_getstate'
Expected behavior Salt executes on the host
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Salt Version:
Salt: 3001
Dependency Versions:
cffi: 1.12.2
cherrypy: unknown
dateutil: 2.8.0
docker-py: Not Installed
gitdb: 2.0.6
gitpython: 2.1.15
Jinja2: 2.10.1
libgit2: 1.0.1
M2Crypto: 0.35.2
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: 2.19
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: 1.2.1
Python: 3.8.3 (default, May 27 2020, 20:54:22)
python-gnupg: 0.4.4
PyYAML: 5.1.2
PyZMQ: 19.0.0
smmap: 3.0.4
timelib: 0.2.4
Tornado: 4.5.3
ZMQ: 4.3.2
System Versions:
dist: darwin 19.5.0
locale: utf-8
machine: x86_64
release: 19.5.0
system: Darwin
version: 10.15.5 x86_64
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 31 (20 by maintainers)
Commits related to this issue
- Add changelog for #57742 Fixes #57742 Signed-off-by: Pedro Algarvio <palgarvio@vmware.com> — committed to s0undt3ch/salt by s0undt3ch 2 years ago
- Add changelog for #57742 Fixes #57742 Signed-off-by: Pedro Algarvio <palgarvio@vmware.com> — committed to saltstack/salt by s0undt3ch 2 years ago
- Add changelog for #57742 Fixes #57742 Signed-off-by: Pedro Algarvio <palgarvio@vmware.com> — committed to garethgreenaway/salt by s0undt3ch 2 years ago
- Adding retry functionality when parallel is set to True (#61631) * Making the retry state system feature available when parallel is set to True. * swapping out using time.sleep Salt function for P... — committed to saltstack/salt by garethgreenaway 2 years ago
It is not working anymore because python formula has been upgraded from 3.7 to 3.8 …
We need to fix the code for making it to work with python 3.8
Applying the following patch to your salt formula (
brew edit salt) and install it building from source will allow you to runsalt-minionagain.Undo your formula changes after installing it to allow future updates for the salt formula.
I’ll try to at least rebase the PR against the latest master in the next couple of days…
I have copied the official salt formula from homebrew-core and patched it to use python@3.7
You can install salt with python3.7 using my homebrew-tap:
⚠️ I will keep the formula updated using python 3.7 when the official one is updated until this bug is resolved.
This is a known issue being worked on in https://github.com/saltstack/salt/pull/57028 for magnesium
Thanks @cdalvaro worked for me on Darwin.
Gonna need to put up the @s0undt3ch bat signal on this one. He’s already working on it here #57028
This is a temporary solution until the bug is fixed.
Edit the Homebrew
saltformula (brew edit salt) to apply the following patch:then:
May be we could create a PR at homebrew-core to apply this patch to the formula until the next Salt released is ready with the bug fixed.
Ran into this when trying to use salt-ssh from my mac. Doing the 3.7 fix with brew edit worked.
This bug report is about salt-ssh though, no running salt-minion involved.
I have tried adding this changes to
salt/utils/process.py:but then, the following error is reported:
It looks this is the origin of the issue: https://docs.python.org/3/library/multiprocessing.html
Update
Similar issue solved here: https://github.com/horovod/horovod/pull/1904