Skip to content

matomo.php returns HTTP 200 when unable to connect to redis #97

Description

@toredash

If matomo is configured to use QueuedTracking with Redis as backend, and matomo.php is unable to connect to such Redis instance, HTTP 200 is returned.

I would expect matomo.php return !200. For monitoring the availability of the tracker API, it makes it harder to validate that the Tracker API is healthy.

The error msg that is returned:

<br />
<b>Warning</b>:  Redis::connect(): connect() failed: Cannot assign requested address in <b>/var/www/html/vendor/piwik/cache/src/Backend/Factory.php</b> on line <b>60</b><br />
<br />
<b>Fatal error</b>:  Uncaught RedisException: Redis server went away in /var/www/html/vendor/piwik/cache/src/Backend/Factory.php:70
Stack trace:
#0 /var/www/html/vendor/piwik/cache/src/Backend/Factory.php(70): Redis-&gt;select(0)
#1 /var/www/html/vendor/piwik/cache/src/Backend/Factory.php(108): Piwik\Cache\Backend\Factory-&gt;buildRedisCache(Array)
#2 /var/www/html/core/Cache.php(75): Piwik\Cache\Backend\Factory-&gt;buildBackend('redis', Array)
#3 /var/www/html/config/global.php(67): Piwik\Cache::buildBackend('redis')
#4 [internal function]: DI\Definition\Source\DefinitionFile-&gt;{closure}(Object(DI\Container))
#5 /var/www/html/vendor/php-di/invoker/src/Invoker.php(82): call_user_func_array(Object(Closure), Array)
#6 /var/www/html/vendor/php-di/php-di/src/DI/Definition/Resolver/FactoryResolver.php(81): Invoker\Invoker-&gt;call(Object(Closure), Array)
#7 /var/www/html/vendor/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php(58): DI\Definition\Resolver\FactoryResolver-&gt;resolve(Object(DI\Definition\FactoryDefinition), Array)
#8 /var in <b>/var/www/html/vendor/piwik/cache/src/Backend/Factory.php</b> on line <b>70</b><br />```

Headers returned:
```Request URL: X/matomo.php
Request Method: GET
Status Code: 200 ```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions