question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] AttributeError: 'Process' object has no attribute '_args_for_getstate'

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:31 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
cdalvarocommented, Jul 14, 2020

It is not working anymore because python formula has been upgraded from 3.7 to 3.8 …

brew info python
python@3.8: stable 3.8.3 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python@3.8/3.8.3_2 (4,229 files, 64.6MB)
  Poured from bottle on 2020-07-14 at 14:43:45
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python@3.8.rb
==> Dependencies
Build: pkg-config ✔
Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python@3.8/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.8/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 463,840 (30 days), 1,253,709 (90 days), 1,905,378 (365 days)
install-on-request: 48,437 (30 days), 71,239 (90 days), 96,550 (365 days)
build-error: 0 (30 days)

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 run salt-minion again.

diff --git a/Formula/salt.rb b/Formula/salt.rb
index d4a87977f..196e27648 100644
--- a/Formula/salt.rb
+++ b/Formula/salt.rb
@@ -17,7 +17,7 @@ class Salt < Formula
   depends_on "libgit2"
   depends_on "libyaml"
   depends_on "openssl@1.1"
-  depends_on "python@3.8"
+  depends_on "python@3.7"
   depends_on "zeromq"

   on_linux do
@@ -61,7 +61,7 @@ class Salt < Formula
     # https://github.com/Homebrew/homebrew-core/pull/52835#issuecomment-617502578
     File.write(buildpath/"pkg/osx/req_pyobjc.txt", "")

-    venv = virtualenv_create(libexec, Formula["python@3.8"].bin/"python3.8")
+    venv = virtualenv_create(libexec, Formula["python@3.7"].bin/"python3.7")
     venv.pip_install resources

     system libexec/"bin/pip", "install", "-v", "--ignore-installed", buildpath
brew install --build-from-source salt

Undo your formula changes after installing it to allow future updates for the salt formula.

3reactions
s0undt3chcommented, Jul 14, 2021

I’ll try to at least rebase the PR against the latest master in the next couple of days…

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'Process' object has no attribute 'partition' - ...
The error means this: you are using the attribute partition on an object of type Process , but such Process object has no...
Read more >
'Process' object has no attribute 'get_connections'
I'm new to python and to psiturk, and am stuck on what I assume is a python configuration issue. I'm trying to run...
Read more >
Yum update to Red Hat Enterprise Linux 6.7 fails with ...
Yum update to Red Hat Enterprise Linux 6.7 fails with AttributeError: 'module' object has no attribute 'RELEASE STATUS CACHE'.
Read more >
CommandClient has no attribute "test_authentication"
I am trying to set up a new worker on our network that will connect to our Cryosparc master node. We can initiate...
Read more >
AttributeError: 'Service' object has no attribute 'enabled'
Bug Description. Overcloud deploy fails in task : Create identity service fails with AttributeError: 'Service' object has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found