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 duplicating reports, errors may occur #4353

Closed
yingbaiibm opened this issue Jul 21, 2021 · 4 comments
Closed

When duplicating reports, errors may occur #4353

yingbaiibm opened this issue Jul 21, 2021 · 4 comments
Labels
bug Undesired behaviour unverified Some days we don't have a clue
Milestone

Comments

@yingbaiibm
Copy link

yingbaiibm commented Jul 21, 2021

  1. create a report
  2. duplicate it, check log error exist

2021/07/20 01:43:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/reports_admin.php[89]:reports_edit(), /lib/html_reports.php[1284]:reports_interval_start(), /lib/reports.php[190]:CactiErrorHandler())
2021/07/20 01:43:32 - ERROR PHP NOTICE: Undefined offset: 0 in file: /opt/IBM/cacti/lib/reports.php on line: 190
2021/07/20 01:43:30 - CMDPHP PHP ERROR NOTICE Backtrace: (/reports_admin.php[89]:reports_edit(), /lib/html_reports.php[1300]:reports_generate_html(), /lib/reports.php[704]:CactiErrorHandler())
2021/07/20 01:43:30 - ERROR PHP NOTICE: Undefined offset: 0 in file: /opt/IBM/cacti/lib/reports.php on line: 704
2021/07/20 01:43:14 - CMDPHP PHP ERROR NOTICE Backtrace: (/reports_admin.php[94]:reports(), /lib/html_reports.php[1643]:CactiErrorHandler())
2021/07/20 01:43:14 - ERROR PHP NOTICE: Undefined offset: 0 in file: /opt/IBM/cacti/lib/html_reports.php on line: 1643
2021/07/20 01:43:05 - CMDPHP PHP ERROR NOTICE Backtrace: (/reports_admin.php[94]:reports(), /lib/html_reports.php[1643]:CactiErrorHandler())
2021/07/20 01:43:05 - ERROR PHP NOTICE: Undefined offset: 0 in file: /opt/IBM/cacti/lib/html_reports.php on line: 1643
2021/07/20 01:43:05 - CMDPHP PHP ERROR WARNING Backtrace: (/reports_admin.php[58]:reports_form_actions(), /lib/html_reports.php[221]:duplicate_reports(), /lib/reports.php[44]:CactiErrorHandler())
2021/07/20 01:43:05 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /opt/IBM/cacti/lib/reports.php on line: 44

Test env:
Cacti 1.2.15
FF 89
rhel7 x64

@yingbaiibm yingbaiibm added bug Undesired behaviour unverified Some days we don't have a clue labels Jul 21, 2021
@xmacan
Copy link
Member

xmacan commented Jul 21, 2021

Tested on 1.2.18, found another warn and error:
2021-07-21 21:06:54 - ERROR PHP WARNING: Invalid argument supplied for foreach() in file: /usr/local/share/cacti_develop/lib/reports.php on line: 46
2021-07-21 21:06:54 - CMDPHP PHP ERROR WARNING Backtrace: (/reports_admin.php[58]:reports_form_actions(), /lib/html_reports.php[221]:duplicate_reports(), /lib/reports.php[46]:CactiErrorHandler())
2021-07-21 21:06:54 - ERROR PHP NOTICE: Undefined offset: 0 in file: /usr/local/share/cacti_develop/lib/html_reports.php on line: 1643
2021-07-21 21:06:54 - CMDPHP PHP ERROR NOTICE Backtrace: (/reports_admin.php[94]:reports(), /lib/html_reports.php[1643]:CactiErrorHandler())

I will look at it.

@ddb4github
Copy link
Contributor

How about move $fields_reports_edit from cacti/lib/reports.php to cacti/include/global_arrays.php?

@xmacan
Copy link
Member

xmacan commented Jul 22, 2021

I made small fix #4355

@netniV netniV added this to the 1.2.19 milestone Sep 5, 2021
@netniV
Copy link
Member

netniV commented Sep 5, 2021

@yingbaiibm any feed back on if this is now resolved?

netniV added a commit that referenced this issue Sep 5, 2021
@netniV netniV closed this as completed Sep 5, 2021
@netniV netniV changed the title php error when duplicate a report When duplicating reports, errors may occur Oct 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour unverified Some days we don't have a clue
Projects
None yet
Development

No branches or pull requests

4 participants