Missing tree in Tree Mode

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
IlPini
Posts: 33
Joined: Thu Jun 05, 2008 11:52 am
Location: Rome, Italy

Missing tree in Tree Mode

Post by IlPini »

I think I've found one of the reasons why graph trees suddenly and mysteriously disappear in Tree Mode. I don't think it's a Cacti bug.

The problem
You're routinely using Cacti, and suddenly the left pane in dual pane mode doesn't show any tree, doesn't show anything at all.
I believe this is the same problem described here:
http://forums.cacti.net/viewtopic.php?t=8764
http://forums.cacti.net/viewtopic.php?t=19953
I was using Firefox 2 on Windows XP, but I imagine this could theoretically happen using any browser on any operating system (see below).

The solution
Clear your browser's cache.
This was already known.

The cause
Corrupt file cacti/include/treeview/ftiens4.js in your browser's cache.
Well, this is *one* possible reason; maybe there are more.
I believe this explains every behaviour described in the two posts above, including the inability to reproduce the error on other people's machines.
I verified this the following, repeatable way:
purged Firefox's cache;
reloaded the graphs page in tree mode (so that trees were displayed properly);
identified the file in my on-disk cache (see below);
purposefully crippled the cached file;
reloaded the graphs page in tree mode (at this point the trees were missing);
VIOLENTLY DISINTEGRATED :D the cached file only;
reloaded the graphs page in tree mode (at this point the trees were displayed properly).
BTW, the fact that the error lies *in the browsing computer*, and not on the Cacti computer, implies that another machine browsing the same Cacti installation should be unaffected. So if your trees vanished, try browsing from another computer.

Analysis (maybe the technique can benefit others)
Single-graph pages and single-device pages showed no trees, but were otherwise unaffected, so I knew total database fubar had not happened.
Basic damage control on the database showed no particolar issue.
Repair procedures suggested in the links above did not solve the problem.
Debug-level cacti log didn't show related errors.
So I was pretty sure it wasn't the database's fault.
The HTML source of the graphs page in tree mode did not seem to me as having any parts missing. Every device was mentioned in a Javascript function.
Firefox's error console (menu Tools/Error Console) showed some functions were unknown, so either they were missing from the source, or they were missing from the included .js files (they're included in the first lines in the HTML source) or the .js files themselves were missing.
I began trying to download those files and it failed at the second one: cacti/include/treeview/ftiens4.js
I assumed that, somehow, the file had been accidentally deleted from the Cacti machine's disk, but it wasn't so.
I verified permissions, owner, groups, users, and so on. All normal.
I resorted to the webserver's logs.
To my surprise, Apache's error log didn't show any error on ftiens4.js
The access log was more interesting: it showed a 304 response (see http://www.ietf.org/rfc/rfc2616.txt, section 10.3.5, "304 Not Modified").
The way I see it, thus, Firefox thought it had a valid cached copy of ftiens4.js, asked the webserver whether a newer version was available, the webserver answered "no", so Firefox felt authorized to use its cached copy.
The cached copy was not valid, though, so Firefox's Javascript interpreter didn't execute it and the web page's scripts couldn't use the functions ftiens4.js defined. No trees.

Unfortunately the *actual* reason why the cached copy was corrupt is still unknown. My instinct says the culprit is likely to be inside Firefox, or Windows XP, or Cacti, in this order. But if we were always to follow my instinct, we would be dead several times over by now. 8)

Anyway, you can find Firefox's disk cache by opening a tab on "about:cache" and looking for "Cache Directory". Once there, since file names in the cache are obscure, look for a file with the same size as the .js file you downloaded before (see above). You can find the file size by asking Firefox for the page info (using Windows: right-click in the middle of the page and select View Page Info).
You can cripple the cached file using a text editor, a hex editor, or anything else you prefer. Just edit it at random, put some non-Javascript gibberish in the first line until it doesn't run any more.
You can delete the file as you would any other file on your computer. :)
Uhm, maybe a nice Firefox extension can prove handier. :D
CacheViewer, https://addons.mozilla.org/firefox/addon/2489
User avatar
cdukes
Cacti User
Posts: 61
Joined: Tue Mar 26, 2002 1:25 pm
Location: Morrisville, NC
Contact:

Missing Tree

Post by cdukes »

I just ran into this problem...
I've tried clearing my cache but still cannot see a tree menu.
Any ideas?
User avatar
cdukes
Cacti User
Posts: 61
Joined: Tue Mar 26, 2002 1:25 pm
Location: Morrisville, NC
Contact:

Missing Tree

Post by cdukes »

I just ran into this problem...
I've tried clearing my cache but still cannot see a tree menu.
Any ideas?
User avatar
cdukes
Cacti User
Posts: 61
Joined: Tue Mar 26, 2002 1:25 pm
Location: Morrisville, NC
Contact:

Missing Tree

Post by cdukes »

No idea why my last post appeared twice...
Anyhoo.
I also tried installing Google Chrome and using that, same results.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

PM you page source to me.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
cdukes
Cacti User
Posts: 61
Joined: Tue Mar 26, 2002 1:25 pm
Location: Morrisville, NC
Contact:

Page Source

Post by cdukes »

TheWitness wrote:PM you page source to me.

TheWitness
Done...thanks!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What version of cacti us this?

TW
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
cdukes
Cacti User
Posts: 61
Joined: Tue Mar 26, 2002 1:25 pm
Location: Morrisville, NC
Contact:

Post by cdukes »

TheWitness wrote:What version of cacti us this?

TW
0.8.7b (from the ubuntu repo's)
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

That's what I thought. Its a bit dated.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The following Leaves have imbedded carriage returns in them causing a JS issue:

Code: Select all

LeafB-WAE-612
LeafA-WAE-612
Remove the embedded carriage returns and you should be back in business.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
cdukes
Cacti User
Posts: 61
Joined: Tue Mar 26, 2002 1:25 pm
Location: Morrisville, NC
Contact:

Post by cdukes »

TheWitness wrote:The following Leaves have imbedded carriage returns in them causing a JS issue:

Code: Select all

LeafB-WAE-612
LeafA-WAE-612
Remove the embedded carriage returns and you should be back in business.

TheWitness

Quite odd...
Thanks a TON!
cheinzle
Posts: 15
Joined: Mon Nov 28, 2016 11:02 am

Re: Missing tree in Tree Mode

Post by cheinzle »

I'm running v1.2.3 and I randomly have the same symptoms as in this thread. Can you put the answer above in more detailed context? where are these located, how to find and correct them?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Missing tree in Tree Mode

Post by TheWitness »

Two things:

1) Don't post to such old topics.
2) Create a new topic.

and

3) Be specific, include screen shots, version info, etc.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
onour
Posts: 2
Joined: Sat May 18, 2024 9:40 pm

Re: Missing tree in Tree Mode

Post by onour »

I got the problem today. I log out , log in again and fixed. After a bit again missed and i change the url link to http://<ip>/cacti/graph_view.php?action=tree and fixed.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest