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

When Resource XML file inproperly formatted, graph creation can fail with errors #4865

Closed
BaptisteVlt opened this issue Jul 18, 2022 · 5 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Milestone

Comments

@BaptisteVlt
Copy link

BaptisteVlt commented Jul 18, 2022

Hello,

I run my cacti server on Centos 7.
Recently I tried to create a new graph and I got errors after that in my logs :

--
2022/07/18 10:25:38 - ERROR PHP WARNING: Illegal string offset 'direction' in file: /var/www/html/cacti/graphs_new.php on line: 826
2022/07/18 10:25:38 - CMDPHP PHP ERROR WARNING Backtrace: (/graphs_new.php[68]:graphs(), /graphs_new.php[670]:CactiErrorHandler())
2022/07/18 10:25:38 - ERROR PHP WARNING: Illegal string offset 'direction' in file: /var/www/html/cacti/graphs_new.php on line: 670

image
I compare the file graphs_new.php that I've to other ones and it looks like everything is normal.
Just cause I'm curious I ran 'systemctl status cactid' on my server and I got the error :
"Failed to start Cacti Daemon Main Poller Service"
I guess there is a link between this 2 problems.
Cacti version : 1.2.21.

@BaptisteVlt BaptisteVlt added bug Undesired behaviour unverified Some days we don't have a clue labels Jul 18, 2022
@TheWitness
Copy link
Member

What data query were you using? Can you upload the Resources XML file here for us to review.

@BaptisteVlt
Copy link
Author

I'm using data query that I found on the forum. This is data query for iDirect :
At this moment I was trying to use down snr graph.
data_query.zip

@TheWitness
Copy link
Member

The XML files have some illegal characters in them. Notice in the attached image the following

image

Get rid of those illegal characters and I think the problem will be solved. I will put in a patch to mask the error, but my guess is that we should be handling this better. In any event, it's a Resource XML file issue. Occurs in all of them.

image

@TheWitness TheWitness changed the title ERROR PHP WARNING: Illegal string offset XML Pre-processing during Graph Creation throws error when Resource XML file inproperly formatted Jul 19, 2022
TheWitness added a commit that referenced this issue Jul 19, 2022
This fix provides additional clarity on the errors being encountered in this bug.
@TheWitness
Copy link
Member

Test the update before you fix the XML files.

@BaptisteVlt
Copy link
Author

Thank you very much. I'm sorry that I didn't notice that before ..

@TheWitness TheWitness added resolved A fixed issue confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Jul 20, 2022
@TheWitness TheWitness added this to the v1.2.22 milestone Jul 20, 2022
@netniV netniV changed the title XML Pre-processing during Graph Creation throws error when Resource XML file inproperly formatted When Resource XML file inproperly formatted, graph creation can fail with errors Aug 14, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 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 resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants