saltstack / saltstack/salt

[BUG] salt-ssh 3007.3 broken with transactional-update system

Open
#68,067 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
I am running openSUSE microOS (transactional-update) in KVM x86_64 virtual environment.
I also have test salt-ssh configuration including Saltfile, config/master, config/roster, states/top.sls, and states/nginx.sls.

Setup

config/master includes the following module_executors

ssh_minion_opts:
  module_executors:
    - transactional_update
    - direct_call

states/top.sls:

base:
  '*':
    - nginx

states/nginx.sls:

nginx:
  pkg.installed: []

Please be as specific as possible and give set-up details.

  • VM KVM x86_64

Steps to Reproduce the behavior

> salt-ssh --log-file-level=debug 'microos-test' state.apply
microos-test:
----------
          ID: nginx
    Function: pkg.installed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/var/tmp/.root_2dff72_salt/pyall/salt/state.py", line 2469, in call
                  ret = self.states[cdata["full"]](
                      *cdata["args"], **cdata["kwargs"]
                  )
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 160, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 1269, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                         ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 1284, in _run_as
                  ret = _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 1320, in wrapper
                  return f(*args, **kwargs)
                File "/var/tmp/.root_2dff72_salt/pyall/salt/states/pkg.py", line 1934, in installed
                  pkg_ret = __salt__["pkg.install"](
                      name=None,
                  ...<11 lines>...
                      **kwargs,
                  )
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 160, in __call__
                  ret = self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 1269, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                         ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/var/tmp/.root_2dff72_salt/pyall/salt/loader/lazy.py", line 1284, in _run_as
                  ret = _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_2dff72_salt/pyall/salt/modules/zypperpkg.py", line 1735, in install
                  __zypper__(
                  ~~~~~~~~~~~
                  ...<3 lines>...
                  )
                  ~
                  .call(*cmd)
                  ~~~~~^^^^^^
                File "/var/tmp/.root_2dff72_salt/pyall/salt/modules/zypperpkg.py", line 356, in __call
                  if self._check_result():
                     ~~~~~~~~~~~~~~~~~~^^
                File "/var/tmp/.root_2dff72_salt/pyall/salt/modules/zypperpkg.py", line 286, in _check_result
                  if self._is_zypper_lock() or self._is_rpm_lock():
                                               ~~~~~~~~~~~~~~~~~^^
                File "/var/tmp/.root_2dff72_salt/pyall/salt/modules/zypperpkg.py", line 253, in _is_rpm_lock
                  with salt.utils.files.fopen(self.RPM_LOCK, mode="w+") as rfh:
                       ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/var/tmp/.root_2dff72_salt/pyall/salt/utils/files.py", line 389, in fopen
                  f_handle = open(  # pylint: disable=resource-leakage,unspecified-encoding
                      *args, **kwargs
                  )
              OSError: [Errno 30] Read-only file system: '/var/lib/rpm/.rpm.lock'
     Started: 17:43:28.049150
    Duration: 135989.275 ms
     Changes:

Summary for microos-test
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time: 135.989 s

Expected behavior
nginx package is installed

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3007.3

Python Version:
        Python: 3.11.11 (main, Dec 06 2024, 17:06:18) [GCC]

Dependency Versions:
          cffi: 1.17.1
      cherrypy: 18.10.0
  cryptography: 44.0.1
      dateutil: 2.9.0.post0
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.5
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.1.0
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 24.1
     pycparser: 2.22
      pycrypto: Not Installed
  pycryptodome: 3.21.0
        pygit2: Not Installed
  python-gnupg: 0.5.4
        PyYAML: 6.0.2
         PyZMQ: 26.2.0
        relenv: Not Installed
         smmap: Not Installed
       timelib: 0.3.0
       Tornado: 6.4.1
           ZMQ: 4.3.5

Salt Package Information:
  Package Type: Not Installed

System Versions:
          dist: opensuse 15.6 n/a
        locale: utf-8
       machine: x86_64
       release: 6.4.0-150600.23.50-default
        system: Linux
       version: openSUSE Leap 15.6 n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduced salt-ssh command and inspect salt/modules/zypperpkg.py, especially _is_rpm_lock and install, along with the transactional_update module executor configuration. Verify the behavior on the reported openSUSE microOS setup. Done means the nginx state installs the package without the read-only filesystem error.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.