Upgrade to 5.2 failing with 'IATCTTool' has no attribute '__iro__'

Thanks, I will report back with my results.

I just migrated a site from 3.x to 5.2 and I did not manage to migrate Archetype content in 5.2

If I migrated the content to Dexterity in 5.1.5 and then migrated to 5.2 it worked.

Have you explicitly installed Archetypes in your 5.2 Plone? By default, Plone 5.2 no longer installs Archetypes (and the migration to Dexterity requires it).

@dieter are you responding to espen or to me?
I wrote above that I did add Products.ATContentTypes to the buildout, but then it wouldn't even start. I will try by adding the [archetypes] extra to Plone in the eggs, as suggested by @pbauer.

You should run Products.ATContenttype 's uninstall profile from ZMI ->"portal_setup" ->"advance import setup" before upgrade to Plone5.2.x .

With the above change to buildout I was able to complete the upgrade to 5.2, and it seems to work fine. The caveat is that no matter what I try to clean up, if I remove the [archetypes] extra from buildout, I still get the 'IATCTTool' has no attribute '__iro__' error.

In detail:

Happy path:

In 5.1:

  • Uninstall Products.Archetypes and plone.app.collections (Archetypes-based collections) from portal_quickinstaller (oddly, Products.Archetypes is listed both under installed products and under installable products, and I have to uninstall it twice before it's gone from installed products).
  • Delete portal_atct, portal_factory, portal_languages and portal_tinymce in the ZMI
  • Shut down 5.1 and copy filestorage and blobstorage over to 5.2

In 5.2:

  • In buildout, add the [archetypes] extra to the Plone egg. (It is not necessary to have Products.ATContentTypes egg). Re-run buildout.
  • Start the instance and run upgrade at @@plone-upgrade --> success

Now I have a working 5.2 site.

However:

  • portal_atct, portal_factory, portal_lanugages and portal_tinymce are back in the ZMI, even though I had explicitly deleted them before. I can delete them again, but that doesn't help.
  • @dieter: wildcard.fixpersistentutilities doesn't help. There is nothing it can do here.
  • @adam139: running the uninstall profile for Products.ATContentTypes seems to do the opposite of what it says, and definitely does not help.
  • all my content is Dexterity at this point, but something still needs to be cleaned up and I don't know what.
  • If I remove the [archetypes] extra from buildout, the site breaks again.

Please note that this is a very, very simple site without any customizations. The only complication is that it is quite old, upgraded over the years from who knows what old version of Plone, and at some point may have had some other content types present, later deleted.
So if it is difficult to upgrade this, I think we really don't have a good upgrade story yet.

2 Likes

I already mentioned wildcard.fixpersistentutilities (--> PyPI) in a previous response. Its primary aim is to fix up situations like yours.

  • You may have Archetypes and Products.Archetypes registered as installed products, thus you can uninstall it twice. I think I had the same issue with ATContentTypes and Products.ATContentTypes.

  • I had a case where I had to run Products.ATContentTypes:uninstall even after removing the tools. That helped:

      # remove obsolete AT tools
      tools = [
          'portal_languages',
          'portal_tinymce',
          'kupu_library_tool',
          'portal_factory',
          'portal_atct',
          'uid_catalog',
          'archetype_tool',
          'reference_catalog',
          'portal_metadata',
      ]
      for tool in tools:
          try:
              portal.manage_delObjects([tool])
              log.info('Deleted {}'.format(tool))
          except AttributeError:
              log.info('{} not found'.format(tool))
    
      # reapply uninstall to get rid of IATCTTool component
      try:
          loadMigrationProfile(
              setup,
              'profile-Products.ATContentTypes:uninstall',
          )
      except KeyError:
          pass
    

Also: plone.app.upgrade.utils.alias_module is your friend if there are interfaces or tools that are hard to remove. Check
https://github.com/plone/plone.app.upgrade/blob/master/plone/app/upgrade/init.py if you want to have you mind blown.

1 Like

And I already mentioned that wildcard.fixpersistentutilities does not help in this case.
Whether I go to /@@fix-persistent-utilities or /@@fix-interfaces-fpu, there is nothing that applies to removing IATCTTool, since it's not a real dotted interface name, and it can't find it.

Thanks, @pbauer. I think it's fixed now. I was able to remove the [archetypes] extra from the buildout, and the no attribute '__iro__' error did not come back.

I'm not sure what did the trick, but I think it was running profile-Products.ATContentTypes:uninstall twice, and then going back and re-deleting portal_languages and portal_tinymce again (they came back, like the phoenix, although none of the others did).

Sorry. I read only the emails not the discussion forum itself -- and, unfortunately, the email delivery is unreliable. This way, I missed your experience report about wildcard.fixpersistentutilities.

Initially, CMFCore tools (such as the ATCTTool) have been accessed via acquisition. With the advent of the "Zope toolkit", one thought it more modern to access them as (Zope toolkit) utilities.Therefore, modern "CMFCore tools" register as local utilities. You error message clearly indicates that your portal contains an IATCTTool utility and fix-persistent-utilities should find it. Almost surely, you use it in the wrong way; maybe, you use it outside the portal context (persistent utilities are only seen/effective below the "site" containing their registration (the Plone portal in case of Plone))?

@fulv Can you tell me where and how to run Products.ATContentTypes:uninstall in plone 5.1.5?

@hugozu: The easiest way is this: In the ZMI, go to portal_setup, click on Import tab, then under or you can select a profile by id : look for profile-Products.ATContentTypes:uninstall. Then click on the Import all steps button.

Thanks.
Is this default? Where and how can I add this to profile?

# remove obsolete AT tools
  tools = [
      'portal_languages',
      'portal_tinymce',
      'kupu_library_tool',
      'portal_factory',
      'portal_atct',
      'uid_catalog',
      'archetype_tool',
      'reference_catalog',
      'portal_metadata',
  ]
  for tool in tools:
      try:
          portal.manage_delObjects([tool])
          log.info('Deleted {}'.format(tool))
      except AttributeError:
          log.info('{} not found'.format(tool))

  # reapply uninstall to get rid of IATCTTool component
  try:
      loadMigrationProfile(
          setup,
          'profile-Products.ATContentTypes:uninstall',
      )
  except KeyError:
      pass

I don't know what you are asking. The ZMI approach I gave you yesterday is basically the manual equivalent of this code:

Sorry, I'd thought code modification.

I had the same problem as fulv, occurring on about half of my sites. I migrated all of my content types to Dexterity in 5.0 but these Archetypes utilities have long legs. pbauer's script seems to resolve the issue completely.

Hilariously, wildcard.fixpersistentutilities caused the same iro attribute when trying to view its browser resource. Not a comforting sign to see that.

I migrated from 4.3 to 5.1 and then to 5.2-python2. I had to delete several product objects that didn't have support for Plone 5.1 and 5.2 at the time (collective.cover, PloneFormGen, Plone True Gallery, Reset Password Tool), I also used wildcard.fixpersistentutilities and @atct_migrator. I had to add wiked and Plone [archetypes] in buildout.cfg in version 5.2-python2. I had to uninstall Products.Archetypes and plone.app.collections for each site using portal_quickinstaler, in addition to deleting the folders portal_atct, portal_factory, portal_languages, and portal_tinymce.

So far everything has worked on Plone 5.2-python2, but I haven't been able to migrate to version 5.2-python3. I was able to run zodbupdate after adding wicked, Plone [archetypes] and eea.aliases to [buildout] eggs, but when I start Plone 5.2-python3 there are several errors like "AttributeError: type object 'IATCTTool' has no attribute 'iro' ".

I returned to Plone 5.2-python2 and followed the procedure described by fulv, getting the following error messages:

  • pleonformgen - ERROR: Step pleonformgen has an invalid import handler
    toolset: Toolset imported.
  • languagetool - ERROR: Step languagetool has an invalid import handler
    toolset: Toolset imported.
  • collective.plonetruegallery.install - ERROR: Step collective.plonetruegallery.install has an invalid import handler
    collective.plonetruegallery.uninstall - ERROR: Step collective.plonetruegallery.uninstall has an invalid import handler
  • collective.portlet.calendar-upgrades - ERROR: Step collective.portlet.calendar-upgrades has an invalid import handler
  • collective.z3cform.datetimewidget - ERROR: Step collective.z3cform.datetimewidget has an invalid import handler

When I run zodbupdate and start Plone 5.2-python 3 there are still errors (AttributeError: type object 'IATCTTool' has no attribute 'iro' ) and Plone does not work.

Can someone help me?

How do I execute the script reported by @pbauer (Aug '19)? Do I save it to a clean_plone.py file and run "bin/instance run /plone/instance/clean_plone.py"?

This did not work for me. I got the following error messages:

Traceback (most recent call last):
    File "/plone/instance/parts/instance/bin/interpreter", line 287, in <module>
        exec(_val)
    File "<string>", line 1, in <module>
    File "/plone/instance/clean_plone.py", line 15, in <module>
        portal.manage_delObjects([tool])
NameError: name 'portal' is not defined

All the code in https://github.com/collective/collective.migrationhelpers is meant to be used in your own upgrade-steps. If you don't know what that means I suggest you read https://training.plone.org/5/mastering-plone/dexterity_2.html#upgrade-steps and https://docs.plone.org/develop/addons/components/genericsetup.html#upgrade-steps.

Simple examples how they are used in real life for upgrade-steps that migrated https://www.plone.de from Plone 4.3 to 5.2 can be found in https://github.com/collective/plonesite.de/blob/master/src/plonede.policy/plonede/policy/upgrades.zcml and https://github.com/collective/plonesite.de/blob/master/src/plonede.policy/plonede/policy/upgrades.py.

More examples are mentioned in Small project migration with customized barceloneta.

Errors like this typically indicate that the definition of the reference interface is not available. I would not be surprised as ATCT refers to "ArcheType based Content Types" and as far as I know, there is not Python 3 compatible Archetypes version. Eliminate Archetypes (migrating to dexterity) before you switch to Python 3.

Plone Foundation Code of Conduct