nagvis icon indicating copy to clipboard operation
nagvis copied to clipboard

Nagvis javascript error and fails - constantly

Open juesor opened this issue 5 years ago • 7 comments

I have a use who was deleting switches out of a map and now they are getting the below error.

Normally i would just restore this config file and they would go back to working on it but this is getting out of hand. Nagvis seems to break like this almost daily. Is it something my users are doing incorrectly? Or is this program just that sensative?

image

Now users cannot navigate to nagvis at all.

Error: (0) in_array() expects parameter 2 to be array, boolean given URL: /nagvis/frontend/nagvis-js/ File: /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php Line: 1019 #0 [internal function]: nagvisExceptionErrorHandler(2, 'in_array() expe...', '/usr/local/nagv...', 1019, Array) #1 /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php(1019): in_array('worldmap', false) #2 /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php(480): GlobalMapCfg->checkMapConfigIsValid() #3 /usr/local/nagvis/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php(164): GlobalMapCfg->readMapConfig(true) #4 /usr/local/nagvis/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php(305): NagVisHeaderMenu->getMapList() #5 /usr/local/nagvis/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php(82): NagVisHeaderMenu->getMacros() #6 /usr/local/nagvis/share/frontend/nagvis-js/classes/FrontendModOverview.php(77): NagVisHeaderMenu->__toString() #7 /usr/local/nagvis/share/frontend/nagvis-js/classes/FrontendModOverview.php(55): FrontendModOverview->showViewDialog() #8 /usr/local/nagvis/share/server/core/functions/index.php(120): FrontendModOverview->handleAction() #9 /usr/local/nagvis/share/frontend/nagvis-js/index.php(53): require('/usr/local/nagv...') #10 {main}

juesor avatar Nov 30 '18 13:11 juesor

This happens to us when a CFG file gets corrupt sometimes. It is case sensitive to us. check file owner rights.

T100D avatar Dec 03 '18 12:12 T100D

Yea but why does it get corrupt?

My end user was deleting items from nagvis and boom its crashed.

And everyone i work with wonders why i created a backup script hourly for nagvis.

#/bin/sh
cd /usr/local/nagvis/etc/maps/
cp *.cfg /nagVisBackups/
cd /nagVisBackups/
mkdir $(date +%Y.%m.%d_%H:%M)
bzip2 *
mv *bz2 $(date +%Y.%m.%d_%H:%M)

Then i can just bunzip2 my backup files and cp configBroken.cfg /usr/local/nagvis/etc/maps/ cd /usr/local/nagvis/etc/maps chown apache:apache *

Done fixed and restored to point in time of the last hour that it was reported to me.

juesor avatar Dec 03 '18 20:12 juesor

To us it happens due to a physical system that has disk IO resource problems, before that there was no problem. It sometimes happens that the map.cfg file is thrown empty, when making changes to it, so with large ones we make a local copy before editing.

T100D avatar Dec 04 '18 07:12 T100D

Need to have some way to reproduce this issue to fix this or more information how the files get corrupted in which specific situations.

LarsMichelsen avatar Jun 01 '19 23:06 LarsMichelsen

For us It happens, when we move some labels/ icons or objects, than we get this error:

Error: (0) in_array() expects parameter 2 to be array, boolean given URL: /nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=MAP_Name_new File: /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php Line: 1019 #0 [internal function]: nagvisExceptionErrorHandler(2, 'in_array() expe...', '/usr/local/nagv...', 1019, Array) #1 /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php(1019): in_array('worldmap', false) #2 /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php(480): GlobalMapCfg->checkMapConfigIsValid() #3 /usr/local/nagvis/share/frontend/nagvis-js/classes/FrontendModMap.php(94): GlobalMapCfg->readMapConfig(true) #4 /usr/local/nagvis/share/frontend/nagvis-js/classes/FrontendModMap.php(80): FrontendModMap->showViewDialog() #5 /usr/local/nagvis/share/server/core/functions/index.php(120): FrontendModMap->handleAction() #6 /usr/local/nagvis/share/frontend/nagvis-js/index.php(53): require('/usr/local/nagv...') #7 {main}

Than we restored it back from a snapshot but after we move some objects again we got this error: Afb2

When we got that error we download the map .cfg file and it only showed this inside, which should be a lot more data in there... Afb1

SpaceStation897 avatar Jul 16 '19 11:07 SpaceStation897

Would love to fix the source for these corruptions. @SpaceStation897:

  • Did you also experience some kind of high IO load / latency on that system?
  • Does it appear often for you?
  • Are you making fast subsequent changes to the map?

LarsMichelsen avatar Jul 17 '19 19:07 LarsMichelsen

Hello @LarsMichelsen, thanks for replying back!

Did you also experience some kind of high IO load / latency on that system? Not measured.

Does it appear often for you? During changes on NagVis it happened several times (at least 4 time in 4 hours). Mostly while draging icons.

Are you making fast subsequent changes to the map? As fast as I can click and drag-and-drop.

SpaceStation897 avatar Jul 18 '19 07:07 SpaceStation897