saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
13.98k stars 5.47k forks source link

[BUG] Error trying to install packages with zypper in AutoYaST process #66595

Closed argalad closed 1 month ago

argalad commented 1 month ago

I am trying to execute some Salt states in the process of an automated SUSE installation using AutoYaST, and in one of the lasts processes of the installation, the AutoYaST post-configuration scripts, I execute some Salt states that try to perform a zypper installation of packages using pkg.installed or cmd.run execute, but they turn into these errors:

[ERROR] Command 'zypper' failed with return code: 7
[ERROR] stderr: System management is locked by the application with pid 3348 (/usr/bin/ruby.ruby2.5).
Close this application before trying again.

My .sls files look like this:

install_alacritty:
  pkg.installed:
    - skip_verify: True 
    - sources: 
        - Alacritty: /tmp/rpm/Alacritty/alacritty-0.12.0-bp155.1.5.x86_64.rpm

I have tried using this other state with the same result:

install_alacritty:
  cmd.run:
    - name: zypper --no-gpg-checks install -y /tmp/rpm/Alacritty/alacritty-0.12.0-bp155.1.5.x86_64.rpm

It doesn't matter where I execute the states, in VMs or real machines, the outcome is the same. If the system is installed and running and I execute those states, they turn out fine, the problem it's just in this post-configuration script process of AutoYaST.

Anyone has any idea why might this occur?

welcome[bot] commented 1 month ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

argalad commented 1 month ago

It seems I was executing the commands in the "post-scripts" and not in the "init-scripts" where all the services are up and running.