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

Report gets resent every poller cycle #3237

Closed
vKnmnn opened this issue Feb 5, 2020 · 9 comments
Closed

Report gets resent every poller cycle #3237

vKnmnn opened this issue Feb 5, 2020 · 9 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@vKnmnn
Copy link

vKnmnn commented Feb 5, 2020

I have a report that collects certain graphs from a tree of around 40 devices and runs a regex on them to find only those with a certain word in them. When the time comes for the Report to be sent out, the report gets sent on first try but logs the following error:

05.02.2020 13:12:44 - PCOMMAND Device[203] WARNING: Recache Event Detected for Device
05.02.2020 13:12:45 - REPORTS Cacti Reports reports found: 1
05.02.2020 13:12:45 - REPORTS Reports processing report: MPLS Reports
05.02.2020 13:12:45 - REPORTS TRACE generate_report, report_id: 7
05.02.2020 13:12:45 - REPORTS TRACE reports_generate_html, items found: 1
05.02.2020 13:12:45 - REPORTS TRACE reports_generate_html, item_id: 53 local_graph_id: 0
05.02.2020 13:13:15 - ERROR PHP WARNING: stream_select(): unable to select [4]: Unterbrechung während des Betriebssystemaufrufs (max_fd=11) in file: /usr/share/cacti/site/include/vendor/phpmailer/src/SMTP.php  on line: 1125
05.02.2020 13:13:15 - CMDPHP PHP ERROR WARNING Backtrace:  (/poller_reports.php[143]:generate_report(), /lib/reports.php[480]:mailer(),/lib/functions.php[3674]:PHPMailer\PHPMailer\PHPMailer->send(), /include/vendor/phpmailer/src/PHPMailer.php[1352]:PHPMailer\PHPMailer\PHPMailer->postSend(), /include/vendor/phpmailer/src/PHPMailer.php[1516]:PHPMailer\PHPMailer\PHPMailer->smtpSend(), /include/vendor/phpmailer/src/PHPMailer.php[1805]:PHPMailer\PHPMailer\SMTP->data(), /include/vendor/phpmailer/src/SMTP.php[714]:PHPMailer\PHPMailer\SMTP->sendCommand(), /include/vendor/phpmailer/src/SMTP.php[904]:PHPMailer\PHPMailer\SMTP->get_lines(), /include/vendor/phpmailer/src/SMTP.php[1125]:stream_select(), CactiErrorHandler())
05.02.2020 13:13:15 - MAILER WARNING: Mail failed via SMTP from 'Cacti <xxxxxx@xxxxxxx>', to 'xxxxxxx@xxxxxxx', cc '', Subject 'Cacti Report', Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed
05.02.2020 13:13:15 - CMDPHP WARNING Backtrace:  (/poller_reports.php[143]:generate_report(), /lib/reports.php[480]:mailer(), /lib/functions.php[3697]:cacti_debug_backtrace())
05.02.2020 13:13:15 - MAILER
05.02.2020 13:13:22 - REPORTS generate_report, Problems sending Report 'MPLS Reports'.  Problem with e-mail Subsystem Error is 'SMTP Error: data not accepted.SMTP server error: DATA END command failed'
05.02.2020 13:13:22 - REPORTS TRACE WARNING: Reports Poller terminated by user

this is the report:

select * from reports where id=7;
+----+---------+--------------+---------+--------------------+-----------+-----------+--------------+--------+-------+--------+------------+--------------+-----------+----------------+----------------------+-----+-----------------+--------------+-------------+---------------+------------+----------+---------+
| id | user_id | name         | cformat | format_file        | font_size | alignment | graph_linked | intrvl | count | offset | mailtime   | subject      | from_name | from_email     | email                | bcc | attachment_type | graph_height | graph_width | graph_columns | thumbnails | lastsent | enabled |
+----+---------+--------------+---------+--------------------+-----------+-----------+--------------+--------+-------+--------+------------+--------------+-----------+----------------+----------------------+-----+-----------------+--------------+-------------+---------------+------------+----------+---------+
|  7 |      46 | MPLS Reports | on      | cacti_group.format |        16 |         2 | on           |      1 |     1 |      0 | 1580904600 | Cacti Report | Cacti     |  xxxxxxxxxxxx  |   xxxxxxxxxxxxxxxx   |     |               1 |          125 |         700 |             1 |            |        0 | on      |
+----+---------+--------------+---------+--------------------+-----------+-----------+--------------+--------+-------+--------+------------+--------------+-----------+----------------+----------------------+-----+-----------------+--------------+-------------+---------------+------------+----------+---------+

