Discussion:
Zenrestore fail access denied for user zenoss@localhost
joeadmin
2012-02-20 16:00:48 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64608#64608

--------------------------------------------------------------
I have googled this to death and while I can find people with the same issue I can not find any resolution.

I run zenrestore and get the Access denied for user 'zenoss'@'localhost' (using password: yes)

I took the backup and extracted it to a different disk just to examine it. I found the backup.settings file and in it is the following:
[zenbackup]
dbuser = zenoss
dbhost = localhost
dbname = events
dbport = 3306
dbpass = (the real password)

I then went to my Zenoss box and entered mysql -u zenoss -p
and when prmpted for the password I entered what was in the backup.settings file and I was granted access to mysql and I could pull status and do whatever I needed.

My question is if the backup.settings file has accurate username and password info why is the restore failing?

I also ran restor with the dbuser and dbpass switch and got the exact same error message.

Any thoughts would be appreciated.
Zenoss 2.51 which will soon be upgraded but I ned this restore first.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64608#64608]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joeadmin
2012-02-20 16:31:43 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64609#64609

--------------------------------------------------------------
Does anyone have the steps to do a manual restore? What I mean is I hve a backup but restore is not working can I extract the files and get them were they belong manually. Any thoughts on this?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64609#64609]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-02-20 16:33:28 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64624#64624

--------------------------------------------------------------
I have not had the issue myself, but I'm curious if it makes a difference if you add the -h option to mysql and pass in localhost. Also wondering if using 127.0.0.1 in place of localhost works. I *very* vagually recall seeing something about localhost resolving to ipv6 addresses rather than IPV4 if IPV6 is enabled. Very probably a shot in the dark, but wanted to throw it out there just in case.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64624#64624]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joeadmin
2012-02-20 16:52:21 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64610#64610

--------------------------------------------------------------
Thanks I will give it a shot and let you know.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64610#64610]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joeadmin
2012-02-20 18:31:18 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64611#64611

--------------------------------------------------------------
I tried the 127.0.0.1 option with the same results. For those in the future that read this thread and are faced witht he same issue here is what I get when I enable the verbose option
***@host:/usr/local/zenoss/bin$ zenrestore --file=/usr/local/zenoss/backups/backup_20120216.tgz -v
Unpacking backup file
Restoring the ZEO database.
Restoring config files.
Restoring performance data.
Checking that events database exists.
ERROR 1045 (28000): Access denied for user 'zenoss'@'localhost' (using password: YES)
MySQL events database check returned 256
Cleaning up temporary files.
Restore complete.

As a result nothing works and I can not restore the events from the past or the custom reports I have built.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64611#64611]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-02-20 18:40:26 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64628#64628

--------------------------------------------------------------
Again, maybe not too helpful since I've not been through this before but looking at the source for zenrestore: http://dev.zenoss.com/trac/browser/tags/zenoss-2.5.1/Products/ZenUtils/ZenRestore.py http://dev.zenoss.com/trac/browser/tags/zenoss-2.5.1/Products/ZenUtils/ZenRestore.py

It apears you might be able to pass --dbpass and explicitly set the password to use for the connection. It says it defaults to the value used in the backup but perhaps there is something wrong there? You can actually override a few of the settins from the command line (see the link above and look under buildOptions.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64628#64628]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2012-02-20 18:50:44 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64629#64629

--------------------------------------------------------------
I'm not 100% sure, but backtracking a little more I'm getting the impression that if you don't specificy that on the command line, it doesnt attempt to find it from the backup, but just defaults to an empty string. I can't seem to locate anywhere that its parsing the backup looking for the password attribute. I'd give the --dbpass option a shot.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64629#64629]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joeadmin
2012-02-20 20:03:35 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64631#64631

--------------------------------------------------------------
I tired the dbpass option from the command line but my synatx may have been wrong. I will try again.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64631#64631]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joeadmin
2012-02-21 13:22:39 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64639#64639

--------------------------------------------------------------
No fix found. Anyone have any ideas here. When I extract the backup I can see that it has the correct credentials inside for MYSQL but when I run zenrestore it says the credentiuals are wrong???????

I looked at the script and it appears that the username and password are coming from the backup so Why is this not working? Has anyone else seen this? How can I work around this?

A real head scratcher?

Thanks for your input.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64639#64639]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joeadmin
2012-02-29 13:03:34 UTC
Permalink
joeadmin [http://community.zenoss.org/people/joeadmin] created the discussion

"Re: Zenrestore fail access denied for user ***@localhost"

To view the discussion, visit: http://community.zenoss.org/message/64847#64847

--------------------------------------------------------------
Sorry for the delay in posing back but I have a resolution, Sort of , to this issue.

What I found is that if you choose to use an encrypted password for MySQL, then ZenRestore will give you the access denied message. It appears that MySql will not accept the password from a script or cmd line whne it is looking for an encrypted password.

As a test if I enter Mysql -u Username -p Password Events at the cmd line it fails. If I enter MySQL  -u username -p
I get prompetd for the password and nothing shows on the screen when I enter it and I am granted access.

If you do a Zenrestor with the switch that prevents the resore of the MySQL database everything works excetp the db and you get no errors. You can extract the db from the backup and restore it with mysql dump commands.

I hope this helps anyone stuck with this issue
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/64847#64847]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...