Error from: plone.app.layout.globals.portal

Here's what I have:

  1. Plone 5.0.6.

  2. I get this error constantly in my log:

2016-11-11T15:00:38 ERROR Zope.SiteErrorLog 1478876438.090.780612564538
http://www.lwhsboosters.org/robots.txt
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFPlone.browser.robots, line 24, in call
Module plone.memoize.view, line 67, in memogetter
Module plone.app.layout.globals.portal, line 48, in portal_url
AttributeError: 'NoneType' object has no attribute 'absolute_url'

  1. I basically understand what robots.txt does and how to configure in Plone
    (http://docs.plone.org/adapt-and-extend/config/site.html).

  2. Specific to Plone, I found this:
    http://stackoverflow.com/questions/1521265/how-do-i-modify-robots-txt-in-plone
    (look at last answer). Note: I know this is old; however, didn't find anything newer.

  3. I looked here: https://github.com/plone/plone.app.layout/blob/master/plone/app/layout/globals/interfaces.py
    This was the closest I could find (but missing "portal" part of the search). couldn't find anything.

  4. this error does not appear to cause problems. However, is this a bug? If this is a bug, where should I report it?

Thanks.

wayne

this is pretty weird; according to your traceback getSite() is returning None here:

open an issue in the Plone issue tracker and provide all the information you can.

I posted it here: https://github.com/plone/Products.CMFPlone/issues/1887

thanks for the help

This same error is happening on every plone site I have. different versions of Plone (all 5.xx). site runs for some time (weeks??) then shutdown.
Any suggestions.

This is probably due to a misconfigured VHM as maurits was suggesting here:

Are you using a web server to proxy your site?

Thanks for responding. I'm still trying to figure this out.

I working with a plone programmer to work this out. for now, we've installed a cronjob to restart when it stops. takes me out of crisis mode.
1) i am not using a webserver to proxy
2) a have several sites, 3 use the VHM (as I always have) and one that does not. all shutdown for the same error. so, not sure if this is the problem (also, previously with plone 4, I've used VHM for years and never had this issue.
3) the error mentioned "robot.txt" (I understand what this is for) the programmer added this to the site url and got error message (makes sense because robot.txt does not exisit); however, site did not shutdown (as it shouldn't).
4) I've been hosting with this company (webfaction.com) for years and have created many plone sites without this problem.
5) a bug report has been filed by @mauritsvanrees here: https://github.com/plone/Products.CMFPlone/issues/2052

However, reading the bug report, this isn't why the site is shutting down it just gives spurious error.

I'm confused. :slight_smile: Makes no sense because I haven't heard of others having this issue.

If I get this solved, I'll post back.

If anyone else has suggestions I'd love to hear them.

As you correctly assume, Zope/Plone should not shutdown for an error like the above (the only thing that should happen is that the "robots.txt" request fails). In addition, Zope/Plone is usually started in so called "daemon" mode - then, in general, Zope/Plone is usually restarted automatically (by the supervising daemon) when it is shut down. Zope/Plone can tell the supervising daemon that it wants to stop (and does not want to get restarted); but, usually, it does this only when it got a signal ("SIGTERM" or "SIGINT") or the "shutdown" ZMI action has been activated.

What you can check: is your Zope/Plone running in "daemon mode" (this opposite is "foreground mode"), i.e. is it started with "{instance|client1} start" rather than "{instance|client1} fg". If running in daemon mode, Zope/Plone should get automatically restarted when it died unless the Zope/Plone process has called exit(0) or exit(2) (to indicate that it want to stop). Some part of your Zope/Plone application (likely a third party part) may inadvertantly call such an exit. Once, I had a case like this, and approached it by attaching a C level debugger (gdb) with the Zope/Plone process and setting a breakpoint on the C level function _exit (this finally is called when a higher level exit is executed). This has allowed to find out which code was calling exit inappropriatedly.

i search both logs (instance and instance Z2) and did not find "exit".

However, I did find this in many places in the log.

2017-05-08T17:50:27 INFO Zope Ready to handle requests
------
2017-05-08T17:52:17 INFO SignalHandler Caught signal SIGTERM
------
2017-05-08T17:52:17 INFO Z2 Shutting down fast
------
2017-05-08T17:52:17 INFO ZServer closing HTTP to new connections

2017-05-08T17:52:24 INFO ZServer HTTP server started at Mon May 8 17:52:24 2017
Hostname: 0.0.0.0
Port: 25578

does this add any information? or is this unrelated?
Is this what you mean about the daemeon process restarting the server?

I noticed this happens repeatedly. Is this normal.

thanks for your help

This is telling you that your Zope/Plone got a SIGTERM signal, requesting it to shut down.

It is not likely (though possible) that the Zope/Plone application itself has sent the signal. It is more likely that something external did it (the supervising daemon can e.g. do this, when someone issues {instance|client<} stop}).

Try running with bin/instance fg or bin/client1 fg

thanks.

I have an experienced programmer looking at this and I'll pass along everything