Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11208

Puppet fails to install packages on Solaris if another pkg install is running

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.25.0, PUP 7.12.0
    • None
    • Night's Watch
    • 3
    • NW - 2021-10-06
    • Needs Assessment
    • Bug Fix
    • Hide
      On Solaris, installing packages with `pkg` when another instance of `pkg` is already running is not supported. This can happen if Puppet runs in a zone setup, and Puppet runs in different zones happen to run the `pkg install` command at the same time. Now Puppet will retry the install command 5 times (waiting 1s, 2s, 4s, 8s, 16s between runs), ultimately failing if the package could not be installed.
      Show
      On Solaris, installing packages with `pkg` when another instance of `pkg` is already running is not supported. This can happen if Puppet runs in a zone setup, and Puppet runs in different zones happen to run the `pkg install` command at the same time. Now Puppet will retry the install command 5 times (waiting 1s, 2s, 4s, 8s, 16s between runs), ultimately failing if the package could not be installed.
    • 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

      Attachments

        Activity

          People

            dorin.pleava Dorin Pleava
            gabriel.nagy Gabriel Nagy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support