Skip to content
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

Spam in debug.log file #94

Closed
simonmaass opened this issue Jun 13, 2022 · 8 comments
Closed

Spam in debug.log file #94

simonmaass opened this issue Jun 13, 2022 · 8 comments

Comments

@simonmaass
Copy link

I am experiencing a log spam in debug.log - magento 2.4.4 and php8.1:

[2022-06-13T16:31:04.813915+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Response" for "Phalcon\Http\Message\ResponseFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Response\" for \"Phalcon\\Http\\Message\\ResponseFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.839274+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Response" for "Phalcon\Http\Message\ResponseFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Response\" for \"Phalcon\\Http\\Message\\ResponseFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.864525+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Stream" for "Phalcon\Http\Message\StreamFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Stream\" for \"Phalcon\\Http\\Message\\StreamFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.884219+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Stream" for "Phalcon\Http\Message\StreamFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Stream\" for \"Phalcon\\Http\\Message\\StreamFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.892928+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Request" for "Phalcon\Http\Message\RequestFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Request\" for \"Phalcon\\Http\\Message\\RequestFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.918881+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Request" for "Phalcon\Http\Message\RequestFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Request\" for \"Phalcon\\Http\\Message\\RequestFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.952301+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Uri" for "Phalcon\Http\Message\UriFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Uri\" for \"Phalcon\\Http\\Message\\UriFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:04.971579+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Uri" for "Phalcon\Http\Message\UriFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Uri\" for \"Phalcon\\Http\\Message\\UriFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:05.018918+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Response" for "Phalcon\Http\Message\ResponseFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Response\" for \"Phalcon\\Http\\Message\\ResponseFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:05.034931+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Response" for "Phalcon\Http\Message\ResponseFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Response\" for \"Phalcon\\Http\\Message\\ResponseFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:05.075022+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Request" for "Phalcon\Http\Message\RequestFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Request\" for \"Phalcon\\Http\\Message\\RequestFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []
[2022-06-13T16:31:05.089302+00:00] .DEBUG: Source class "\Phalcon\Http\Message\Request" for "Phalcon\Http\Message\RequestFactory" generation does not exist. {"exception":"[object] (RuntimeException(code: 0): Source class \"\\Phalcon\\Http\\Message\\Request\" for \"Phalcon\\Http\\Message\\RequestFactory\" generation does not exist. at vendor/magento/framework/Code/Generator.php:223)"} []

when i remove the sentry config from the .env then the logs disappear...

@simonmaass
Copy link
Author

@indykoning can you confirm this?

@lumnn
Copy link

lumnn commented Jul 14, 2022

I do also experience this on version 2.6.1

@dzschille
Copy link

Same here on Magento 2.4.4 and and 2.3.7.

@sebfie
Copy link

sebfie commented Sep 7, 2022

Same here 2.4.4

@indykoning
Copy link
Member

See my response here #79 (comment)
I am unable to get this to happen i'm afraid.

This probably works #79 (comment) however it makes no sense that that should happen and that it does not happen for other people.

@serzhik
Copy link

serzhik commented Feb 13, 2023

I have the same experience on 2.4.5-p1

@indykoning
Copy link
Member

We've done some more digging and sadly we're completely unable to fix this from our side.

The log spam should not cause any problems though.

Because of Magento's automatic Factory generation while developer mode is active it will try to generate factories for classes that don't exist, for packages that don't exist if you try to call class_exists
php-http/discovery is already catching this and checking the next file.
https://github.com/php-http/discovery/blob/69e1a26f51fb4c5c7f2e5f0903f83c6229df269b/src/ClassDiscovery.php#L239-L243

Magento tries to generate the class when you call it using the folowing function:
https://github.com/magento/magento2/blob/adc4105fcfbeee29d534482d8c6d9c5c1a193a0c/lib/internal/Magento/Framework/Code/Generator.php#L214

Which fails and throws an exception.
To be caught by the autoloader of Magento and gets logged to the debug log

https://github.com/magento/magento2/blob/adc4105fcfbeee29d534482d8c6d9c5c1a193a0c/lib/internal/Magento/Framework/Code/Generator/Autoloader.php#L55

It's all because of quirks and "features" of Magento's code and factory generation not playing too nice with class_exists.
However this should not be a problem in production environments where setup:di:compile has been run.

@indykoning
Copy link
Member

The only ways to really fix these messages in all environments is using the patch described here: #79 (comment)
Or by installing Phalcon which i cannot suggest as it is an entire framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants