Skip to content

Undefined variable errors may occur when creating a new datasource #3903

@paulgevers

Description

@paulgevers

Describe the bug

As you probably remember, I am running a web crawl in the Debian test framework for the Cacti package. I uploaded Cacti to Debian unstable yesterday, but the test framework shows regressions for all architectures the test is run on: https://qa.debian.org/excuses.php?package=cacti

To Reproduce

Steps to reproduce the behavior:

  1. Install a fresh cacti instance

  2. Go to 'http://localhost/cacti/data_queries.php?action=edit'

  3. Look into the cacti.log file

  4. See

2020/11/04 21:19:19 - ERROR PHP NOTICE: Undefined variable: snmp_query in file: /usr/share/cacti/site/data_queries.php  on line: 1194
2020/11/04 21:19:19 - CMDPHP PHP ERROR NOTICE Backtrace:  (/data_queries.php[100]:data_query_edit(), /data_queries.php[1194]:CactiErrorHandler())
2020/11/04 21:19:19 - ERROR PHP NOTICE: Trying to access array offset on value of type null in file: /usr/share/cacti/site/data_queries.php  on line: 1194
2020/11/04 21:19:19 - CMDPHP PHP ERROR NOTICE Backtrace:  (/data_queries.php[100]:data_query_edit(), /data_queries.php[1194]:CactiErrorHandler())
2020/11/04 21:19:19 - ERROR PHP NOTICE: Undefined variable: snmp_query_graph in file: /usr/share/cacti/site/data_queries.php  on line: 1195
2020/11/04 21:19:19 - CMDPHP PHP ERROR NOTICE Backtrace:  (/data_queries.php[100]:data_query_edit(), /data_queries.php[1195]:CactiErrorHandler())
2020/11/04 21:19:19 - ERROR PHP NOTICE: Trying to access array offset on value of type null in file: /usr/share/cacti/site/data_queries.php  on line: 1195
2020/11/04 21:19:19 - CMDPHP PHP ERROR NOTICE Backtrace:  (/data_queries.php[100]:data_query_edit(), /data_queries.php[1195]:CactiErrorHandler())
2020/11/04 21:19:19 - ERROR PHP NOTICE: Undefined variable: snmp_query in file: /usr/share/cacti/site/data_queries.php  on line: 1198
2020/11/04 21:19:19 - CMDPHP PHP ERROR NOTICE Backtrace:  (/data_queries.php[100]:data_query_edit(), /data_queries.php[1198]:CactiErrorHandler())
2020/11/04 21:19:19 - ERROR PHP NOTICE: Trying to access array offset on value of type null in file: /usr/share/cacti/site/data_queries.php  on line: 1198
2020/11/04 21:19:19 - CMDPHP PHP ERROR NOTICE Backtrace:  (/data_queries.php[100]:data_query_edit(), /data_queries.php[1198]:CactiErrorHandler())

Expected behavior

No new errors with respect to previous Cacti versions when recursively crawling the full Cacti website.

Desktop (please complete the following information)

  • OS: Linux

  • Browser: wget and Firefox-esr

Additional context

https://ci.debian.net/data/autopkgtest/testing/amd64/c/cacti/7954737/log.gz

Metadata

Metadata

Assignees

Labels

bugUndesired behaviourresolvedA fixed issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions