Cacti / plugin_syslog

Syslog Plugin for Cacti
GNU General Public License v2.0
21 stars 16 forks source link

Cacti 1.2.10 - Syslog 2.8 - Export option fails every time #126

Closed jpobeda closed 4 years ago

jpobeda commented 4 years ago

Hi,

Every time I hit the export button regardless of how many records there are, I get the same CSV with the error below. You can see memory limit is already high enough.

I got the error below while trying to export 30 records.

15/May/2020 10:37:11 - ERROR PHP ERROR: Allowed memory size of 838860800 bytes exhausted (tried to allocate 83 bytes) in file: /usr/share/cacti/lib/database.php on line: 497

Once I increased memory_limit a bit more..

<b>Fatal error</b>:  Allowed memory size of 1048576000 bytes exhausted (tried to allocate 524288 bytes) in <b>/usr/share/cacti/lib/functions.php</b> on line <b>848</b><br />
System
Cacti 1.2.10
Syslog plugin 2.8 on separate dababase on the same host.
PHP/5.4.16
Apache2.4.6

Let me know if you need any additional info.

Any ideas?

jpobeda commented 4 years ago

Uhm I'm thinking it might an sql query issue actually.


15/May/2020 11:15:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
--
15/May/2020 11:14:15 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:13:16 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:12:54 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
15/May/2020 11:12:54 - ERROR PHP ERROR: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 524288 bytes) in file: /usr/share/cacti/lib/functions.php on line: 848
15/May/2020 11:12:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:11:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:10:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:09:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:08:15 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:07:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:06:15 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:05:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:04:15 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:03:30 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
15/May/2020 11:03:30 - ERROR PHP ERROR: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 524288 bytes) in file: /usr/share/cacti/lib/functions.php on line: 848
15/May/2020 11:03:16 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:02:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:01:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:00:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 10:59:38 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
15/May/2020 10:59:38 - ERROR PHP ERROR: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 524288 bytes) in file: /usr/share/cacti/lib/functions.php on line: 848
15/May/2020 10:59:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 10:59:13 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
jpobeda commented 4 years ago

I've updated to 2.9 and same result

15/May/2020 11:44:14 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
--
15/May/2020 11:44:10 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
15/May/2020 11:44:10 - ERROR PHP ERROR: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 524288 bytes) in file: /usr/share/cacti/lib/functions.php on line: 848
15/May/2020 11:43:16 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:42:13 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
15/May/2020 11:42:03 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
jpobeda commented 4 years ago

I think the SQL syntax error is a red hearing that might be related to thold.

15/May/2020 14:49:08 - CMDPHP SQL Backtrace: (/poller.php[816]:api_plugin_hook(), /lib/plugins.php[74]:api_plugin_run_plugin_hook(), /lib/plugins.php[177]:thold_poller_bottom(), /plugins/thold/includes/polling.php[46]:thold_update_host_status(), /plugins/thold/includes/polling.php[831]:db_execute(), /lib/database.php[210]:db_execute_prepared())
--
15/May/2020 14:49:08 - CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1

I logged the SQL queries to a file and ran the syslog ones manually and they were OK so it seems that is purely related to this memory limit?

jpobeda commented 4 years ago

Problem solved.

When I updated plugin to latest, I didn't realize there was a database change to syslog_incoming table. I updated the rsyslog config to reflect this and it's back up.

Apparently my issue was fixed on later releases but then I was failing to process syslog messages altogether because rsyslog was failing to import them which had nothing to do with the original report.

Anyway, thanks.