and it's items:

select * from reports_items where report_id=7;
+----+-----------+-----------+---------+-----------+--------------+-------------------+------------------+---------+-------------------+----------------+----------+-------+-----------+-----------+----------+
| id | report_id | item_type | tree_id | branch_id | tree_cascade | graph_name_regexp | host_template_id | host_id | graph_template_id | local_graph_id | timespan | align | item_text | font_size | sequence |
+----+-----------+-----------+---------+-----------+--------------+-------------------+------------------+---------+-------------------+----------------+----------+-------+-----------+-----------+----------+
| 53 |         7 |         3 |      10 |       387 |              | report            |                0 |       0 |                 0 |              0 |        8 |     2 |           |        16 |        1 |
+----+-----------+-----------+---------+-----------+--------------+-------------------+------------------+---------+-------------------+----------------+----------+-------+-----------+-----------+----------+

Expected behavior
The mails should be sent only once

@cigamit
Copy link
Member

cigamit commented Feb 6, 2020

You need to provide more detail. Need the Cacti version and your PHP version and OS.

@cigamit cigamit added the unverified Some days we don't have a clue label Feb 6, 2020
@vKnmnn
Copy link
Author

vKnmnn commented Feb 6, 2020

Oh i'm sorry. I forgot that.
This is on a physical Ubuntu machine "Ubuntu Server 2018" running kernel 4.15.0-65.
The Issue was persistent over cacti version 1.2.7 and now on 1.2.8.
PHP version is 7.2.24-0ubuntu0.18.04.2

@netniV
Copy link
Member

netniV commented Feb 6, 2020

I'm guessing that because the email fails due to a server problem, the report isn't marked as sent and thus gets resent. You need to correct the problem with sending out the email.

@vKnmnn
Copy link
Author

vKnmnn commented Feb 6, 2020

yes, that's what i'm guessing too, however reports have been sent just fine when i was still on 0.8.8. I will try to have a look at the exchange logs tomorrow to see if there's something of interest there

@vKnmnn
Copy link
Author

vKnmnn commented Feb 10, 2020

Alright i had a look at the logs, there's no failure or error occurring when the mails get sent.
If the mail server was the issue, shouldn't other mails sent by cacti show that behavior too?

@netniV
Copy link
Member

netniV commented Feb 10, 2020

SMTP Error: data not accepted.SMTP server error: DATA END command failed

Your own logs suggest otherwise. This is likely a specific issue the mail server has with the attachment or graphic content so wouldn't necessarily affect all mails.

@vKnmnn
Copy link
Author

vKnmnn commented Feb 19, 2020

i have looked through the logs again, there appears to be no issue on the mail server side.

@netniV
Copy link
Member

netniV commented Feb 19, 2020

Then what was the above from ?

@netniV netniV added the bug Undesired behaviour label Feb 28, 2020
@TheWitness
Copy link
Member

I'll be making an update to this. It's a pretty big change. So, it's advised that you wait to version 1.2.11. However, you may review the commit log and take action as required.

TheWitness added a commit that referenced this issue Mar 14, 2020
Report gets resent every poller cycle
@TheWitness TheWitness added resolved A fixed issue and removed unverified Some days we don't have a clue labels Mar 14, 2020
@TheWitness TheWitness added this to the 1.2.11 milestone Mar 14, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

4 participants