collective / collective.exportimport

Export and import content and other data from and to Plone
GNU General Public License v2.0
15 stars 17 forks source link

Unable to install on Plone 4.3 and Python 2.7 #166

Closed canepan closed 8 months ago

canepan commented 1 year ago

Hi, as soon as I became aware of the existence of this addon, I begun trying to install it on my 4.3 instance, to be able to achieve the migration I was waiting since many years to perform. Unfortunately, I have been unable to activate it so far. Issues encountered:

Now I am facing

  File "/mnt/opt/Plone-4.3.19/Python-2.7/lib/python2.7/site-packages/setuptools/config.py", line 350, in _parse_attr
    value = getattr(module, attr_name)
AttributeError: 'module' object has no attribute '__version__'
An error occurred when trying to install PyJWT 2.6.0. Look above this message for any errors that were output by easy_install.
While:
  Installing instance.
  Getting distribution for 'PyJWT'.
Error: Couldn't install: PyJWT 2.6.0

probably caused by setuptools, which I'm not sure how to address.

This adds up to the difficulties of getting a recent unified installer for Plone 4.3 (the download has been hidden in the plone site, unfortunately) and to the issue with SNI.

Please, help me have a working installation so I can migrate to Plone 6

canepan commented 1 year ago

The final list of entries added to the [version] section of my buildout.cfg is:

importlib-metadata = 2.0.0
attrs = 21.4.0
PyJWT = 1.7.1
zipp = 1.0.0
configparser = 3.5
more-itertools = 5.0.0

Also with version 7.0.0 of more-itertools I was able to build, but 5.0.0 should be the latest to support 2.7, so I used that

canepan commented 1 year ago

After managing to install as per above, I don't see any content available for export from /@@export_content

canepan commented 1 year ago

Here is what I see from the export URL:

Screen Shot 2022-12-24 at 17 35 23
pbauer commented 1 year ago

Except for PyJWT none of your pinns are required for exportimport on Plone 4.3. You seem to pull in some other package that is to new and pulls in the others. Probably jsonschema, plone.schema or plone.restapi.

canepan commented 1 year ago

The errors about those packages appeared after I addet just exportimport to buildout.cfg. I can't remove the other dependencies, or the site (with my Data.fs) won't be usable.

Which version in the 4.3 series is tested, so I can try with that?

Is there a way to understand why I see no selectable content?

pbauer commented 1 year ago

The list of content-types and their amount you should see is the result of a catalog-query done in https://github.com/collective/collective.exportimport/blob/main/src/collective/exportimport/export_content.py#L309 If you see nothing there either you catalog is broken/empty, the content-types are not properly registered or the query is somehow wrong. I suggest you add a pdb there and inspect the query and the results returned by the catalog. If the catalog is the issue you could reindex it.

pbauer commented 1 year ago

If you need help you can ping me on discord (https://discord.gg/zFY3EBbjaj) and I could have a look.

canepan commented 1 year ago

Sorry for the delay, it was the firts time I set a trace inside Plone, and I had to figure out, plus with the holidays...

I already tried to "Update catalog", "Clear and Rebuild" (which fails with KeyError: 'Members-it') and "Clear catalog", with no visible changes. I tried again now, but both before and after, I get the following (I stopped at line 315):

(Pdb) [fti.id for fti in portal_types.listTypeInfo()]
['ATBooleanCriterion', 'ATCurrentAuthorCriterion', 'ATDateCriteria', 'ATDateRangeCriterion', 'ATListCriterion', 'ATPathCriterion', 'ATRelativePathCriterion', 'ATPortalTypeCriterion', 'ATReferenceCriterion', 'ATSelectionCriterion', 'ATSimpleIntCriterion', 'ATSimpleStringCriterion', 'ATSortCriterion', 'Discussion Item', 'Document', 'Event', 'File', 'Folder', 'Image', 'Link', 'News Item', 'Plone Site', 'TempFolder', 'Topic', 'client', 'project', 'iteration', 'task', 'nicola', 'LRF', 'LIF']
(Pdb) query
{'path': {'query': '/PTK', 'depth': -1}, 'portal_type': [], 'sort_on': 'path'}
(Pdb) [catalog.unrestrictedSearchResults(path={'query': '/PTK', 'depth': -1}, portal_type=[fti.id], sort_on='path') for fti in portal_types.listTypeInfo()]
[[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
mauritsvanrees commented 1 year ago

exportimport pulls in plone.restapi, which pulls in several other dependencies that give you problems. See notes on installation of plone.restapi 7.x.x.

When you do "Clear catalog" the catalog becomes empty. So then it is expected that you only get empty lists. I would expect the search page to always come up empty as well now. "Clear and rebuild" should be good, but you would need to figure out where the KeyError for Members-it comes from.

Perhaps collective.catalogcleanup helps.