-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Undefined index errorCount at LoggerDataCollector #36159
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
Labels
Comments
Status: reviewed I'm looking at this issue. I think the easiest way to deal with this is simply to prepend a fixed string to the messages so numeric and message keys never collide. |
I ran into this issue when a Configuration TreeBuilder node used |
nicolas-grekas
added a commit
that referenced
this issue
Mar 31, 2020
…in the sanitized logs processing (fancyweb) This PR was merged into the 3.4 branch. Discussion ---------- [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #36159 | License | MIT | Doc PR | - `$sanitizedLogs` is used with numeric and "associative" keys. To prevent collisions when the message is a number, we can simply prepend all messages with a random letter (so we avoid a behavior refactor). It doesn't matter since they key is only used for the processing, it is dropped at the end. Commits ------- 79fe888 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing
symfony-splitter
pushed a commit
to symfony/http-kernel
that referenced
this issue
Mar 31, 2020
…in the sanitized logs processing (fancyweb) This PR was merged into the 3.4 branch. Discussion ---------- [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | symfony/symfony#36159 | License | MIT | Doc PR | - `$sanitizedLogs` is used with numeric and "associative" keys. To prevent collisions when the message is a number, we can simply prepend all messages with a random letter (so we avoid a behavior refactor). It doesn't matter since they key is only used for the processing, it is dropped at the end. Commits ------- 79fe888072 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing
@fancyweb thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected: >=3.4.37
Description
The following error might appear which blocks Debug Toolbar to be loaded:
How to reproduce
TBD
Such a log message might be thrown by:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Config/Definition/ArrayNode.php#L238
in case if configuration child is deprecated and depreciation message for some reason is "1"
Possible Solution
Fix logic of:
symfony/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
Line 168 in e60a876
symfony/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
Line 195 in e60a876
$sanitizedLogs
contains numeric and assoc. keys. It should be avoided:symfony/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
Line 175 in e60a876
symfony/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
Line 195 in e60a876
Additional Context
It happened because of incorrect passed deprecation message:
https://github.com/Sylius/SyliusMailerBundle/blob/1.4/src/Bundle/DependencyInjection/Configuration.php#L76
It was possible because of missing type hint:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Config/Definition/BaseNode.php#L170
which is fixed in 5.0 version of Symfony:
https://github.com/symfony/symfony/blob/5.0/src/Symfony/Component/Config/Definition/BaseNode.php#L204
The text was updated successfully, but these errors were encountered: