Cacti / plugin_gexport

Cacti Graph Export Plugin
GNU General Public License v2.0
12 stars 9 forks source link

gexport error: unlink results in no such file or directory #47

Closed thowo closed 1 year ago

thowo commented 3 years ago

Hello Cacti Developer,

I have an issue with the gexport plugin. From time to time it reports the following error in cacti.log:

CMDPHP PHP ERROR WARNING Backtrace: (/plugins/gexport/poller_export.php[105]:export_graph_start_task(), /plugins/gexport/functions.php[938]:export_graph_files(), /plugins/gexport/functions.php[966]:check_remove(), /plugins/gexport/functions.php[2102]:unlink(), CactiErrorHandler())

2021/01/11 16:57:05 - ERROR PHP WARNING in Plugin 'gexport': unlink(/tmp/cacti-rsync-temp-1/graph_9036.html): No such file or directory in file: /opt/cacti/cacti-1.2.10/plugins/gexport/functions.php on line: 2102

But the file in question exists:

ls -la /tmp/cacti-rsync-temp-1/graph_9036.html -rw-r--r-- 1 cacti cacti 804 Jan 11 16:57 /tmp/cacti-rsync-temp-1/graph_9036.html

I am using cacti 1.2.10 with gexport plugin version 1.4.2 on a debian 10.7 system. Export Command Arguments is: rsync -zav

thanks in advance, best regards,

Tom

netniV commented 3 years ago

So, this may be an issue between systemd and the os, interfering. Basically anything that normally goes to /tmp may be redirected to a special systemd folder under Ubuntu/Debian. This is why rconfig uses directories under its own plugin area to handle the downloads and prevent this type of error.

Can you confirm you OS version, and whether you run cacti under apache or something else?

thowo commented 3 years ago

Hi, thanks for your reply. You are right, I am running cacti under apache 2.4.38-3+deb10u4 and my OS Version is 10.7. I will give it a try to export to a different directory within the regular filesystem and report back.

Many Thanks, best regards, cheers,

Tom

thowo commented 3 years ago

Hi, bad news, I changed to /opt/cacti/exportdirectory (which is a local ext 4 fs on LVM Volume) and same error came up. I have 3 exports running and it seems if they overlap in time the error happens. Any thoughts on this? thanks in advance, best regards, Tom

netniV commented 3 years ago

I would use separate temporary areas but I'm not sure if that is configurable within the gexport options without going to have a look. The alterantive would be to update the TMP location as I doubt the path is actually hardcoded since not all systems may have a /tmp/

TheWitness commented 1 year ago

I've confirmed some bad behavior this morning with Tree Export method.

TheWitness commented 1 year ago

Closing this one. I can not reproduce with the latest develop.