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

Deprecation warnings when attempting real-time Graphs with PHP8.1 #4853

Closed
manhvu1997 opened this issue Jul 1, 2022 · 8 comments
Closed
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team PHP8 Issue related to PHP8 resolved A fixed issue
Milestone

Comments

@manhvu1997
Copy link

manhvu1997 commented Jul 1, 2022

I installed cacti 1.2.20. I created a graph and device success, but when I viewed the graph in realtime, I faced the issue below:
image

The log file said:
2022-07-01 12:44:11 - ERROR PHP DEPRECATED: Implicit conversion from float 35.4375 to int loses precision in file: /var/www/html/cacti/lib/rrd.php on line: 3670
2022-07-01 12:44:11 - CMDPHP PHP ERROR Backtrace: (/graph_realtime.php[244]:rrdtool_create_error_image(), /lib/rrd.php[3670]:wordwrap(), CactiErrorHandler())

Can you help me to fix that?

@manhvu1997 manhvu1997 added bug Undesired behaviour unverified Some days we don't have a clue labels Jul 1, 2022
@netniV netniV removed the unverified Some days we don't have a clue label Jul 1, 2022
@netniV
Copy link
Member

netniV commented Jul 1, 2022

This bug still exists under v1.2.22, what PHP version are you running?

@netniV netniV added the PHP8 Issue related to PHP8 label Jul 1, 2022
@netniV netniV added this to the v1.2.22 milestone Jul 1, 2022
@manhvu1997
Copy link
Author

Thanks for your reply
My PHP version is 8.1

@TheWitness
Copy link
Member

I saw this the other day and neglected to look into it.

@manhvu1997
Copy link
Author

How can I change the PHP core from PHP 8.1 to PHP 7.4 on cacti?
image

@TheWitness
Copy link
Member

You should not need to downgrade as this is a very narrowly defined error and only happens when your Data Sources have not had their RRDfiles created. But if you still want to do it, you need to do it through aptitude (apt).

@TheWitness TheWitness changed the title Can't view graph realtime Deprecation warnings when attempting real-time Graphs with PHP8.1 Jul 1, 2022
TheWitness added a commit that referenced this issue Jul 1, 2022
Deprecation warnings when attempting real-time Graphs with PHP8.1
@TheWitness TheWitness added resolved A fixed issue confirmed Bug is confirm by dev team labels Jul 1, 2022
@manhvu1997
Copy link
Author

I fixed it, but I faced new issue, can you help me to fix this:
image

@TheWitness
Copy link
Member

TheWitness commented Jul 2, 2022

Closing this one now as the first bug was fixed.

This second issue is better served on the forums as its not a bug.

Basically, you database is setup using one collation/charset and was not fully migrated.

Best thing to do is go to Console > System Utilities > Technical Support then scroll to the bottom to see how wrong your charset and collation are from the database side.

Then make the required changes and restart the database. After that, reverify from that page, and if all is good, run the CLI script convert_tables.php using the utf8 option and innodb options.

@manhvu1997
Copy link
Author

Thank you theWitness
All proplems were solved by running command "/usr/bin/php /var/www/html/cacti/cli/convert_tables.php --debug --innodb --utf8"

@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team PHP8 Issue related to PHP8 resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants