Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APM Installation error #603

Closed
yashpalk opened this issue Aug 27, 2024 · 7 comments
Closed

APM Installation error #603

yashpalk opened this issue Aug 27, 2024 · 7 comments

Comments

@yashpalk
Copy link

yashpalk commented Aug 27, 2024

Hey there, I'm trying to install APM via this ansible role and am seeing the following error. Is there something that I need to update with my configuration or is this an internal role error?

Running Ansible [core 2.15.12] on a rhel8 host and setting the following variables:

    datadog_apm_instrumentation_enabled: host
    datadog_apm_instrumentation_libraries: [ "java" ]

Error:

TASK [datadog.dd.agent : Install APM inject library (dnf)] ***********************************************************************************************************************************************************************************
fatal: [<redacted>]: FAILED! => {"msg": "The conditional check 'not ansible_check_mode and ansible_pkg_mgr == \"dnf\" and (not datadog_installer_enabled or not datadog_installer_owns_injector)' failed. The error was: error while evaluating conditional (not ansible_check_mode and ansible_pkg_mgr == \"dnf\" and (not datadog_installer_enabled or not datadog_installer_owns_injector)): 'datadog_installer_owns_injector' is undefined. 'datadog_installer_owns_injector' is undefined\n\nThe error appears to be in '<redacted>/collections/ansible_collections/datadog/dd/roles/agent/tasks/pkg-redhat/install-apm-inject.yml': line 10, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Install APM inject library (dnf)\n  ^ here\n"}
@chouquette
Copy link
Contributor

Hi,
This is most likely an internal error, but I haven't been able to reproduce it.
Could you provide more insight on your config and ideally the full logs?

@yashpalk
Copy link
Author

Thanks, attaching the full logs for the agent role. Let me know if there are specific things you'd like to get insight on regarding our config, I think we use the defaults from the role other than the two ones listed above

datadog agent logs.txt

@chouquette
Copy link
Contributor

Hello, and sorry for the delay.
AFAICS it boils down to this task:

- name: RedHat Install Tasks                                                                          
  include_tasks: pkg-redhat.yml                                                                       
  when: ansible_facts.os_family in ["RedHat", "Rocky", "AlmaLinux"] and not agent_datadog_skip_install

being skipped while it shouldn't. This leads to a bunch of facts not being set. I'll dig further into it

@chouquette
Copy link
Contributor

Alright, I managed to reproduce this in a test. The culprit seems to be that a specific agent version is pinned in your config, which causes some shortcuts to kick in and they don't mix well with some of the newly added features.

I'll provide a fix soon and will link it to here. Thanks a lot for opening the issue and providing the logs!

chouquette added a commit that referenced this issue Sep 10, 2024
These are also responsible for setting up the installer, and doing some
bookkeeping around our GPG keys.
The installation of the agent package itself is already gated behind
agent_datadog_skip_install, so we won't attemp to reinstall the agent if
it's already installed to the latest version.
However we will now correctly probe for the installer ownership.
This should fix #603
@yashpalk
Copy link
Author

Sounds good, thanks for your help!

@yashpalk
Copy link
Author

Hey! Wanted to check when you plan to release the next version that will contain this change

@chouquette
Copy link
Contributor

Hello 👋

We do plan on releasing a new version of the role early next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants