saltstack / saltstack/salt

[BUG] Upgrading salt masters on ubuntu 20.04 and 22.04 from 3006.2 to 3006.3 fails with "pre-installation script subprocess returned error exit status 8"

Open
#65,175 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

During the run of 'apt upgrade' on Ubuntu 22.04 and 20.04 at least, the upgrade fails. Full output of the upgrade command are listed below.

Reviewing the output, I found that the .preinst script for salt-common was throwing an error which shows up in the output as "usermod: user salt is currently used by process xxx". Manually running that script produced the same error. The process in question was the salt-api service.

As a workaround, I stopped both the salt-api and salt-master services and was able to successfully run the upgrade. Note that a failed upgrade can require running "apt --fix-broken install" instead of being able to run a clean "apt upgrade".

Complete output of the apt upgrade command, relative lines marked in with -->

# apt upgrade salt-api salt-common salt-master salt-minion
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
#
# You can verify the status of security fixes using the `pro fix` command.
# E.g., a recent Ruby vulnerability can be checked with: `pro fix USN-6219-1`
# For more detail see: https://ubuntu.com/security/notices/USN-6219-1
#
The following packages will be upgraded:
  salt-api salt-common salt-master salt-minion
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 42.8 MB of archives.
After this operation, 17.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/latest focal/main amd64 salt-minion amd64 3
006.3 [80.7 kB]
Get:2 https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/latest focal/main amd64 salt-master amd64 3
006.3 [93.0 kB]
Get:3 https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/latest focal/main amd64 salt-common amd64 3
006.3 [42.6 MB]
Get:4 https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/latest focal/main amd64 salt-api amd64 3006
.3 [64.8 kB]
Fetched 42.8 MB in 2s (23.8 MB/s)
(Reading database ... 118200 files and directories currently installed.)
Preparing to unpack .../salt-minion_3006.3_amd64.deb ...
Unpacking salt-minion (3006.3) over (3006.2) ...
Preparing to unpack .../salt-master_3006.3_amd64.deb ...
Unpacking salt-master (3006.3) over (3006.2) ...
Preparing to unpack .../salt-common_3006.3_amd64.deb ...
--> usermod: user salt is currently used by process 454
--> dpkg: error processing archive /var/cache/apt/archives/salt-common_3006.3_amd64.deb (--unpack):
--> new salt-common package pre-installation script subprocess returned error exit status 8
Preparing to unpack .../salt-api_3006.3_amd64.deb ...
Unpacking salt-api (3006.3) over (3006.2) ...
Errors were encountered while processing:
 /var/cache/apt/archives/salt-common_3006.3_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

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 by inspecting the salt-common .preinst script and reproducing the reported apt upgrade on Ubuntu 20.04 or 22.04, with salt-api and salt-master running. Use the documented usermod error and salt-api process as the starting point; done means the package upgrade completes without manually stopping services or requiring apt --fix-broken install.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, ubuntu
Domain
devops, infrastructure, operating-systems
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.