database error ?

ingerslev

17-09-2004 04:35:20

Hey!

I got a database error every time i try to add Monitor/Graph All Checked or Monitor/Graph under Interface Cache.

DB_ERROR Sorry, a database error occured. We cannot continue. Please contact the administrator and let them know what you were doing when the problem occured

It worked with the CVS version 17. I cant find any thing wrong with the setup. I hope your have a clue to this.

/ingerslev

silfreed

17-09-2004 10:15:54

So, you were running a CVS version of 0.17, then upgraded to 0.17 release manually? Did you execute all the items from DBChangeLog to make sure your database is current? When you upgrade from a CVS version to release, the updater can't guide you through it at this point, you have to do it manually.

-Doug

ingerslev

18-09-2004 04:06:05

Nope! I decided to start from scratch, but I still got the database error. I used the sql files ind the install directory.

/ingerslev

silfreed

18-09-2004 09:48:56

In your config.php for NetMRG, can you change the 'dbdebug' variable from 'false' to 'true' and repeat the action that gives you the error? Copy/Paste the output here, please.

-Doug

ingerslev

18-09-2004 18:20:42

I got this error back then I set dbbug to true

DB_ERROR Couldn't execute query

INSERT INTO sub_devices SET dev_id='2', type=2, name='PIX Firewall 'outside' interface'


You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'outside' interface'' at line 1

/ingerslev

silfreed

18-09-2004 21:46:52

Okay - it looks like it's a quoting/escaping error. We probably broke this when we were trying to fix it in other places.
I'll try to get a fix soon.

-Doug

silfreed

19-09-2004 11:33:11

I've commited the changes to make this work again - they will be in tonight's CVS snapshot if you're bold enough, otherwise I think we're going to have a release out in the next couple days to fix this situation.

-Doug

ingerslev

19-09-2004 13:15:11

Thanks in advance! however I have made myself a semisolution like this

I change these lines in snmp_cache_view.php

db_update("INSERT INTO sub_devices SET dev_id='$dev_id', type=2, name='$index_value'");
$sd_id = db_insert_id();
db_update("INSERT INTO sub_dev_variables SET sub_dev_id=$sd_id, name='$index_type', value='$index_value'");
db_update("INSERT INTO sub_dev_variables SET sub_dev_id=$sd_id, name='ifIndex', value='$index', type='dynamic'");

to this

db_update("INSERT INTO sub_devices SET dev_id='$dev_id', type=2, name=\"'$index_value\"");
$sd_id = db_insert_id();
db_update("INSERT INTO sub_dev_variables SET sub_dev_id=$sd_id, name='$index_type', value=\"$index_value\"");
db_update("INSERT INTO sub_dev_variables SET sub_dev_id=$sd_id, name='ifIndex', value='$index', type='dynamic'");

but i will get CVS snapshot as sone I can.

Anyway I like this product a lot, so keep up the dame good work.

/ingerslev

silfreed

19-09-2004 16:25:35

Your solution should be pretty good - we're having a problem with magic_quotes_gpc, it seems, so we're trying to detect when it's on/off and do appropriate things.

Could you tell us what the setting is in your case?

-Doug

ingerslev

19-09-2004 16:54:01

Yes I can. My settings for the Magic quotes is

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

Now I have change the setting for etc.magic_quotes_runtime = Off to On. That seems to solved my problem in a better way.

/ingerslev

ingerslev

19-09-2004 17:08:34

It's not looking very nice in the description field

PIX Firewall \'outside\' interface

I have exspected this

PIX Firewall 'outside' interface

Not a very big problem for me.

/ingerslev

balleman

20-09-2004 20:36:53

We're now of the opinion that this is a fairly isolated issue, so we are no longer planning to make a patch/revision-level release to address it. If others experience this issue (especially on other pages) we would appreciate hearing about it (in this thread).

Thanks,
Brady

A7V

02-11-2004 12:05:08

[quote94533a715c="ingerslev"]Hey!

I got a database error every time i try to add Monitor/Graph All Checked or Monitor/Graph under Interface Cache.

DB_ERROR Sorry, a database error occured. We cannot continue. Please contact the administrator and let them know what you were doing when the problem occured

It worked with the CVS version 17. I cant find any thing wrong with the setup. I hope your have a clue to this.

/ingerslev[/quote94533a715c]

I had this problem running vanilla 0.17. I just upgraded to 0.18.1 and the issue is still present unable to add interfaces(ex interface description PIX Firewall 'INTERNET' interface )

Note This problem popped up when my colleague was adding the 3rd PIX device. The other 2 with same naming scheme had no problems shock

balleman

02-11-2004 12:47:43

Could you post your magic_quotes settings?

A7V

02-11-2004 13:12:16

[quote4fd3820b46="balleman"]Could you post your magic_quotes settings?[/quote4fd3820b46]
[code14fd3820b46]; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off[/code14fd3820b46]

balleman

02-11-2004 13:17:38

Thanks for the info!

I'll let Doug decide if this warrants reopening the old bug or starting a new one. If we can get it fixed quickly, perhaps 0.18.2 will be justified.

A7V

02-11-2004 13:22:51

If in need of a beta tester look no further wink

silfreed

02-11-2004 13:25:16

Great; that will help a ton. We tested this with some of our own Cisco equipment, but we don't have anything that will put quotes in the ifDescr - only ifAlias. I'll try to take a look to see if they're handled any differently.

-Doug

silfreed

04-11-2004 19:42:51

Tonight's snapshot should have this problem fixed (see bug#329). Let us know how this works - if it's good, we'll try to push out 0.18.2 over the weekend.

-Doug

A7V

05-11-2004 07:09:54

Yes, the problem is fixed and I'm monitoring the devices properly, thanks 8)

I was checking the graphs for the interfaces and I can see backslashes, like this

[code10a4e671459]Interface: PIX Firewall \'Internet\' interface[/code10a4e671459]

I believe this was already reported by someone else.

silfreed

05-11-2004 20:35:15

Okay; the wierd quoting problem was actually a different bug ;). It should also be fixed in tonight's CVS nightlies, if you're interested.

-Doug

A7V

07-11-2004 17:52:09

Nice, will test that tomorrow.
My thanks once again D