Suite CRM 8.5.1 Massive Log Spam of the below 4 lines

8.5.1. now running on a Virtualmin Virtual Server. PHP 8,.1.24 all compatibility matrix conditions met. Seems to run very well. But…

I am getting a massive amount of log spam as below in my php error log:

[15-Feb-2024 09:26:03 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 134
[15-Feb-2024 09:26:03 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 144
[15-Feb-2024 09:26:03 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Session::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Session.php on line 131
[15-Feb-2024 09:26:03 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Session::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /mydomain.com/public_html/crm/vendor/symfony/http-foundation/Session/Session.php on line 141

Same 4 lines repeated 1000’s of times.

It looks like some kind of PHP bug.

Can anyone assist in fixing this beofer I run out of log space.

Cheers
Tony

It seems you found some bit of code that still hasn’t been fixed up for PHP 8.1 compatibility.

It should be easy to fix, but only if you can get us a stack trace of the error, can you?

I am afraid you will have to talk me through that.

happy to jump on a google meet if that works. Please pm me.

Cheers
Tony

I also cannot upload any images like changing the logo or adding images to products. I can add an image to a user which is weird. When trying to change the logo I get an error popup telling me I need to use a jpeg or png. And of course I am using a png formatted as per the guidelines.

That activity seems to trigger the log spam above. Might be coincidental but seems connected.

So at this point it is of little use as we cannot do basic things like put our product inventory into the platform.

Cheers
Tony.

Sorry, I don’t have time for that. But on the upside, there are tons of pages in the internet explaining how to get stack traces from PHP.

It’s also ok if you decide you don’t want to put in that effort - I understand not everybody has the time or the interest in that sort of technical community participation. I was just asking because if you could get it, it would accelerate things.

Well if you have an example of how you would do that on an ubuntu 22.04 shared service I am happy to help.

There are a million articles out there.

If you are looking for specific information then post a suggested way you would do it! I am happy to help as we need to get this into production.

Cheers
Stephen

In public/legacy/config_override.php add the following setting:

$sugar_config['stack_trace_errors'] = true;

If the file doesn’t exist yet, create it with these contents:

<?php
$sugar_config['stack_trace_errors'] = true;

Note that the deprecated errors are surely not the cause of your issues. Those messages are just a warning for future developers, they don’t indicate any current problem with SuiteCRM. I see you have other threads with more issues, focus on those ones.

This is just about reducing log spam, so leave it for when you have your more urgent problems sorted. Good luck :+1:

[ EDITED to change a false to true. Sorry ]

2 Likes

Great thank you.

And where would you expect to see the output from the above changes?

Nothing additional shows up in the php error log!

Cheers
Tony

If the original errors are in the SuiteCRM log, that’s where the stack traces will appear, right after the lines you saw before.

If the original errors are in the php_errors.log, then the above setting won’t make a difference, and to get a stack trace you would need other complicated arrangements unless some kind soul would merge this (but I wouldn’t count on it, it’s been waiting since 2020…).

Yeah nothing shows up in suitecrm.log and essentially we see the same in the php error log.

Cheers

1 Like