Git Product home page Git Product logo

Comments (21)

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Hello @JanThiel !
Thank you for this report (perfect, as always).
Let me find what's going on…

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Hello @JanThiel !
I'm currently working on this fu***ng issue and wondering if you're in development or production profile (I think it's development profile, but I need to be sure)?

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

I've made a fix what I assume is the error. I will release the new version in some minutes ;)

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Although it might be too late, the environment is setup with these:

define( 'WP_ENVIRONMENT_TYPE', 'staging' );
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', false );
define( 'SAVEQUERIES', true );

I believe that triggers DEV mode :-)

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Yes :)
Normally, the 3.6.3 release solves this problem. Can you provide me with feedback once you have tested it? Nothing urgent, eh!

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Just tested and it looks fixed to me :-) Thank you very much Pierre!

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Hey @Pierre-Lannoy I do have to reopen this issue. 3.6.3 and more sites on PHP 8.1 are popping this error again.

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Hello @JanThiel !
Sorry to hear that :/
That's very strange, I haven't released new version since some months now.
Did you have modified something to wp-cli (version, environment, etc.)?

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Hmmm ... wait a sec ... It's not PHP8 related obviously. The page that's causing the issues is still on PHP 7.4.
In this particular case the issue is triggered by ObjectCachePro (Redis Object Cache implementation)

image

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

I believe the source of the issue is within a try/catch block when an exception is thrown.

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Wait, too much speed for me ;)
So, your website is executed with PHP 7.4. When an error is thrown in ObjectCachePro, you have a huge flood of "Metric not found" in your log. Am I right?
Is it only when you use wp-cli with PHP 8.1?

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

So, your website is executed with PHP 7.4

Yes

When an error is thrown in ObjectCachePro, you have a huge flood of "Metric not found" in your log. Am I right?

Yes

Is it only when you use wp-cli with PHP 8.1?

This was no CLI context at all. In particular this was a call against the REST API

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Hello @JanThiel !

Can you give some details about your DecaLog configuration and how this error is produced (i.e. why and when the OCPro error is thrown) ? I almost sure it is not the same as the previous one…

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

@Pierre-Lannoy Sure as always!

This is the Decalog Config:

define('DECALOG_DEFAULT_LOGGERS', array(
  '113b90f4-3e4f-4909-b01e-11c4ed84db11' => array (
    'name' => 'Datadog Events',
    'handler' => 'DatadogHandler',
    'running' => true,
    'level' => '250',
    'privacy' => array (
      'obfuscation' => false,
      'pseudonymization' => false,
    ),
    'processors' => array (
      0 => 'WordpressProcessor',
      1 => 'WWWProcessor',
      2 => 'IntrospectionProcessor',
      3 => 'BacktraceProcessor',
    ),
    'configuration' => array (
      'host' => 'https://http-intake.logs.datadoghq.eu/v1/input',
      'token' => '<TOKEN>',
      'buffer' => true,
    ),
  )
));

And this is the code triggering the log entries:

::command
        ....
        try {
            $result = $node->command($name, $parameters);

            $this->lastCommand = $node->lastCommand;

            return $result;
        } catch (Throwable $th) {
            try {
                $this->connectToSentinels();
            } catch (ConnectionException $ex) {
                throw new ConnectionException($ex->getMessage(), $ex->getCode(), $th);
            }
        }
        ....
::connectToSentinels
           ....
            try {
                $this->sentinel = $url;
                $this->establishConnections($url);
                $this->setPool();

                return;
            } catch (Throwable $error) {
                $this->sentinels[$url] = false;

                if ($this->config->debug) {
                    error_log('objectcache.notice: ' . $error->getMessage());
                }
            }
            ...

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Thanks @JanThiel 😊
I've found where it comes from. It's a "snake biting its own tail" problem: this exception (thrown by OCPro) is thrown at a time when metrics have not been already defined in DecaLog (it is very early in the loading sequence, which makes sense regarding what OCPro is doing). And DecaLog try to increment a PHP error counter which is inexistent…
The only way to get around this is to have an option to "bypass" this behavior. It will be implemented in 3.7.0 but note it will not be activated by default. So, you will have to UNCHECK "Warn about non existent metrics" in options to activate this new behavior.

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Sounds reasonable :-)
Great job undigging that ugly timing issue...

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Version 3.7.0 released. Could you confirm it fixes this issue?

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Hi @Pierre-Lannoy,

took some time. Sorry for that.
We sadly can still reproduce this issue with 3.7.1. Caused by the exact same Code as before.

from wp-decalog.

Pierre-Lannoy avatar Pierre-Lannoy commented on September 23, 2024

Hi @JanThiel
Wow! I'm just asking as a matter of fact but I'm sure the answer is yes: is the corresponding option unchecked ("Warn about non-existent metrics")?

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

🤔 No, to be honest I did not change any settings - wasn't aware of that :-/. So that is most probable the reason why it wasn't "fixed" :-)

I changed that setting now and will report back within the next weeks which is hopefully free of this error then :)

from wp-decalog.

JanThiel avatar JanThiel commented on September 23, 2024

Looks god now. Sorry for the confusion. I close this issue.

Best Regards!

Jan

from wp-decalog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.