Agent install broken on macOS Catalina 10.15.6?

Running macOS Catalina 10.15.6 (recently released) and the BigFix 9.5.14.73 installer won’t install the agent. In the middle of the install, it pops up the following message (that I’ve not seen before) and then fails:

"Installer" would like to access files in your Documents folder

The BESAgent.log file has nothing of particular interest:

Tue Jul 21 13:05:02 EDT 2020: preinstall: Package is: "/Users/me/here/BESAgent-9.5.14.73-BigFix_MacOSX10.7.pkg"
Tue Jul 21 13:05:02 EDT 2020: preinstall: Package Path is: "/Users/me/here"
Tue Jul 21 13:05:02 EDT 2020: preinstall: actionsite.afxm found in /Users/me/here and copied to /Library/Application Support/BigFix/BES Agent
Tue Jul 21 13:05:02 EDT 2020: preinstall: Stopping BESAgent
Tue Jul 21 13:05:17 EDT 2020: preinstall: Prepared to Install/Upgrade BESAgent
Tue Jul 21 13:06:29 EDT 2020: postinstall: Package is: "/Users/me/here/BESAgent-9.5.14.73-BigFix_MacOSX10.7.pkg"
Tue Jul 21 13:06:29 EDT 2020: postinstall: Package Path is: "/Users/me/here"
Tue Jul 21 13:06:29 EDT 2020: postinstall: No /Library/BESAgent/BESAgent.app found. Aborting

Anyone else running into this, or am I the first? :slight_smile:

The prompt gives options of Don't Allow and OK. Neither option seems to make a difference.

After running the BESAgentUninstaller.sh script a couple times to make sure nothing’s been left behind, the installers for BESAgent 9.5.15.71 and 9.5.16.90 fail in the same fashion. :frowning:

Have you tried the BigFix 10.x agent installer? I know it has some MacOS fixes.

Can you use a 10.x agent to connect to a 9.5.15 server?

Same exact problem with the 10.0.0.133 installer. :frowning_face:

1 Like

Yes, you can. Not ideal, but for newer OS support, using the newest agent is best.

This is odd, the agent does work on Catalina generally.

It seems like maybe it is trying to do an upgrade?

Also, can you try running the installer from somewhere else? Like /tmp ?

I’ll try those. I’m also setting up a fresh Catalina VM to make sure it’s not my environment.

1 Like

In case anyone cares, I figured out the problem.

The BigFix installer for macOS is built as a “relocatable installer”, meaning that, if the installer does not find the software already installed in the expected location, it will look for it elsewhere on the hard drive and try to update it there. I had been working on re-packaging the BigFix installer and had extracted copies of several different versions on my hard drive. The BigFix installer stopped when it found a match and tried to upgrade that copy. The issue is that the BigFix installer expects that the agent has been installed in /Library/BESAgent and exits with an error when it doesn’t find it there.

The long term solution is that HCL really needs to build the macOS installer as non-relocatable.
The short term solution is for me to delete my extracted copies. :smile:

2 Likes

Does this have any negative consequences? Would this prevent installation on another volume? What do we change to do this?

This is something @hansen_m @rustymyers and others have run into before. It does seem like a good idea to fix it.

I would recommend filing an enhancement for this in the bigfix ideas portal with as much info as you can possibly provide, as well as a link to this forum post: HCL Software - Sign In

I thought this was fixed already in the latest installers. I can’t see any relocate reference in the Distribution XML for BESAgent-9.5.14.73-BigFix_MacOSX10.7.pkg. Where did you get that package?

…Oh wait, did you repackage the agent and enable relocate?

The BigFix installer does not actually permit installation on another volume. At least, the 9.5.14.73 installer that I’m currently testing only allows “Install for all users of this computer” and disallows “Install for me only” and :Install on a specific disk…". In addition, the postinstall script in the installer looks for a “/Library/BESAgent/BESAgent.app” file and fails if one does not exist:

clientDir="/Library/BESAgent"
clientAppDir="$clientDir/BESAgent.app"
appPList="/Library/Preferences/com.bigfix.BESAgent.plist"
    ######################################################################################
# Make Application directory what we need it to be
 if [ ! -d "$clientAppDir" ]; then
 	Log "No $clientAppDir found. Aborting"
 	exit 1
 fi

Downloaded from support.bigfix.com two days ago, running raw, no repackaging.

Granted, I understand that this is an odd case… how many computers will have an extracted copy of BESAgent.app somewhere else on their computer? It would make sense, however, to set an installer that is not relocatable to be not relocatable. It seems that HCL may have already done this on more recent installers, so I’ll stop now, satisfied. :slight_smile:

I agree with @straffin.

2020-07-23 13:26:53-04 MAC installd[40684]: PackageKit: Library/BESAgent/BESAgent.app relocated to Users/rzm102/Desktop/BESAgent.app

I was wrong, it’s not fixed. I just didn’t run into it because I didn’t have the agent elsewhere on my system again.

1 Like

It moved from the Distribution file to the PkgInfo file.

<relocate>
    <bundle id="com.bigfix.BESAgent"/>
</relocate>

In that case, I’ll go ahead and submit it to the ideas portal (along with some other macOS agent fixes I’ve been sitting on for far too long).

From what I understand, this is the default result of pkgbuild and needs to be explicitly overridden (as per Relocatable Package Installers and quickpkg Update – Scripting OS X).

Python code to remove it

# Function to remove 'relocate' tags
# This forces installer to place files in correct location on disk
def derelocatePacakge(distroPath):
    # Open Distribution file passed to function
    tree = ET.parse(distroPath)
    # Get the root of the tree
    root = tree.getroot()
    # Should we add replocate?
    relocate_pkg_ref = False
    # Check each child
    for child in root:
        # If it's a pkg-ref
        print "child: {}".format(child)
        if child.tag == "relocate":
            # Remove the whole child
            root.remove(child)
    # Remove old Distribution file
    os.remove(distroPath)
    # Write new Distribution file
    tree.write(distroPath)

Yeah, but then I’d have to re-sign and re-notarize the PKG. I’d rather have HCL fix it. :smiley:

True, but we do that anyway. We customize the preinstall and shove the masthead inside so we don’t have lingering files.