Could not log-in to my plone site due to AtributeError: exclude_from_nav

I am new comer to Plone. Had made an experiment to use Zope's portal_catalog at my plone site, by creating ZCatalog and tried to use Z Search Interface. Somehow there was an error message:

AttributeError('exclude_from_nav',) (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: exclude_from_nav)

incidentally I happened to logged out from my plone site. Afterward, I could not visit my plone site again. How do I revert back to be able to visit to my plone site again? Any suggestion?

Welcome!

I fear there is a bit of confusion: portal_catalog is an object in your Plone portal (accessible via <url_to_your_plone_portal>/portal_catalog/manage_main). It is fully configured and setup up to automatically index any content you put into your Plone portal. You need to change or manually manage it only for extensions or in case of rare situations (e.g. to fix a catalog inconsistency). portal_catalog is build on top of Zope's ZCatalog but you do not get a portal_catalog by creating a ZCatalog.

What you should do instead (if you do not yet have done it): create a "Plone site" (aka Plone portal) instead of a ZCatalog. This will contain an object portal_catalog which is a (somewhat extended) ZCatalog. Add content to your "Plone site". This will become automatically indexed in portal_catalogand can be found via searches.

I fear there is a bit of confusion:

Many thanks to you, Dieter. My problem is that I can not log in into my site because of the error message mentioned. I tried "url-to-my.plone.site/portal_catalog/manage_main", but still get the same error message. There are a lot more information in the site, hence how can I get access to the site.

It is unusual that you cannot log in to a newly created Plone site (aka: Plone portal). You might have hit a bug in a particular Plone version or something might have gone wrong with the installation or site creation.

Up to now, we know only that you observe an AttributeError, exclude_from_nav. exclude_from_nav is a standard Plone attribute, available for all Plone content objects in order to control whether this object is relevant for navigation (= content browsing). We need more information to effectively help you.

First thing to mention is which version of Plone you are using.
The second thing is to provide "the full details" from the "event log". The "event log" is one of Plone's logfiles, situated under var/<something>/event.log where the <something> is typically either instance or client1 (depending on the installation type for Plone). For most exceptions, you will find there a so called "traceback" which provides details where and in which context the exception has been raised. This information (in fact the complete log "entry" containing the traceback) is vital for an effective analysis of a problem.

