netreg-users: Problems with initial install: Database Error

Matt Brennan mbrennan at kaydongroup.com
Tue Feb 27 19:49:49 EST 2007


Michael,

  From your command line, try:
mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES ON netdb.* TO 'netreg-web'@'localhost' IDENTIFIED BY 'password';"

This should all be on one line. The 'password' should be replaced with the password in the .password file in $NRHOME/etc (include the single quotations). The same goes for netreg-maint and and netreg-reports, with the appropriate .password-X files from your $NRHOME/etc directory.

-Matt

-----Original Message-----
From: Michael Robbert [mailto:mrobbert at mines.edu] 
Sent: Tuesday, February 27, 2007 19:45
To: A list for discussion amongst users of NetReg/NetMon.
Subject: Re: netreg-users: Problems with initial install: Database Error

The users were never created. I found the lines in the install script that
create them and attempted to run them manually cutting and pasting the encrypted
passwords from the files. This did not work, but is very prone to errors so I
may have munged something along the way. I get the same error when trying the
mysql client and pasting the contents of the password file when it asks for the
password. I'm not even sure that should work though.

Thanks for the help so far,
Mike

Matt Brennan wrote:
> Michael,
> 
>   I ran into this issue when I was installing netreg as well. The problem, for me, took two steps to resolve. The first problem was a permission issue with the file which contains the password for netreg to connect to the mysql database. This file is located at /home/netreg/etc/.password assuming that you installed to the standard location. This file needs to be readable by apache, otherwise it can not open the file to read the password, and therefore can not login to the MySQL database. The other issue I ran into, after I fixed that permission issue, was that the script never created the netreg-web user in the MySQL server. Check if the user exists, and has permissions for netdb.* in the grant tables. If it doesn't you will need to add the user with the password in the .password file.
> 
> -Matt
> 
> 
> -----Original Message-----
> From: Michael Robbert [mailto:mrobbert at mines.edu] 
> Sent: Tuesday, February 27, 2007 18:56
> To: A list for discussion amongst users of NetReg/NetMon.
> Subject: Re: netreg-users: Problems with initial install: Database Error
> 
> David,
> Our site is currently running bind9 and DHCP3 on a pair of Debian Sarge servers.
> DHCP is also currently running on a  couple of other servers for VOIP phones and
> multiple resnet subnets. We are looking to collapse those into the main campus
> DHCP server so we only have to worry about a single pair of servers.  Currently
> most of our main campus uses static IPs and we've got some back end scripts that
> we run to aid in modifying the zone file. All DHCP registration is kept in a
> pair of flat files, one for main campus/wireless and one for resnet. These files
> are populated from a simple web form and some back end scripts to munge and push
> the files around. Most of our scripts pre-date me and with a growing department
> they have been shown to be fragile due to unknown interdependencies. We're
> probably going to have to make some changes to them and I was hoping to
> modernize the whole operation and hopefully eventually delegate some
> responsibility out to other departments which is currently not possible due to
> the complexities of our command line procedures.
> 
> So, back to the problem at hand. The Apache logs were helpful. They are
> indicating that access is denied for the netreg-web user. I have tried removing
> the database and netreg home directory and starting fresh, but the same thing
> keeps happening. It is also complaining of a missing MAILER variable which must
> be why I'm not getting any mail. I did find a MAILER variable in the
> /etc/netreg-netdb.conf file. It was pointing to an incorrect location for
> sendmail, but even after correcting that I still get the error and no mail. I
> did get one other response that doesn't appear to have been copied to the list
> and he says that he had a similar problem with the generated password not being
> in sync. He said that he manually synchronized them. I'm willing to give that a
> try although the passwords in the files in $NETDB_HOME/etc appear to be
> encrypted and I'm quite sure how to either generate those or use them in  MySQL.
> I would also hope that together we could figure out why the problem is occurring
> and get it fixed.
> 
> Thanks,
> Mike Robbert
> 
> David Nolan wrote:
>> On 2/27/07, Michael Robbert <mrobbert at mines.edu> wrote:
>>> I just downloaded NetReg 1.1.9 and attempted an install today. I am
>>> installing
>>> on a fairly clean Debian Sarge system.
>>> I have gotten the front page to load and when I click on the Enter
>>> button Apache
>>> prompts for authentication, when that passes I get a page saying
>>> Database Error:
>>> There was an error while connecting to the netreg database. The
>>> administrator
>>> has been informed. Please try again later.
>>>
>>> The database has been created and I can login to it from the command
>>> line as the
>>> root user. There is a log directory in ~netreg, but it is empty. I
>>> have setup
>>> myself as the administrator and I was not informed of the error as the
>>> message
>>> says. Does  anybody know off the top of their head what may have gone
>>> wrong
>>> during the initial setup? Failing that, what can I do to find out what
>>> is wrong
>>> with the database?
>>>
>>>
>> Mike,
>>
>> First, welcome to the netreg list.  Feel free to share a little bit
>> about your site and what you're looking for in netreg, and we'll be
>> happy to help you determine if its the right system for you.
>>
>> You didn't mention what version of mysql you're using.  There were
>> some issues with mysql 4.1 and 5.0 that required code changes in
>> netreg, and if I recall correctly the latest released version of
>> netreg (1.1.9) doesn't have those changes yet.  The current code in
>> CVS works with 4.1, and with another minor change that was discussed
>> on the list recently will work with 5.0.  I just haven't gotten a
>> releasable distribution put together.
>>
>> Check the apache error log for a more detailed error message.  And
>> theoretically an email should have been sent to the email address
>> configured in the config file, though I suspect that not all the code
>> paths actually do that.
>>
>> -David
>> ----------------------------------------------------------------
>> NetReg Users -- www.cmu.edu/lists -- www.net.cmu.edu/netreg
> ----------------------------------------------------------------
> NetReg Users -- www.cmu.edu/lists -- www.net.cmu.edu/netreg
> 
> 
> ----------------------------------------------------------------
> NetReg Users -- www.cmu.edu/lists -- www.net.cmu.edu/netreg
----------------------------------------------------------------
NetReg Users -- www.cmu.edu/lists -- www.net.cmu.edu/netreg




More information about the Netreg-users mailing list