matomo-org / matomo-org/device-detector

Array to string conversion with cache

Open
#8,090 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.5k
Forks
513
Avg merge
1d 21h
Merged PRs (30d)
11

Description

I’m noticing some errors in my logs when using DeviceDetector, both related to caching and PHP warnings. The errors appear when the package tries to save regex data to Redis or process certain vendor fragments.

[2025-08-25T13:18:26.656569+00:00] cache.WARNING: Failed to save key "DeviceDetector-646regexes-console" of type array: protocol error, got 'a' as reply type byte  {"key":"DeviceDetector-646regexes-console","exception":"[object] (RedisException(code: 0): protocol error, got 'a' as reply type byte\\n at /home/bas/app_1e8a7d42-ba90-4f14-bc0b-0ae8202e27ba/vendor/symfony/cache/Traits/Redis6Proxy.php:254)","cache-adapter":"Symfony\\\\Component\\\\Cache\\\\Adapter\\\\RedisAdapter"} []
[2025-08-25T13:18:26.657008+00:00] cache.WARNING: Failed to save key "console646-all" of type string: protocol error, got '"' as reply type byte  {"key":"console646-all","exception":"[object] (RedisException(code: 0): protocol error, got '\\"' as reply type byte\\n at /home/bas/app_1e8a7d42-ba90-4f14-bc0b-0ae8202e27ba/vendor/symfony/cache/Traits/Redis6Proxy.php:254)","cache-adapter":"Symfony\\\\Component\\\\Cache\\\\Adapter\\\\RedisAdapter"} []
[2025-08-25T13:18:26.657808+00:00] cache.WARNING: Failed to save key "DeviceDetector-646regexes-carbrowser" of type array. {"key":"DeviceDetector-646regexes-carbrowser","exception":null,"cache-adapter":"Symfony\\\\Component\\\\Cache\\\\Adapter\\\\RedisAdapter"} []
[2025-08-25T13:18:28.073341+00:00] cache.WARNING: Failed to save key "camera646-all" of type string. {"key":"camera646-all","exception":null,"cache-adapter":"Symfony\\\\Component\\\\Cache\\\\Adapter\\\\RedisAdapter"} []
[2025-08-25T13:18:28.075060+00:00] cache.WARNING: Failed to save key "DeviceDetector-646regexes-portablemediaplayer" of type array. {"key":"DeviceDetector-646regexes-portablemediaplayer","exception":null,"cache-adapter":"Symfony\\\\Component\\\\Cache\\\\Adapter\\\\RedisAdapter"} []
[2025-08-25T13:18:28.075574+00:00] php.ERROR: Warning: Array to string conversion {"exception":"[object] (ErrorException(code: 0): Warning: Array to string conversion at /home/bas/app_1e8a7d42-ba90-4f14-bc0b-0ae8202e27ba/vendor/matomo/device-detector/Parser/VendorFragment.php:44)"} []
[2025-08-25T13:18:28.076203+00:00] php.ERROR: Warning: Array to string conversion {"exception":"[object] (ErrorException(code: 0): Warning: Array to string conversion at /home/bas/app_1e8a7d42-ba90-4f14-bc0b-0ae8202e27ba/vendor/matomo/device-detector/Parser/VendorFragment.php:44)"} []
[2025-08-25T13:18:28.076450+00:00] php.ERROR: Warning: Array to string conversion {"exception":"[object] (ErrorException(code: 0): Warning: Array to string conversion at /home/bas/app_1e8a7d42-ba90-4f14-bc0b-0ae8202e27ba/vendor/matomo/device-detector/Parser/VendorFragment.php:44)"} []
[2025-08-25T13:18:28.076631+00:00] php.ERROR: Warning: Array to string conversion {"exception":"[object] (ErrorException(code: 0): Warning: Array to string conversion at /home/bas/app_1e8a7d42-ba90-4f14-bc0b-0ae8202e27ba/vendor/matomo/device-detector/Parser/VendorFragment.php:44)"} []
Environment:

Symfony 7.3
Redis : 8.0.2
PHP 8.4
matomo/device-detector version: 6.4.6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Parser/VendorFragment.php at line 44 and compare that warning with the Redis cache failures reported from Symfony\Component\Cache\Traits\Redis6Proxy.php at line 254. Reproduce the reported environment if possible, then determine whether the vendor-fragment warning and cache errors are related; done means the reported warnings and failed cache saves no longer occur for the affected inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, redis, symfony
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.