Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Night's Watch
-
3
-
NW - 2021-10-06
-
Needs Assessment
-
Bug Fix
-
-
Needs Assessment
Description
Puppet fails hard if it tries to install a package on Solaris 11 while a pkg install command is already running in the background.
pkg install fails with the following error:
root@initial-holdup:~# pkg install nano |
pkg: The image cannot be modified as it is currently in use by another package client. |
root@initial-holdup:~# echo $? |
7 |
The same error can be reproduced in a zone set up, if you execute pkg install something concurrently on global and the zone (the following output is from a puppet manifest with the nano package resource):
Debug: Executing: '/usr/bin/pkg install --accept --sync-actuators-timeout 900 nano' |
Error: Unable to update Startup: Linked image publisher check ... Done
|
pkg: install failed (linked image exception(s)):A 'pubcheck-linked' operation failed for child 'zone:devzone' with an unexpected |
return value of 7 and generated the following output: |
pkg: The image cannot be modified as it is currently in use by another package client. |
Error: /Stage[main]/Main/Package[nano]/ensure: change from 'absent' to 'present' failed: Unable to update Startup: Linked image publisher check ... Done |
pkg: install failed (linked image exception(s)):A 'pubcheck-linked' operation failed for child 'zone:devzone' with an unexpected |
return value of 7 and generated the following output: |
pkg: The image cannot be modified as it is currently in use by another package client. |
From the Solaris pkg manpages (https://docs.oracle.com/cd/E36784_01/html/E36870/pkg-1.html):
7: The image is currently in use by another process and cannot be modified.
From a Solaris KB article (https://docs.oracle.com/cd/E53394_01/html/E54739/nomodimg.html):
Try your pkg command again after the current package process exits (process 26604 in this example). If the process does not exit quickly, use ptree -a, for example, to begin to examine the process.
We probably need to implement a similar defense in Puppet, that checks to see if the pkg command failed with error code 7 and keeps retrying the command a number of times (tbd how many times & how often). 5 x 2^n; 1; 2; 4; 8; 16