DataDog/ansible-datadog

Error when installing MacOS agent

cottinger13 opened this issue · 3 comments

When I try and install the MacOS agent I run into an error after attaching the dmg image, specifically at the "Unpack and copy Datadog Agent files". Its running the following command:

/usr/sbin/installer -pkg "find "/Volumes/datadog_agent" -name \*.pkg 2>/dev/null" -target /, which is the same code that datadog also runs using a bash script found here: https://github.com/DataDog/datadog-agent/blob/main/cmd/agent/install_mac_os.sh

But it fails on this step and I see the following error:
installer: Package name is Agent
installer: Upgrading at base path /
installer: The upgrade failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An error occurred while running scripts from the package “datadog-agent-7.41.1-1.pkg”.)

If I turn around and run the install again, it skips the Unpack and copy Datadog Agent files step, creates the configs, changes permissions, etc and completes successfully. I can add a rescue block but seems like there might be something else that is happening. I also ran the command manually and get the same error.

More info:
Running the install of Mac Mini's that have different Mac OS versions.
Get the same error on all OS versions
I've tried several agents versions in 6 and 7 to try and eliminate a specific agent version causing the issue but all versions produce the same error.
Ran manually and get the same error
If I install just using the GUI, I dont get the error.
Had one occurrence where the rescue block didn't work and when I checked the status of the agent I saw an error indicating the authorized_token file had not been created.

Look like the issue was on my end. I didn't realize that datadog_macos_user was defaulting to ansible_user. Once I changed that the installer worked.

Thanks for the update. Do you have a suggestion for documenting this more prominently or do you think we should just go ahead and close this?

I'm going to go ahead and close this, but feel free to reopen if you have suggestions on better documenting this. Thanks!