Error 'chown: invalid group' during non-root Spectrum upgrade or install․
search cancel

Error 'chown: invalid group' during non-root Spectrum upgrade or install․

book

Article ID: 437348

calendar_today

Updated On:

Products

Network Observability Spectrum

Issue/Introduction

Note: This is only a problem when the OS install owner user and groups are different. 

A non-root upgrade fails during the post-installation step of the spectrum_nonroot_prepost_install.sh script because it attempts to assign group ownership to the install user instead of the install group․  

ERROR MESSAGE: "chown: invalid group: '[install_user]:[install_user]'"

 

Environment

Network Observability DX NetOps Spectrum

  • Product Release: All supported version prior to 25.4.7

  • Installation Type: Non-root install or upgrade.

  • OS: Any Linux version or flavour.
  • OS install owner user and group are different.

Cause

This only occurs when the environment uses a specific user and group for NetOps that do not share the same name (e.g., user 'spectrum' with group 'specadmin').

IMPACT: Prevents completion of post-installation steps and CAPKI deployment in non-root environments.

SYMPTOMS:

  • Upgrade fails at the post-installation stage (Option 2).

  • CAPKI fails to install during the non-root process.

  • Error occurs specifically when the script executes "chown -R $SPECOWNER:$SPECOWNER".

Resolution

This is resolved in version 25.4.7. 

For all supported versions prior: 

PREREQUISITES:

  • Access to the spectrum_nonroot_prepost_install.sh script.  This is located in the root directory of the install media.

  • Knowledge of the specific installation user and group for your environment.

A. Use the attached spectrum_nonroot_prepost_install.sh instead of the version that comes with the install media. Make sure to check the permissions and file ownership of the default file before replacing it.

e.g.

-rwxr-xr-x. 1 spectrum spectest      19839 Apr 16 16:14 spectrum_nonroot_prepost_install.sh

or.

B. Modify the file manually.

STEPS:

  1. Open the spectrum_nonroot_prepost_install.sh script in the install media root directory. 

  2. UPDATE USER AND GROUP SETTINGS:

    Find the logic for post-installation steps ..... elif [[ $whichstage == 2 ]]

    add the 2 lines in bold.

    elif [[ $whichstage == 2 ]]
    then
       eval `grep SPECROOT /opt/SPECTRUM/spectrum80.env`
       eval `grep SPECOWNER /opt/SPECTRUM/spectrum80.env`
       eval `grep HOST_NAME /opt/SPECTRUM/spectrum80.env`
       SS_INSTALL_OWNER=${SPECOWNER}
       SS_INSTALL_GROUP=$(id -gn ${SPECOWNER})
       sed_param=s/USER=.*/USER=${SPECOWNER}/

       echo "SPECROOT folder $SPECROOT"
       echo "Install user $SPECOWNER "
       echo "Install group $SS_INSTALL_GROUP"


  3. CORRECT OWNERSHIP COMMANDS:

    Find and update the install_capki function within the script to use the defined install group instead of the owner variable for group ownership. 

    install_capki()
    {
        echo "Installing capki"
        $SPECROOT/Install-Tools/CAPKI/setup install caller=SPECTRUM env=all
        chown -R $SPECOWNER:$SS_INSTALL_GROUP /opt/CA/SharedComponents
    }

    Original: chown -R $SPECOWNER:$SPECOWNER /opt/CA/SharedComponents
    Modified: chown -R $SPECOWNER:$SS_INSTALL_GROUP /opt/CA/SharedComponents


  4. EXECUTE POST-INSTALLATION:

    Run the modified script and select option 2 for post-installation steps.

    Command: sudo ./spectrum_nonroot_prepost_install.sh

VERIFY SUCCESS:

  • Script completes without 'invalid group' errors.

  • Output displays: "Installing capki" followed by "Executing Postinstallation Steps Has Ended".

  • Verification of CAPKI installation in /opt/CA/SharedComponents.

Additional Information

Use the id <username> function in Linux to see what groups user is tied to.

getent group (cat /etc/group does not include LDAP) to verify user group e.g
spectrum:x:1009:

getent passwd      to check user group e.g.
spectrum:x:1003:1009::/home/spectrum:/bin/bash

Attachments

spectrum_nonroot_prepost_install.sh get_app