Hello, I have installed a new instance of zope 2.7.4. I have brought in a Data.fs file from another ISP. I don't know exactly what version this file is from, but I am fairly sure its some 2.x version. My question(s) is what to do next, I am new to zope, but I have tried a lot of things. The basic problem is that the btree structure of the interesting part of the site is broken (perhaps corrupt).I can start and run the server, and browse through the control panel, and perform various administrative tasks. The top level index_html file is just a redirect to the site1 folder structure, which is the one that is broken. I mention this, because this file works, but any contents below site1 are not visible. ===== this works -su-2.05b$ python utilities/ZODBTools/fstest.py var/Data.fs -su-2.05b$ python utilities/ZODBTools/fsrefs.py var/Data.fs as does -su-2.05b$ python utilities/ZODBTools/fsdump.py var/Data.fs | less ====== This doesn't -su-2.05b$ python utilities/ZODBTools/checkbtrees.py var/Data.fs <root> {'Application': <Application instance at 8346650>, 'ZGlobals': <OOBTree object at 0x8910ec8>} ['Application'] <Application instance at 8346650> ['ZGlobals'] <OOBTree object at 0x8910ec8> ['Application'].__error_log__ <SiteErrorLog at error_log> ['Application'].Sync <ZSyncer instance at 890c800> ['Application'].standard_error_message <DTMLMethod instance at 8b6e200> ['Application'].temp_folder MountedObject(id='temp_folder') ['Application'].vhm1 <VirtualHostMonster instance at 8b6ef50> ['Application'].__allow_groups__ <UserFolder instance at 8b6e7a0> ['Application'].session_data_manager <SessionDataManager instance at 8b7c410> ['Application'].browser_id_manager <BrowserIdManager instance at 8b7c350> ['Application'].standard_template.pt <ZopePageTemplate at standard_template.pt> ['Application'].Control_Panel <ApplicationManager instance at 8b86860> ['Application'].standard_html_footer <DTMLMethod instance at 8b868c0> ['Application'].index_html <DTMLMethod instance at 8b86920> ['Application'].site1 <Folder instance at 8b86950> Traceback (most recent call last): File "utilities/ZODBTools/checkbtrees.py", line 122, in ? main(fname) File "utilities/ZODBTools/checkbtrees.py", line 110, in main add_if_new_persistent(todo, v, newpath) File "utilities/ZODBTools/checkbtrees.py", line 28, in add_if_new_persistent getattr(obj, '_', None) # unghostify File "/www/htdocs/esginc.com/zope/lib/python/ZODB/Connection.py", line 600, in setstate self._set_ghost_state(obj, p) File "/www/htdocs/esginc.com/zope/lib/python/ZODB/Connection.py", line 639, in _set_ghost_state state = unpickler.load() File "/www/htdocs/esginc.com/zope/lib/python/ZODB/Connection.py", line 220, in _persistent_load return self[oid] File "/www/htdocs/esginc.com/zope/lib/python/ZODB/Connection.py", line 182, in __getitem__ klass=self._db._classFactory(self, module, name) File "/www/htdocs/esginc.com/zope/lib/python/ZODB/DB.py", line 127, in _classFactory return getattr(__import__(location, _globals, _globals, _silly), ImportError: No module named *ED1fLY3QImx5D39mCNz0gw== =============================================================== nor does this, but I also get this error on a Data.fs that is not broken, so I don't understand what I am doing wrong ? -su-2.05b$ python lib/python/ZODB/fsrecover.py -P 1 -v 2 var/Data.fs Traceback (most recent call last): File "lib/python/ZODB/fsrecover.py", line 374, in ? main() File "lib/python/ZODB/fsrecover.py", line 226, in main opts, (inp, outp) = getopt.getopt(sys.argv[1:], "fv:pP:") ValueError: unpack list of wrong size -su-2.05b$ ================================================================= I attempted to try and follow the instructions to fix a corrupted database, but I got errors that the root did not exist.... following http://www.zopelabs.com/cookbook/1095965033 ==============================================================
from Zope.Startup.run import configure configure('/www/htdocs/esginc.com/zope/etc/zope.conf') from ZODB.POSException import POSKeyError obj=root.unrestrictedTraverse('/site1') Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'root' is not defined
================================================================= It really sort of 'seems' like I have mounted the database incorrectly, and if I could fix some simple mistake some where, .... What I have done to import this Data.fs is to copy the file into var, delete the index, modify the zope.conf to be somewhat similar to the way it was in the 'other' server, and copy the files/contents of import folder... ============= -su-2.05b$ ls import/ AdManager.zexp ZopeTutorialExamples.zexp custom.zexp Examples.zexp acl_users.zexp submit_resume_form.zexp Portal.zexp biz_referral_form.zexp README.txt content.zexp
Craig Lewis wrote:
return getattr(__import__(location, _globals, _globals, _silly), ImportError: No module named *ED1fLY3QImx5D39mCNz0gw==
Looks like you have A ZClass missing...
-su-2.05b$ ls import/ AdManager.zexp ZopeTutorialExamples.zexp custom.zexp Examples.zexp acl_users.zexp submit_resume_form.zexp Portal.zexp biz_referral_form.zexp README.txt content.zexp
...or, more likely, you've tried to import a site in bits. A ZClass ends up as being idenitifed by the garbage in the above ImportError, if you import it from a .zexp, I reckon the garbage might be different, and you'll get the error above. The long term solution is not to use ZClasses ;-) In the meantime, get the Data.fs and use that rather than trying ot do it using .zexp's... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Craig Lewis wrote at 2005-2-28 16:21 -0600:
... klass=self._db._classFactory(self, module, name) File "/www/htdocs/esginc.com/zope/lib/python/ZODB/DB.py", line 127, in _classFactory return getattr(__import__(location, _globals, _globals, _silly), ImportError: No module named *ED1fLY3QImx5D39mCNz0gw==
This is a missing ZClass...
... File "lib/python/ZODB/fsrecover.py", line 226, in main opts, (inp, outp) = getopt.getopt(sys.argv[1:], "fv:pP:") ValueError: unpack list of wrong size
This is a wrong call of "fsrecover.py". It need 2 non-option arguments.
...
from Zope.Startup.run import configure configure('/www/htdocs/esginc.com/zope/etc/zope.conf') from ZODB.POSException import POSKeyError obj=root.unrestrictedTraverse('/site1') Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'root' is not defined
You forgot to define "root": from Zope import app root = app() -- Dieter
Dieter Maurer wrote:
This is a missing ZClass...
This is probably my whole problem, is there a way to figure out what is missing? I would guess that I have failed to add a zope add on of some sort, I have installed all of Plone and Zope to the best of my knowlege. I have since gotten a better feel for what is broken. I had forgotten yesterday that I can browse all of the database folders and plone objects in the management interface, but when I try to view a 'top level' (of folder) object, or open the equivelent page through a browser, I get an error, but if I open a specific object via server, I can see that object without error. i.e. if I try... dev.esginc.com:8080/VirtualHostBase/http/www.esginc.com:80/site1/pr/VirtualHostRoot/content I get Error Type: NotFound Error Value: document_view if I try dev.esginc.com:8080/VirtualHostBase/http/www.esginc.com:80/site1/pr/VirtualHostRoot/content/city3.jpg I get the image. So the basic server works, but there is some script in all the top level web pages that is linked against something I don't have ? (although you would think I would get a more informative error message... ?)
You forgot to define "root":
from Zope import app root = app()
but this is just in the debugger ? there is nothing I have to do to define root in the server in zope/zserver .... right ?
Craig Lewis wrote at 2005-3-1 15:12 -0600:
... This is probably my whole problem, is there a way to figure out what is missing?
I was convinced that the module name were the base64 encoding of the ZClass' meta_type. However, when I decoded the module name, I got complete gibber. Thus, I was probably wrong. The ZClass modules are maintained inside the ZODB. Under Unix systems, you can determine them as follows: bin/zopectl debug r = app._p_jar.root() # the ZODB root object ZClassModules = r['ZGlobals'] print list(ZClassModules.items()) The result is for me: [('*3+nP3shcKZgeDUeUj8g8/g==', <extension class *3+nP3shcKZgeDUeUj8g8/g==.Umfrage at 4255c548>), ('*Ia0PT2YykvKgy92lOxIomg==', <extension class *Ia0PT2YykvKgy92lOxIomg==.ABC at 4255c638>), ('*NL9ERBmGKOFE6HAw8h1gYA==', <extension class *NL9ERBmGKOFE6HAw8h1gYA==.JobZClass2 at 4255c818>), ('*tLC/LPumapvIwtwNCD+NJA==', <extension class *tLC/LPumapvIwtwNCD+NJA==.JobZClass at 4255c728>)] Follow Chris Withers' advice and move your "Data.fs". -- Dieter
participants (3)
-
Chris Withers -
Craig Lewis -
Dieter Maurer