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

PHP Agent fails due to not running as sudo #82

Open
nvahalik opened this issue Apr 30, 2024 · 1 comment
Open

PHP Agent fails due to not running as sudo #82

nvahalik opened this issue Apr 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nvahalik
Copy link

nvahalik commented Apr 30, 2024

Description

When trying to use the apm-php target, it fails to install.

Steps to Reproduce

I have copied and pasted the sample from the repository, commenting out logs and adding my NRAK-* key and account ID.

Expected Behavior

The PHP Agent should be installed.

Relevant Logs / Console output

TASK [newrelic.newrelic_install : Report incomplete installs] ********************************************************
ok: [demo-server] => {
    "msg": {
        "node": "demo-server",
        "status": "INCOMPLETE",
        "summary": [
            "  Installation Summary",
            "",
            "  ✔  Infrastructure Agent  (installed)  ",
            "  ⊘  PHP Agent  (unsupported)  ",
            "  ⊘  NGINX Integration  (unsupported)  ",
            "",
            "  Installation was successful overall, however, one or more installations could not be completed.",
            "  Follow the instructions at the URL below to complete the installation process. ",
            "",
            "  ⮕  https://onenr.io/0OwvMNxAaQv",
            "",
            "  --------------------",
            "",
            "",
            "We encountered an issue during the installation: one or more selected recipes could not be installed.",
            "If this problem persists, visit the documentation and support page for additional help here at https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/get-started/requirements-infrastructure-agent/",
            "",
            ""
        ]
    }
}

Your Environment

Debian 11. Fresh install.

Additional context

This appears to be a known bug: https://forum.newrelic.com/s/hubtopic/aAXPh0000000bcHOAQ/php-agent-installation-via-ansible-is-not-working-unsupported

@nvahalik nvahalik added the bug Something isn't working label Apr 30, 2024
@tcarreira
Copy link

tcarreira commented May 21, 2024

There seems to be an easy fix for that PHP Agent (unsupported) : just add a SUDO_USER env

Quickfix:

- name: Install New Relic
  hosts: all
  roles:
    - role: newrelic.newrelic_install
      vars:
        targets:
          - infrastructure
          - logs
          - apm-php
        tags:
          foo: bar
  environment:
    SUDO_USER: root
    NEW_RELIC_API_KEY: <API key>
    NEW_RELIC_ACCOUNT_ID: <Account ID>
    NEW_RELIC_REGION: <Region>

This is caused by a poor check for admin under open-install-library

reported here: newrelic/open-install-library#1076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants