cp.push and cp.push_dir broken in 3007.4

26 views
Skip to first unread message

David Komanek

unread,
Jun 17, 2025, 11:28:34 AMJun 17
to Salt-users
Hello,

after upgrade to salt 3007.4, cp.push and cp.push_dir operations are broken, at least two scenarios don't work anymore:

1. cp.push to a subdirectory of default cache directory
working well:
/usr/bin/salt minion cp.push /path/to/file.txt upload_path='testfile.txt'
not working:
/usr/bin/salt minion cp.push /path/to/file.txt upload_path='tmp/testfile.txt'

solution:
$ diff /opt/saltstack/salt/lib/python3.10/site-packages/salt/master.py_orig /opt/saltstack/salt/lib/python3.10/site-packages/salt/master.py
1743c1743
<         if not salt.utils.verify.clean_path(rpath, cpath):
---
>         if not salt.utils.verify.clean_path(rpath, cpath, True):

2. cp.push_dir with globbing throws exception, even with the change in master.py following the previous case
not working:
/usr/bin/salt minion cp.push_dir /path/to/dir upload_path='tmp' glob='*.conf'
throws an exception:

    The minion function caused an exception: Traceback (most recent call last):
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/minion.py", line 2022, in _thread_return
        return_data = minion_instance._execute_job_function(
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/minion.py", line 1978, in _execute_job_function
        return_data = self.executors[fname](opts, data, func, args, kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 160, in __call__
        ret = self.loader.run(run_func, *args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1269, in run
        return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1284, in _run_as
        ret = _func_or_method(*args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/direct_call.py", line 10, in execute
        return func(*args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 160, in __call__
        ret = self.loader.run(run_func, *args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1269, in run
        return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/lazy.py", line 1284, in _run_as
        ret = _func_or_method(*args, **kwargs)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/cp.py", line 1064, in push_dir
        ret = push(tmpfile, upload_path=tmpupload_path)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/cp.py", line 1004, in push
        ret = channel.send(load)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/asynchronous.py", line 139, in wrap
        raise exc_info[1].with_traceback(exc_info[2])
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/asynchronous.py", line 147, in _target
        result = io_loop.run_sync(lambda: getattr(self.obj, key)(*args, **kwargs))
      File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/ioloop.py", line 539, in run_sync
        return future_cell[0].result()
      File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/gen.py", line 779, in run
        yielded = self.gen.throw(exc)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/channel/client.py", line 353, in send
        ret = yield self._crypted_transfer(load, timeout=timeout, raw=raw)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/gen.py", line 766, in run
        value = future.result()
      File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/gen.py", line 779, in run
        yielded = self.gen.throw(exc)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/channel/client.py", line 307, in _crypted_transfer
        ret = yield _do_transfer()
      File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/gen.py", line 766, in run
        value = future.result()
      File "/opt/saltstack/salt/lib/python3.10/site-packages/tornado/gen.py", line 233, in wrapper
        yielded = ctx_run(next, result)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/channel/client.py", line 289, in _do_transfer
        self._package_load(load, nonce),
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/channel/client.py", line 170, in _package_load
        load["tok"] = self.auth.gen_token(b"salt")
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/crypt.py", line 1112, in gen_token
        return self.get_keys().encrypt(clear_tok)
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/crypt.py", line 1088, in get_keys
        user = self.opts.get("user", "root")
      File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/loader/context.py", line 88, in get
        return self.value().get(key, default)
    AttributeError: 'NoneType' object has no attribute 'get'
ERROR: Minions returned with non-zero exit code

I dind't find a solution for this case yet. Both master (Ubuntu 24.04) and minion (Ubuntu 22.04) have 3007.4 packages from packages.broadcom.com.

Before there were 3007.1 on both master and minion, working well in these situations.

David

David Komanek

unread,
Jun 17, 2025, 12:23:00 PMJun 17
to Salt-users
correction:
case "1" works with the changed master.py against minion in version 3007.1, for minion in version 3007.4 it throws the same exception the case "2", sorry for this

so it seems the change in master.py is only part of the solution, the exception in the minion 3007.4 is there in all my cases

Shane Lee

unread,
Jun 17, 2025, 12:49:44 PMJun 17
to Salt-users
Please create an issue for this in GitHub.

David Komanek

unread,
Jun 18, 2025, 11:02:29 AMJun 18
to salt-...@googlegroups.com
Hi,
Best regards,
David


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/salt-users/72673873-44e0-4ac7-8b72-e5f62d49d140n%40googlegroups.com.

David Komanek

unread,
Jun 18, 2025, 11:02:29 AMJun 18
to Salt-users

There is already response about this being a duplicate of other issues reported for 3006.x.

Shane Lee

unread,
Jun 18, 2025, 11:07:52 AMJun 18
to Salt-users
I guess I'm not very good at finding existing issues. I'll close that and we'll track that PR. I've approved it.
Reply all
Reply to author
Forward
0 new messages