Page 1 of 1

Error after upgrading to 1.8

Posted: Tue Jun 10, 2014 9:18 pm
by FelixForbes
Hi,

My copy of 1.7 has been running with no problems. Today I downloaded and ran the 1.8 upgrade but received the following error:

Archive: sourceguardian/ixed4.lin.x86-64.zip
inflating: /usr/lib64/php/modules/ixed.5.3.lin
Sourceguardian extension found for PHP version 5.3
Sourceguardian extension already in php.ini
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
<!DOCTYPE html>
<html lang="en">
<head>
<title>Database Error</title>
<style type="text/css">

::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }

body {
background-color: #fff;
margin: 40px;
font: 13px/20px normal Helvetica, Arial, sans-serif;
color: #4F5155;
}

a {
color: #003399;
background-color: transparent;
font-weight: normal;
}

h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 19px;
font-weight: normal;
margin: 0 0 14px 0;
padding: 14px 15px 10px 15px;
}

code {
font-family: Consolas, Monaco, Courier New, Courier, monospace;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}

#container {
margin: 10px;
border: 1px solid #D0D0D0;
-webkit-box-shadow: 0 0 8px #D0D0D0;
}

p {
margin: 12px 15px 12px 15px;
}
</style>
</head>
<body>
<div id="container">
<h1>A Database Error Occurred</h1>
<p>Error Number: 1062</p><p>Duplicate entry 'All Sources' for key 'name'</p><p>INSERT INTO `nagiosna_SourceGroups` (`gid`, `name`) VALUES (2, 'All Sources')</p><p>Filename: /var/www/html/nagiosna/application/migrations/002_add_all_sources_sg.php</p><p>Line Number: 42</p> </div>
</body>

I have rebooted the server and the main web page is fine but any queries I try to run end with this error message:

Error!
There was an error running nfdump command: /usr/local/bin/nfdump -M '' -R . -t '2014/06/10.12:13:57-2014/06/11.12:13:56' -N -a -A 'dstip,srcip' -o 'fmt:{"protocol": "%pr", "start": "%ts", "end": "%te", "duration": "%td", "srcip": "%sa", "dstip": "%da", "srcport": "%sp", "dstport": "%dp", "srcas": "%sas", "dstas": "%das", "packets": %pkt, "bytes": %byt, "flows": %fl, "packets": %pkt, "tos": %tos, "bps": %bps, "pps": %pps, "Bpp": %bpp}' 'port 6346 OR port 6347 OR port 48706' 2> /dev/null

Re: Error after upgrading to 1.8

Posted: Tue Jun 10, 2014 9:26 pm
by FelixForbes
Further to this - I have just noticed that this only seems to be affecting queries I run against all sources. If I run any query against a specific source I do not get the error form my post above.

Re: Error after upgrading to 1.8

Posted: Wed Jun 11, 2014 12:49 pm
by lmiltchev
Can you run the following command and show us the output?

Code: Select all

echo 'select * from nagiosna_SourceGroups;' | mysql nagiosna

Re: Error after upgrading to 1.8

Posted: Wed Jun 11, 2014 5:09 pm
by FelixForbes
Here you go:

gid name
1 All Sources

Re: Error after upgrading to 1.8

Posted: Thu Jun 12, 2014 11:52 am
by jomann
Did you have an "All Sources" sourcegroup from before? Can you do two things for this?

1. Can you run "select * from nagiosna_migrations" on the nagiosna database for us? You should see version being 2.
2. If that is set to 2 you should be able to run the upgrade again without an error... if it is not - then you will need to delete the "All Sources" source group and upgrade the database again... which is probably what you will have to do since the actual database migration must have failed.

Re: Error after upgrading to 1.8

Posted: Thu Jun 12, 2014 7:08 pm
by FelixForbes
OK it looks like the version is set to 1. I have created another source called All added all of my sources to it however I don't see any way of deleting All Sources via the web interface. Is there a command which will allow me to do this from the command line so I can run the upgrade again?

EDIT* Yes I had the inbuilt group All Sources as of my default installation. Everything is working now (if I use the new group called All for my queries) but I'd still like to finish the upgrade and the the database up to version 2.

Re: Error after upgrading to 1.8

Posted: Fri Jun 13, 2014 11:16 am
by lmiltchev
You can try deleting the "All Sources" from the database directly by running the following command:

Code: Select all

echo 'delete from nagiosna_SGLinker where gid=1;' | mysql nagiosna ; echo 'delete from nagiosna_SourceGroups where gid=1;' | mysql nagiosna
Then run the "./upgrade" again. Let me know if this helped.

Re: Error after upgrading to 1.8

Posted: Sun Jun 15, 2014 5:19 pm
by FelixForbes
That did the trick - the upgrade has now run with no issues. Thank you very much for your assistance.