Skip to content

Excessive logging of hookImplementationsMap[hook]: invalid key or value #1099

@richardgaunt

Description

@richardgaunt

Description

This started with the upgrade to 11.10.0.24 for new relic php agent

We are getting many, many (1000s) of logs during deployment:

hookImplementationsMap[hook]: invalid key or value

This log was implemented as part of: #1030

I have run a check within my code base validating the hookImplementationsMap (in ModuleHandler) but cannot see any issue with the ModuleHandler::hookImplementationsMap

See below (I may have got something wrong as the c code is not easily readable for a php developer - please let me know and I can reimplement in my code base):

protected function isValidImplementation() {
    foreach ($this->hookImplementationsMap as $hook_key => $hook_value) {
      // Remimplementing
      //      if (NULL == key || 0 == ZEND_STRING_LEN(key)
      //        || 0 == nr_php_is_zval_valid_array(val)
      //        || 0 == zend_hash_num_elements(Z_ARRVAL_P(val))) {
      //        return true;
      //      } else {
      //        return false;
      //      }

      if ($hook_key === NULL || $hook_value === '' || !is_array($hook_value) || count($hook_value) === 0) {
        return $hook_key;
      }
    }
  }

Steps to Reproduce

Deploy the server with the new relic

Expected Behavior

Should not be getting these logs.

Relevant Logs / Console output

warning: hookImplementationsMap[hook]: invalid key or value

Your Environment

We are utilising this image (note the new relic download and installation):

https://github.com/uselagoon/lagoon-images/blame/main/images/php-fpm/8.3.Dockerfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions