We have an existing ZenOss machine running on RHEL 5 32-bit, I wanted to bring up a dev machine for testing upgrades, used same arch same OS and installed the same version (2.5.2) of Core, added in same ZenPacks and made sure everything was matching the production machine.
I did a backup and copied the largish (782 MB) file over to the dev box and did (as zenoss user) like follows:
$ zenrestore --file zenbackup_20110629.tgz
ERROR 1045 (28000): Access denied for user 'zenoss'@'localhost' (using password: YES)
Curious about what's going on with the DB, I did a zendmd, or tried to:
Traceback (most recent call last):
File "/opt/zenoss/Products/ZenModel/zendmd.py", line 245, in ?
myconsole = HistoryConsole(locals=_customStuff())
File "/opt/zenoss/Products/ZenModel/zendmd.py", line 71, in _customStuff
app = Zope2.app()
File "/opt/zenoss/lib/python/Zope2/__init__.py", line 51, in app
File "/opt/zenoss/lib/python/Zope2/__init__.py", line 47, in startup
File "/opt/zenoss/lib/python/Zope2/App/startup.py", line 65, in startup
DB = dbtab.getDatabase('/', is_root=1)
File "/opt/zenoss/lib/python/Zope2/Startup/datatypes.py", line 288, in getDatabase
db = factory.open(name, self.databases)
File "/opt/zenoss/lib/python/Zope2/Startup/datatypes.py", line 186, in open
DB = self.createDB(database_name, databases)
File "/opt/zenoss/lib/python/Zope2/Startup/datatypes.py", line 183, in createDB
return ZODBDatabase.open(self, databases)
File "/opt/zenoss/lib/python/ZODB/config.py", line 105, in open
File "/opt/zenoss/lib/python/ZODB/DB.py", line 270, in __init__
File "/opt/zenoss/lib/python/ZEO/ClientStorage.py", line 712, in load
return self.loadEx(oid, version)[:2]
File "/opt/zenoss/lib/python/ZEO/ClientStorage.py", line 735, in loadEx
data, tid, ver = self._server.loadEx(oid, version)
File "/opt/zenoss/lib/python/ZEO/ServerStub.py", line 196, in loadEx
return self.rpc.call("loadEx", oid, version)
File "/opt/zenoss/lib/python/ZEO/zrpc/connection.py", line 699, in call
raise inst # error raised by server
ZODB.FileStorage.format.CorruptedDataError: Error reading oid 0x00. Found "\x00\x00\x00\x00\x00\x00\x00\n\x03\x7fho\xd4'\xf7\xdd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05h\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e" at 1421
Google showed me a couple of other cases where people were having such troubles, but they were all trying to do a zenrestore onto a 64-bit platform from a 32-bit-generated backup. Since that's not the case here, what else could be causing this grief and more importantly how can it be fixed?
Is there perhaps another or better place to ask this question?
I'd try the IRC channel.
Information Technology Area Supervisor
LEPP Computer Group
Having done the restore, I always make sure that zenoss is completely recycled. I usually find 2 orphan zeo processes that need manually killing so my process is (as root, not as zenoss):
ps -ef | grep zen
Any Zenoss processes, you need to kill off manually
As the zenoss user, then check with zenoss status .
I have this same issue I can not get a clean restore. Access denied for user Zenoss@localhost.
I can loginto mysql with the zenoss account and the password. I changed my password to the zenoss account over a year ago would this be the issue?
As the zenoss user, zendmd
dmd.ZenEventManager.host = 'localhost'
dmd.ZenEventManager.password = 'zenoss'
dmd.ZenEventManager.user = 'zenoss'
Thanks for the assist. However it still failed I believe the cause lies in the fact that MySQL password is encrypted and as such can not be entered from a cmd line.
For example; To use the MySQL command one inputs mysql -u zenoss -p database name
If you put a password in after the -p you will recieve the access denied error but if you leave it blank you are prompted for a password wich does not show on the screen when you enter it. Once your password is entered you can see the database specified
In ZenRestore the script appears to be calling for the password and if it is handed over then MySQL does not recognize it as it is looking for the encrypted password.
At least that is my take on the situation but I have been wrong before and I am looking forward to someone smarter than me resolving this issue. Am I the only one using an encrypted password for their mysql db?
Encrption is too fancy for Zenoss. dmd.ZenEventManager.password Isn't encrypted. Can you post the deny message when you mysql -u zenoss -p from the zenoss user on the zenoss master? I think it's table permissions.
My copy of MySQL seems to be encrypting all passwords as though it was a default setting. I need to look into my config of MySQL further.
I found I can get the backup of the events DB with MySQLDump and I need to use the cmd :
mysqldump -u zenoss -p events >/usr/local/zenoss/backups/events.sql.
Restore using MySqldumb procedures.
When I do this I am prompted for a password and it works fine. If I place the password after the -p I get this message which is the same as I get with Zenrestore
mysqldump: Got error: 1045: Access denied for user 'zenoss'@'localhost' (using password: YES) when trying to connect
I can restore using Zenrestore by using the --no-eventsdb switch. THen Zenrestore works and I can use mysqldump to put the events db back.
I do not remember any warning about encrytping passwords if there is then I just missed it and if there is not maybe there should be as more people are thinking along the lines of encrypting any password as the standard.
I agree the password should be encrypted in Zenoss.