Error starting Plone (Ansible playbook with Plone 5.2 and Python 3)

Anyone seen this using the playbook at https://github.com/plone/ansible-playbook/ which uses https://github.com/plone/ansible.plone_server?

I set these in my local-configure.yml:

plone_python_version: "3"
plone_client_tcpcheck: off

$ sudo -u plone_daemon bin/client1
Program: /usr/local/plone-5.2/zeoserver/bin/python3 /usr/local/plone-5.2/zeoserver/parts/client1/bin/interpreter /usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/serve.py /usr/local/plone-5.2/zeoserver/parts/client1/etc/wsgi.ini
daemon manager not running
client1> fg
/usr/local/plone-5.2/zeoserver/lib/python3.6/site.py:165: DeprecationWarning: 'U' mode is deprecated
  f = open(fullname, "rU")
/usr/local/plone-5.2/buildout-cache/eggs/Products.CMFUid-3.0.1-py3.6.egg/Products/CMFUid/UniqueIdHandlerTool.py:24: DeprecationWarning: InitializeClass is deprecated. Please import from AccessControl.class_init.
  from App.class_init import InitializeClass
/usr/local/plone-5.2/buildout-cache/eggs/Products.CMFEditions-3.3.2-py3.6.egg/Products/CMFEditions/StandardModifiers.py:46: DeprecationWarning: ComponentLookupError is deprecated. Import from zope.interface.interfaces
  from zope.component.interfaces import ComponentLookupError
/usr/local/plone-5.2/buildout-cache/eggs/Products.CMFFormController-4.1.0-py3.6.egg/Products/CMFFormController/ControllerPythonScript.py:41: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
2020-01-01 00:19:16,872 WARNING [Init:89][MainThread] Class Products.CMFFormController.ControllerPythonScript.ControllerPythonScript has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
2020-01-01 00:19:16,878 WARNING [Init:89][MainThread] Class Products.CMFFormController.ControllerValidator.ControllerValidator has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
/usr/local/plone-5.2/buildout-cache/eggs/Products.CMFPlacefulWorkflow-2.0.0-py3.6.egg/Products/CMFPlacefulWorkflow/permissions.py:5: DeprecationWarning: setDefaultRoles is deprecated. Please use addPermission from AccessControl.Permission.
  from Products.CMFCore.permissions import setDefaultRoles
2020-01-01 00:19:17,976 INFO    [ZEO.ClientStorage:209][MainThread] zeostorage ClientStorage (pid=8179) created RW/normal for storage: '1'
2020-01-01 00:19:17,979 INFO    [ZEO.cache:208][MainThread] created temporary cache file 7
2020-01-01 00:19:17,983 INFO    [ZODB.blob:355][MainThread] (8179) Blob directory `/var/local/plone-5.2/zeoserver/blobstorage` is unused and has no layout marker set. Selected `bushy` layout.
2020-01-01 00:19:17,985 INFO    [ZEO.asyncio.base:51][zeostorage zeo client networking thread] Connected Protocol(('127.0.0.1', 8100), '1', False)
2020-01-01 00:19:17,996 INFO    [ZEO.ClientStorage:366][zeostorage zeo client networking thread] zeostorage Connected to storage: ('bledplone52', 8100)
Traceback (most recent call last):
  File "/usr/local/plone-5.2/zeoserver/parts/client1/bin/interpreter", line 272, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/serve.py", line 252, in <module>
    sys.exit(main() or 0)
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/serve.py", line 248, in main
    return command.run()
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/serve.py", line 189, in run
    global_conf=vars)
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/serve.py", line 217, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/loadwsgi.py", line 253, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/loadwsgi.py", line 278, in loadobj
    return context.create()
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/loadwsgi.py", line 209, in invoke
    app = context.app_context.create()
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/loadwsgi.py", line 152, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/local/plone-5.2/buildout-cache/eggs/PasteDeploy-2.0.1-py3.6.egg/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/run.py", line 71, in make_wsgi_app
    starter.prepare()
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/starter.py", line 41, in prepare
    self.startZope()
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/starter.py", line 98, in startZope
    Zope2.startup_wsgi()
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/__init__.py", line 50, in startup_wsgi
    _startup()
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/App/startup.py", line 117, in startup
    DB = dbtab.getDatabase('/', is_root=1)
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/datatypes.py", line 266, in getDatabase
    db = factory.open(name, self.databases)
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/datatypes.py", line 159, in open
    DB = self.createDB(database_name, databases)
  File "/usr/local/plone-5.2/buildout-cache/eggs/Zope-4.1.1-py3.6.egg/Zope2/Startup/datatypes.py", line 156, in createDB
    return ZODBDatabase.open(self, databases)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZODB-5.5.1-py3.6.egg/ZODB/config.py", line 157, in open
    **options)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZODB-5.5.1-py3.6.egg/ZODB/DB.py", line 488, in __init__
    conn.get(z64)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZODB-5.5.1-py3.6.egg/ZODB/Connection.py", line 247, in get
    p, _ = self._storage.load(oid)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZODB-5.5.1-py3.6.egg/ZODB/mvccadapter.py", line 143, in load
    r = self._storage.loadBefore(oid, self._start)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZEO-5.2.1-py3.6.egg/ZEO/ClientStorage.py", line 524, in loadBefore
    return self._server.load_before(oid, tid)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZEO-5.2.1-py3.6.egg/ZEO/asyncio/client.py", line 783, in load_before
    return self.__call(self.client.load_before_threadsafe, oid, tid)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZEO-5.2.1-py3.6.egg/ZEO/asyncio/client.py", line 743, in call
    return self.wait_for_result(result, timeout)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZEO-5.2.1-py3.6.egg/ZEO/asyncio/client.py", line 756, in wait_for_result
    return future.result(timeout)
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZEO-5.2.1-py3.6.egg/ZEO/asyncio/client.py", line 606, in load_before_threadsafe
    data = yield self.protocol.load_before(oid, tid)
  File "/usr/local/plone-5.2/buildout-cache/eggs/ZEO-5.2.1-py3.6.egg/ZEO/asyncio/client.py", line 41, in _
    result = future.result()
ZEO.Exceptions.ServerException: ('builtins.FileNotFoundError', (2, 'No such file or directory'))
sys:1: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=2049, proto=0, laddr=('127.0.0.1', 8081)>

I made my own system for development and deployment by slowly modifying https://github.com/plone/plonedev.vagrant and adding buildout parts from https://github.com/starzel/buildout. It works with Plone 5.2 and Python 3.

1 Like

Would you be able to share your enhancements, and/or make a pull request to enhance the playbook?

There's so many details that it might be easier to just fix the Ansible playbooks... My system is using bash scripts and ssh, not Ansible.

1 Like

Note that there has not been a release of ansible.plone_server with the recent Python 3 compatible work on master.

To get master, try in your project's ansible-playbook/requirements.yml:

- src: https://github.com/plone/ansible.plone_server.git
#  version: 1.3.7
  name: plone.plone_server