Here is my log file (quite long):
2018-11-25T11:31:14 ERROR root Exception while rendering an error message
Traceback (most recent call last):
File "/home/user01/plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/SimpleItem.py", line 242, in raise_standardErrorMessage
v = s(**kwargs)
File "/home/user01/plone/buildout-cache/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPythonScript.py", line 127, in call
return Script.call(self, *args, **kw)
File "/home/user01/plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in call
return self._bindAndExec(args, kw, None)
File "/home/user01/plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/user01/plone/buildout-cache/eggs/Products.PythonScripts-2.13.2-py2.7.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
result = f(*args, **kw)
File "Script (Python)", line 41, in standard_error_message
File "/home/user01/plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in call
return self._bindAndExec(args, kw, None)
File "/home/user01/plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/home/user01/plone/buildout-cache/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 237, in _exec
result = self.pt_render(extra_context=bound_names)
File "/home/user01/plone/buildout-cache/eggs/Products.CMFCore-2.2.10-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 177, in pt_render
self, source, extra_context
File "/home/user01/plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 87, in pt_render
showtal=showtal)
File "/home/user01/plone/buildout-cache/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations
File "/home/user01/plone/buildout-cache/eggs/five.pt-2.2.4-py2.7.egg/five/pt/engine.py", line 98, in call
return self.template.render(**kwargs)
File "/home/user01/plone/buildout-cache/eggs/z3c.pt-3.0.0a1-py2.7.egg/z3c/pt/pagetemplate.py", line 163, in render
return base_renderer(**context)
File "/home/user01/plone/buildout-cache/eggs/Chameleon-2.25-py2.7.egg/chameleon/zpt/template.py", line 261, in render
return super(PageTemplate, self).render(**vars)
File "/home/user01/plone/buildout-cache/eggs/Chameleon-2.25-py2.7.egg/chameleon/template.py", line 191, in render
raise_with_traceback(exc, tb)
File "/home/user01/plone/buildout-cache/eggs/Chameleon-2.25-py2.7.egg/chameleon/template.py", line 171, in render
self._render(stream, econtext, rcontext)
File "f4ed20f546762ceb6468dd2b36c62925.py", line 1492, in render
File "81fbb1b0e9c8e84023008cf7e2307285.py", line 1111, in render_master
File "/home/user01/plone/buildout-cache/eggs/z3c.pt-3.0.0a1-py2.7.egg/z3c/pt/expressions.py", line 71, in render_content_provider
cp.update()
File "/home/user01/plone/buildout-cache/eggs/zope.viewlet-3.7.2-py2.7.egg/zope/viewlet/manager.py", line 112, in update
self._updateViewlets()
File "/home/user01/plone/buildout-cache/eggs/zope.viewlet-3.7.2-py2.7.egg/zope/viewlet/manager.py", line 118, in _updateViewlets
viewlet.update()
File "/home/user01/plone/buildout-cache/eggs/plone.app.layout-2.5.23-py2.7.egg/plone/app/layout/viewlets/common.py", line 204, in update
self.portal_tabs = portal_tabs_view.topLevelTabs()
File "/home/user01/plone/buildout-cache/eggs/Products.CMFPlone-5.0.8-py2.7.egg/Products/CMFPlone/browser/navigation.py", line 151, in topLevelTabs
if item.exclude_from_nav:
AttributeError: exclude_from_nav

  • Expression: "provider:plone.mainnavigation"

  • Filename: ... egg/Products/CMFPlone/browser/templates/main_template.pt

  • Location: (line 57: col 59)

  • Source: ... er:plone.portaltop" />
    ^

  • Arguments: repeat: {...} (0)
    template: <ImplicitAcquisitionWrapper default_error_message at 0x7f708f0bab90>
    modules: <instance - at 0x7f70ee85b248>
    here: <ImplicitAcquisitionWrapper credentials_cookie_auth at 0x7f708f0ba050>
    user: <ImplicitAcquisitionWrapper - at 0x7f708f0ba410>
    nothing: <NoneType - at 0x937be0>
    container: <ImplicitAcquisitionWrapper PCPK-Plone at 0x7f70dc38e370>
    default: <object - at 0x7f70f67c3590>
    request: <instance - at 0x7f708d9f4dd0>
    wrapped_repeat: <SafeMapping - at 0x7f70cfa5f998>
    traverse_subpath: <list - at 0x7f70d6277cf8>
    loop: {...} (0)
    self.portal_tabs = portal_tabs_view.topLevelTabs()
    File "/home/user01/plone/buildout-cache/eggs/Products.CMFPlone-5.0.8-py2.7.egg/Products/CMFPlone/browser/navigation.py", line 151, in topLevelTabs
    if item.exclude_from_nav:
    AttributeError: exclude_from_nav

  • Expression: "provider:plone.mainnavigation"

  • Filename: ... egg/Products/CMFPlone/browser/templates/main_template.pt

  • Location: (line 57: col 59)

  • Source: ... er:plone.portaltop" />
    ^

  • Arguments: repeat: {...} (0)
    template: <ImplicitAcquisitionWrapper default_error_message at 0x7f708f0bab90>
    modules: <instance - at 0x7f70ee85b248>
    here: <ImplicitAcquisitionWrapper credentials_cookie_auth at 0x7f708f0ba050>
    user: <ImplicitAcquisitionWrapper - at 0x7f708f0ba410>
    nothing: <NoneType - at 0x937be0>
    container: <ImplicitAcquisitionWrapper PCPK-Plone at 0x7f70dc38e370>
    default: <object - at 0x7f70f67c3590>
    request: <instance - at 0x7f708d9f4dd0>
    wrapped_repeat: <SafeMapping - at 0x7f70cfa5f998>
    traverse_subpath: <list - at 0x7f70d6277cf8>
    loop: {...} (0)
    self.portal_tabs = portal_tabs_view.topLevelTabs()
    File "/home/user01/plone/buildout-cache/eggs/Products.CMFPlone-5.0.8-py2.7.egg/Products/CMFPlone/browser/navigation.py", line 151, in topLevelTabs
    if item.exclude_from_nav:
    AttributeError: exclude_from_nav

  • Expression: "provider:plone.mainnavigation"

  • Filename: ... egg/Products/CMFPlone/browser/templates/main_template.pt

  • Location: (line 57: col 59)

  • Source: ... er:plone.portaltop" />
    ^

  • Arguments: repeat: {...} (0)
    template: <ImplicitAcquisitionWrapper default_error_message at 0x7f708f0bab90>
    modules: <instance - at 0x7f70ee85b248>
    here: <ImplicitAcquisitionWrapper credentials_cookie_auth at 0x7f708f0ba050>
    user: <ImplicitAcquisitionWrapper - at 0x7f708f0ba410>
    nothing: <NoneType - at 0x937be0>
    container: <ImplicitAcquisitionWrapper PCPK-Plone at 0x7f70dc38e370>
    default: <object - at 0x7f70f67c3590>
    request: <instance - at 0x7f708d9f4dd0>
    wrapped_repeat: <SafeMapping - at 0x7f70cfa5f998>
    traverse_subpath: <list - at 0x7f70d6277cf8>
    loop: {...} (0)
    self.portal_tabs = portal_tabs_view.topLevelTabs()
    File "/home/user01/plone/buildout-cache/eggs/Products.CMFPlone-5.0.8-py2.7.egg/Products/CMFPlone/browser/navigation.py", line 151, in topLevelTabs
    if item.exclude_from_nav:
    AttributeError: exclude_from_nav

  • Expression: "provider:plone.mainnavigation"

  • Filename: ... egg/Products/CMFPlone/browser/templates/main_template.pt

  • Location: (line 57: col 59)

  • Source: ... er:plone.portaltop" />
    ^

  • Arguments: repeat: {...} (0)
    template: <ImplicitAcquisitionWrapper default_error_message at 0x7f708f0bab90>
    modules: <instance - at 0x7f70ee85b248>
    here: <ImplicitAcquisitionWrapper credentials_cookie_auth at 0x7f708f0ba050>
    user: <ImplicitAcquisitionWrapper - at 0x7f708f0ba410>
    nothing: <NoneType - at 0x937be0>
    container: <ImplicitAcquisitionWrapper PCPK-Plone at 0x7f70dc38e370>
    default: <object - at 0x7f70f67c3590>
    request: <instance - at 0x7f708d9f4dd0>
    wrapped_repeat: <SafeMapping - at 0x7f70cfa5f998>
    traverse_subpath: <list - at 0x7f70d6277cf8>
    loop: {...} (0)
    context: <ImplicitAcquisitionWrapper credentials_cookie_auth at 0x7f70a4d221e0>
    translate: <function translate at 0x7f70a5cc75f0>
    root: <ImplicitAcquisitionWrapper Zope at 0x7f706636df00>
    options: {...} (9)
    target_language: <NoneType - at 0x937be0>

