Attribute error when check robots.txt

Hey guys, sometimes I get this traceback, any glue about it?

2018-08-07 10:34:42 ERROR Zope.SiteErrorLog 1533648882.980.619638373703 http://localhost:8081/robots.txt
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.CMFPlone.browser.robots, line 24, in __call__
  Module plone.memoize.view, line 68, in memogetter
  Module plone.app.layout.globals.portal, line 47, in portal_url
AttributeError: 'NoneType' object has no attribute 'absolute_url'

I'm using this builldout pinned to Plone 5 when the traceback is shown: https://github.com/collective/collective.cover

The code cannot find the Plone site. I'm guessing it is called on the Zope root, which doesn't work,

Yup I get this error too, nothing to stress about though. I actually made a post about this some months back, I can see if I can dig it up.

Anyway, easiest way to resolve this is in the ZMI to add a File with the title robots.txt. The Plone site itself overrides this, so you can just place a dummy file and the error will go away...

Why this just happen in Plone 5?

because this is a new browser view that was added into Plone 5 and it's registered erroneously in the ZCML:

hold on and I'll fix it.

1 Like

done!

2 Likes