I'm migrating a website from Plone 3.3.1 to Plone 4.3. The migration actually worked fine with no errors, but when I tried to update PloneFormGen to the current version (1.7.8), I get this:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 580, in installProducts
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 512, in installProduct
- __traceback_info__: ('PloneFormGen',)
Module Products.GenericSetup.tool, line 350, in runAllImportStepsFromProfile
- __traceback_info__: profile-Products.PloneFormGen:default
Module Products.GenericSetup.tool, line 1100, in _runImportStepsFromContext
Module Products.GenericSetup.tool, line 1015, in _doRunImportStep
- __traceback_info__: pleonformgen
Module Products.PloneFormGen.setuphandlers, line 79, in importVarious
Module Products.PloneFormGen.setuphandlers, line 34, in update_kupu_resources
AttributeError: getPortalTypesForResourceType
Any thoughts? I saw something about Kupu having old references to linkable types, but I think this might be a different problem. I checked through my linkable resource types and they all seem to be the standard ones.
Thanks!
I suggest you check the "Resource Types" in the Visual Editor configlet on the Plone 3.3 side. Make sure it doesn't refer to any types that are either not installed or won't be available in 4.3. You may be able to eliminate the uninstalled types simply by saving the config.
And, make sure that PFG you upgrade to is 1.7.11+. There's a security advisory covering 1.7.8 and earlier.
Related
I'm trying to upgrade a Plone 4.0.10 site to 5.0. I went through the upgrade to 4.3.6 and somewhat painfully got it to work there. In my Data.fs I have two Plone sites: the site in question, and another one that has nothing but the default content (News, Events, Users). When I moved the Data.fs and blobs from the 4.3.6 to the Plone 5 instance, the "empty" site upgraded fine. However, if I even try to go to the ZMI root for the production site, or to load the site, I get this:
2015-12-05 17:19:24 ERROR Zope.SiteErrorLog 1449364764.10.146181213601 http://localhost:8080/mysite
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.BaseRequest, line 444, in traverse
Module ZPublisher.BeforeTraverse, line 97, in __call__
Module Products.CMFCore.PortalObject, line 75, in __before_publishing_traverse__
Module zope.event, line 31, in notify
Module zope.component.event, line 24, in dispatch
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module zope.component.event, line 32, in objectEventNotify
Module zope.component._api, line 136, in subscribers
Module zope.component.registry, line 321, in subscribers
Module zope.interface.adapter, line 585, in subscribers
Module plone.app.theming.plugins.hooks, line 33, in onRequest
Module plone.app.theming.policy, line 91, in isThemeEnabled
AttributeError: 'NoneType' object has no attribute 'enabled'
I don't know why plone.app.theming is involved, since the old site had no Diazo theme, and I'm just loading the ZMI. Also, the problem seems to be that there is no IRegistry:
In plone.app.theming.policy.getSettings:
def getSettings(self):
"""Settings for current theme."""
registry = queryUtility(IRegistry)
And registry at this point is None, and so is settings in plone.app.theming.policy.isThemeEnabled.
Any suggestions on how to proceed?
plone.app.theming has to be installed in Plone 4. Include p.a.t in your Plone 4.3.6 Site and re-upgrade.
(How to upgrade sites to Plone 5, 24:15)
I created a new content type using the Dexterity manager in Site Setup. I'm able to successfully add content through the Plone user interface, but I've come to a point where I need to create the same object with a python script.
My first attempt was with invokeFactory:
context.invokeFactory("mycontenttype", id="test", Title="Test")
This same code works for "Folder" objects, but fails with my Dexterity type:
Traceback (innermost last):
Module ZPublisher.Publish, line 60, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Products.PloneHotfix20130618.spamProtect, line 35, in _patched_bindAndExec
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 7, in test
- <PythonScript at /three-year-plan/test>
- Line 7
TypeError: invokeFactory() takes at least 3 arguments (2 given)
After doing some more searching, I found several places referring to the following function:
from plone.dexterity.utils import createContentInContainer
Any attempt to import from plone.dexterity.utils in my python scripts ends up with a permissions error:
Traceback (innermost last):
Module ZPublisher.Publish, line 60, in publish
Module ZPublisher.mapply, line 77, in mapply
zModule ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Products.PloneHotfix20130618.spamProtect, line 35, in _patched_bindAndExec
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 1, in test
- <PythonScript at /my-site/test>
- Line 1
Module AccessControl.ZopeGuards, line 305, in guarded_import
Unauthorized: import of 'plone.dexterity.utils' is unauthorized
Any help in resolving the errors above or alternative methods would be greatly appreciated. Version details are posted below for reference.
Version Overview
Plone 4.3.1 (4306)
CMF 2.2.7
Zope 2.13.19
Python 2.7.3 (default, Aug 1 2012, 05:14:39) [GCC 4.6.3]
PIL 1.7.8 (Pillow)
Dexterity Content Types 2.0.8
You should be able to use "invokeFactory" for this purpose. You call it on the container and pass it the type name as a string.
I'm not sure where your attempt to use the invokeFactory method went awry, but it does work. See http://developer.plone.org/reference_manuals/external/plone.app.dexterity/reference/manipulating-content-objects.html?highlight=invokefactory#adding-an-object-to-a-container for details.
Your guess is right: you have to use createContentInContainer.
But you cannot use it in a Python script because only the so called restricted Python is allowed [1]. Put it in a view [2].
As a reference have a look to:
http://developer.plone.org/reference_manuals/active/helloworld/extend/view.html
http://plone.org/documentation/faq/restricted-python-scripts
here is my traceback from a Plone 4.2.1 installation (on SuSE Linux):
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module OFS.ObjectManager, line 620, in manage_importObject
Module OFS.ObjectManager, line 638, in _importObjectFromFile
Module ZODB.ExportImport, line 92, in importFile
Module transaction._transaction, line 260, in savepoint
Module transaction._transaction, line 257, in savepoint
Module transaction._transaction, line 690, in __init__
Module ZODB.Connection, line 1123, in savepoint
Module ZODB.Connection, line 587, in _commit
Module ZODB.ExportImport, line 176, in _importDuringCommit
AttributeError: 'module' object has no attribute 'NavigationViewlet'
The strange thing, that I do not understand is, why only one Plone Site shows this error during import into an instance newer than Plone 4.1.5?
The Plone site has only the following additional plugins/products installed (as others too, but they all work fine):
LinguaPlone
PloneFormGen
Products.ZSyncer
collective.quickupload
So, where is my mistake/error?
Thanx for any help, because the site is too big now to "rebuild" it in a new Plone instance from scratch :-(
The plone.app.layout.viewlets.links.NavigationViewlet was removed in plone.app.layout version 2.2 (see this entry into the HTML5 PLIP and this commit).
ZEXP imports into different version stacks are generally fraught with problems, exactly because of changing persistent object locations. You'll have to import to an earlier version of the software stack, then follow the regular Plone upgrade path to bring yourself up to a more recent version of Plone.
The upgrade scripts take care of removing references to removed viewlets like these, for example.
Can anybody explain me that error - and how I can repair it?
We use:
Plone 4
Zope 2.12.19
ZEO
zodb-temporary-storage
Error Log
Site Error
An error was encountered while publishing this resource.
Sorry, a site error occurred.
Traceback (innermost last):
Module ZPublisher.Publish, line 239, in publish_module_standard
Module ZPublisher.Publish, line 197, in publish
Module ZPublisher.Publish, line 197, in publish
Module ZPublisher.Publish, line 197, in publish
Module ZPublisher.Publish, line 173, in publish
Module plone.app.linkintegrity.monkey, line 17, in zpublisher_exception_hook_wrapper
Module ZPublisher.Publish, line 135, in publish
Module Zope2.App.startup, line 291, in commit
Module transaction._manager, line 93, in commit
Module transaction._transaction, line 322, in commit
Module transaction._transaction, line 419, in _commitResources
Module ZODB.Connection, line 767, in tpc_vote
Module ZEO.ClientStorage, line 1068, in tpc_vote
Module ZEO.ClientStorage, line 905, in _check_serials
ConflictError: database conflict error (oid 0x08, class Products.Transience.Transience.Length2, serial this txn started with 0x0394fddba7126fbb 2012-03-08 07:23:39,157504, serial currently committed 0x0394fddbb0a4cb22 2012-03-08 07:23:41,400873)
Troubleshooting Suggestions
The URL may be incorrect.
The parameters passed to this resource may be incorrect.
A resource that this resource relies on may be encountering an error.
For more detailed information about the error, please refer to the error log.
If the error persists please contact the site maintainer. Thank you for your patience.
I tried to repaire the Data.fs without any errors...
Thanks in advance.
Conflict Errors occur when two users try to update the same object (often one that is part of a catalogue data structure) at the same time and the system cannot resolve the conflict. You should ensure that your ZEO server includes all of the eggs from the Zope instance to ensure you have all the conflict resolution code.
If you are seeing these on simple views, then it probably means you have some code that is updating the database on rendering that view. This is not a good idea with ZODB.
Whenever I try to access "User and Groups" in Plone Site Setup, I'm getting the following error :
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module plone.app.controlpanel.usergroups, line 211, in __call__
Module plone.app.controlpanel.usergroups, line 270, in doSearch
KeyError: 'adminusername'
This plone instance has previously been upgraded from Plone 3 to Plone 4. Users and Groups used to work. A new blank Plone instance created in the same Zope allows access to Users and Groups.
Versions used are :
Plone 4.0.7
Zope 2.12.18
Python 2.6.5 (r265:79063, Nov 23 2010, 02:02:03) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]
Check your logs very carefully. I'm doing a lot of work with PAS plugins right now, and I'm seeing similar sorts of errors when adapters/subscribers are misconfigured, but the errors they generate are masked by the form error above. Look at the error immediately before this one.