Many thanks in advance. It is quite long because I do not know which are relevant.

@dieter
Here are information on my plone site installation.
Version Overview

Plone 5.0.8 (5018)
CMF 2.2.10
Zope 2.13.26
Python 2.7.9 (default, Mar 1 2015, 12:57:24) [GCC 4.9.2]
PIL 3.4.2 (Pillow)

That is the Plone version, I am using as well. Thus, I can assert that it works in principle. Your problem should have a "local" (not a general) cause.

In my reply to your other post, I will try to help you to find this "local" cause.

I will explain a bit the above extract from the traceback information: it tells you that the exception "AttributeError: exclude_from_nav" was raised in line 151 of Products.CMFPlone.browser.navigation (the traceback contains the file path; I have translated it into a "dotted name"). The code there is if item.exclude_from_nav. This implies, that item surprisingly does not have the attribute exclude_from_nav.

The further analysis will more closely look at the code before line 151, to find out where item comes from: line 150 for item in rawresult. And rawresult comes from line 142 rawresult = catalog.searchResults(query). Thus, the catalog search has led to an unexpected result. In similar situations, you can come up to this point by your own means (once you are familiar with tracebacks).

Now, a bit of advanced (catalog) knowledge is necessary. The hits returned by a catalog are proxy objects (so called "brains") and they have the attributes defined by the so called "catalog metadata". If your Plone works, then this "metadata" can be managed via <url_to_your_plone_portal>/portal_catalog/manage_catalogSchema. Plone comes with a portal_catalog the metadata of which has exclude_from_nav. Thus, something is wrong with the catalog.

In your initial post, you wrote

I assume that this "by creating ZCatalog" is the cause of your current problem. There should have been no need to "create a ZCatalog" and while I do not know why, this creation seems to have confused Plone. I recommend to try anew: delete your current Plone portal, create a new one and try again.

@dieter
Many thanks for your analysis & suggestions. These reminds me that maybe in my experiment I did not properly deal with the catalog metadata. Now I know how to manage it through /portal_catalog/manage_catalogSchema.

Thanks again and have a nice day.