How to fix error related to 'portal_factory'

Hi, everyone. I have had a problem while trying to install the add-ons named Multilingual ArchType ... which is a standard one, it comes with Plone 5. With the result that the error message: "AttributeError('portal_factory',) (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: portal_factory)" poped up. After that plone page did not show up again. I still can visit the zope's ZMI page but I do not know how to correct this error. When I looked up at the var/log file it says something like:

2018-02-07T06:28:20 ERROR root Exception while rendering an error message
File "Script (Python)", line 41, in standard_error_message
template: <ImplicitAcquisitionWrapper default_error_message at 0x7f586aaf7b90>
2018-02-07T06:28:29 ERROR root Exception while rendering an error message
File "Script (Python)", line 41, in standard_error_message

I am using Debian 9 with Plone 5.08 installed.
How do I solve this error?

What is Multilingual ArchType?
Please provide the full traceback and describe how to reproduce the error.

Sorry, I meant "Multilingual Support (Archetypes)." I will send the full traceback shortly.

Why do you need Archetypes if you start fresh with Plone?

I am a new user, hence, after installing "Multilingual Support". I thought may be I need also to install "Multilingual Support (Archetype)". That's why I did.

I am not so sure on how I produced the error, but it occurred when I clicked "Install" for the Multilingual Support (Archetype.

What I sent is the full traceback. It dated 2 Feb 2018. Before this traceback dated before 2 Feb 2018.

There are 2 files namely instance.pid and instance.lock in the var directory of plone. Are these 2 files involved?

What do you want with Archetypes???
Dexterity and Dexterity content types are the way to go in Plone 5. Forget Archetypes unless you have some legacy stuff.

"Archetypes" has been the former content framework; Plone 5 switched to "dexterity" for that. As Andreas suggested, you likely do not need Multilingual Support (Archetype).

Plone 5 no longer has portal_factory (at least not by default). It was a helper for the creation of "Archetype" objects; apparently, "dexterity" no longer needs such a helper.

Thanks a lot for both Dieter Maurer and Andreas Jung. My site is rather new, hence, I do not need the Archetype, confirmed.

My problem is how do I get the plone site back? I do not know how to solve this error.

You could try an "Undo" (it can undo the latest changes in the ZODB) or you could try an "uninstall" of the problematic extension. Both will require that your Plone site is at least partly working. There are ways to fix things even when this is not the case - but then it gets more difficult (and some data may get lost).

Perhaps, you can also start over (i.e. create a new site).

Dear Dieter Maurer,
I might create a new plone site to replace the trouble one, if necessary. But, first of all I will do as you kindly suggested. I can not get to plone, but I can access to zope's ZMI. There is not much stored in that site, though, but I like to learn to solve this problem. Thanks a lot.

Glad to report to you Dieter, I did use "undo" to the site ZMI for "Undo /TEAM-SK-KM/install_products by admin" which was recorded at the time the error message reported. Now I get the plone site back. It works like magic. Many manymany thanks.

to give more context to the excellent answers already provided, portal_factory does not exist by default, it is created when you enable Archetypes. So the problem occurred because you installed the mutltilingual support for Archetypes without installing first Archetypes (I don't want to be sarcastic, it's just that you can't be supposed to know everything historic about Plone)

  1. for experienced people here: is there no way in the Plone api to specify dependencies between add-ons so it's not possible to enable an add-on without first enabling the add-on on which it depends ?

  2. for you: there are 2 ways to avoid this kind of pitfall while continuing to be able to experiment some things;

  • the complicated one: set up a test computer and do everything not ordinary like enabling an add-on 2 times, one on the test computer, then on the real one.
  • the easy one: virtual (vm or containers). If you run inside one of these environments, you have just to wait for some time when the system is not used and run a snapshot, try the change, if it does not seems to break, commit the snapshot.
    As an example, I use lxc. Here is what I did to test your problem

lxc stop plone --> stop the container running the vanilla Plone 5 with unified installer
lxc snapshot plone snap1 -> create a snapshot
lxc start plone -> restart the container
<connect to the container with ssh and run bin/instance fg>
<test... argh,, my site is broken !>
exit the container
lxc stop plone
lxc restore plone snap1
lxc delete plone/snap1
lxc start plone

done, the site is back.. Lxc is not the most user friendly virtualization solution, it's fast and nice on resources (I run 6 different Plone environments using 7 Gb of disk space) but not easy to use. VM such as Vmware or VirtualBox are slower and ask much more disk space but are more clickety friendly.

Once you have gone the virtual way, you can also mix the 2 solutions (clone a running site to create a test site is really easy).

Thanks for your overview of the problem I have had. Much appreciate for your suggestion on 2 ways for future scenarios. For the easy way, I have never had an experience on vm or containers, but got the idea. I will try familiarize with the lxc and snapshots. Have a nice time.

Many add-on's are essentially configured via a GenericSetup profile. For such a profile, you can specify dependencies (on other profiles). When such a profile is imported, all dependent profiles are imported as a preliminary step.

I think (though I am not sure), that the Plone add-on infrastructure recognizes an add-on installation, when its associated GenericSetup profile is imported (I seem to remember that I have seen this for some add-ons).

I was also in the Same problem when I installed archetypes ,then I was not getting an Undo option ,if I try to open any link from the point where I installed archetypes I got same error everywhere,so what should I do

Can you access the ZMI ?