Comments (9)
Related: #93
from collective.exportimport.
Aha:
ERROR:collective.exportimport.export_content:Error exporting http://nohost/manuelamador.name/manuel-amador-lebenslauf
Traceback (most recent call last):
File "/home/user/optplone/deployments/master/src/collective.exportimport/src/collective/exportimport/export_content.py", line 281, in export_content
item = serializer()
File "/home/user/optplone/buildout-cache/eggs/cp38/plone.restapi-6.15.0-py3.8.egg/plone/restapi/serializer/dxcontent.py", line 107, in __call__
result["allow_discussion"] = getMultiAdapter(
File "/home/user/optplone/buildout-cache/eggs/cp38/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 104, in getMultiAdapter
raise ComponentLookupError(objects, interface, name)
zope.interface.interfaces.ComponentLookupError: ((<Document at /manuelamador.name/manuel-amador-lebenslauf>, <HTTPRequest, URL=http://nohost>), <InterfaceClass zope.interface.Interface>, 'conversation_view')
All of my content objects raise ComponentLookupError
when exported via the CLI. This does not arise when exporting via the Web interface by point and click.
What gives? Is my REQUEST
object not valid or something?
from collective.exportimport.
The snippet of code in dxcontent.py
that specifically causes this:
result["allow_discussion"] = getMultiAdapter(
(self.context, self.request), name="conversation_view"
).enabled()
Why is the conversation view not registered for my Dexterity content? This happens for all my sites, even freshly-created ones. I have to conclude there is something about running from the Plone debug CLI that causes this. How can I trace the situation to the problem? Thanks in advance.
from collective.exportimport.
By the way, the export from CLI problem happens in both Plone 5.x and Plone 6.
from collective.exportimport.
Note that I have verified that the configure.zcml
from plone.app.discussion.browser
that registers the conversation_view
is in fact loaded during the client script startup (I broke it intentionally and saw it fail to start).
from collective.exportimport.
OK.
Using the CLI:
(<FolderishDocument at /manuelamador.name/manuel-amador-lebenslauf>, <HTTPRequest, URL=http://nohost>) [classImplements(?), directlyProvides(HTTPRequest, IDefaultBrowserLayer, IPathBlobsMarker, IMigrationMarker, IRawRichTextMarker, classImplements(HTTPRequest, IBrowserRequest, IAttributeAnnotatable))]
ERROR:collective.exportimport.export_content:Error exporting http://nohost/manuelamador.name/manuel-amador-lebenslauf
Traceback (most recent call last):
File "/home/user/optplone/deployments/601a/src/collective.exportimport/src/collective/exportimport/export_content.py", line 280, in export_content
item = serializer(include_items=False)
File "/home/user/optplone/buildout-cache/eggs/cp38/plone.restapi-8.16.2-py3.8.egg/plone/restapi/serializer/dxcontent.py", line 150, in __call__
folder_metadata = super().__call__(version=version)
File "/home/user/optplone/buildout-cache/eggs/cp38/plone.restapi-8.16.2-py3.8.egg/plone/restapi/serializer/dxcontent.py", line 111, in __call__
result["allow_discussion"] = getMultiAdapter(
File "/home/user/optplone/buildout-cache/eggs/cp38/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 104, in getMultiAdapter
raise ComponentLookupError(objects, interface, name)
zope.interface.interfaces.ComponentLookupError: ((<FolderishDocument at /manuelamador.name/manuel-amador-lebenslauf>, <HTTPRequest, URL=http://nohost>), <InterfaceClass zope.interface.Interface>, 'conversation_view')
Using the Web UI:
(<FolderishDocument at /manuelamador.name/manuel-amador-lebenslauf>, <WSGIRequest, URL=http://127.0.1.4:8080/manuelamador.name/@@export_content>) [classImplements(?), directlyProvides(WSGIRequest, IPloneFormLayer, IDiscussionLayer, IThemingLayer, IBrowserLayer, IPloneAppContenttypesLayer, IThemeSpecific, collective.folderishtypes.dx.interfaces.IThemeSpecific, IManuelAmadorPolicyLayer, IDefaultBrowserLayer, IPathBlobsMarker, IMigrationMarker, IRawRichTextMarker)]
The differences are stark in what interfaces are provided by the object when requested via the CLI, vs. when requested via the Web UI.
Why!?
from collective.exportimport.
Uh there's also no difference what request I use (tried both makerequest
and a hack to use WSGIRequest
).
Is there some special initialization I need to be doing right before I call the export_content()
view? Thanks in advance.
from collective.exportimport.
Could it be that the call to setDefaultSkin
during Zope startup (executed during do_run()
by plone.recipe.zope2instance.ctl
)is not actually including the correct skins? I tried adding option no_request
to it, and it seems like it worked to not add the REQUEST
object to the app
, but ...
from collective.exportimport.
Updated gist of code: https://gist.github.com/Rudd-O/4e657a90b8bc405de08d143221cee5ac (the part where "content" is skipped should be removed).
To be run using bin/client --no-request -c export_content.py site_id /path/to/export
.
from collective.exportimport.
Related Issues (20)
- Discussion importer should not check for discussion support being enabled on a particular content object HOT 4
- why is the UID set after the custom_contenttype hook? HOT 2
- Can't export content with versions in Plone 5.0 HOT 1
- Robustness in content_export for CMFEditions versions, lock_info
- fix_html_in_portlets should also support additional fixers
- Timezone dropped from non-naive datetimes during conversion
- Better Reporting of Failed Exported Objects
- relative path not used when exporting p.a.redirector rules HOT 1
- Usage of json.dumps before deserialization @import HOT 2
- Editing revision author is not preserved on import HOT 1
- ```Import of plone.app.contenttypes.migration.topics import CONVERTERS not working with V 1.9 HOT 1
- Import of plone.app.contenttypes.migration.topics import CONVERTERS not working with V 1.9 HOT 2
- KeyError: 'time' for history_item HOT 1
- Migration between Volto sites HOT 4
- LDAP principals not added to existing groups
- Error during export from Plone 4.3 HOT 2
- KeyError: '@id' while importing redirects/ordering with collective.exportimport 1.10 HOT 1
- Readme does not render due a issue in github HOT 7
- [ClassicUI] Error exporting collections because include_items is always True (deserialization error)
- migration is always true HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collective.exportimport.