Cannot get Relstorage 2 with Plone 5 to work, ImportError: cannot import name ResolvedSerial

Hello everybody, I'm new here, and i'm new with Plone and especially in RelStorage.
i'm working on an ubuntu server 16.04 lts vm
I installed Plone 5.0.7. as standalone with the unified installer and with the instructions from the website:

Tested it and worked fine. I tried to configure Relstorage like in the docs http://relstorage.readthedocs.io

installed mysql and created database like in the docs, too.:

CREATE USER 'zodbuser'@'localhost' IDENTIFIED BY 'mypassword';
CREATE DATABASE zodb;
GRANT ALL ON zodb.* TO 'zodbuser'@'localhost';
FLUSH PRIVILEGES;

i installed RelStorage with mysql adapter in the Plone environment:

bin/pip install 'RelStorage[mysql]'

converting zodb to mysql with zodbconvert and following xml:

<filestorage source>
  path ~/Plone/zinstance/var/filestorage/Data.fs
  blob-dir ~/Plone/zinstance/var/blobstorage
</filestorage>

<relstorage destination>
  # shared-blob-dir false
  # ZODB Cache Dir
  blob-dir ./var/blobstorage
  blob-cache-size 32mb
  <mysql>
    host localhost
    db zodb
    user zodbuser
    passwd mypassword
  </mysql>
</relstorage>

It only worked for me when shared-blob-dir is true (commented), because of bushy layout.

in the buildout.cfg I added RelStorage and mysql-python in eggs an added in instance:

rel-storage =
    type mysql
    db zodb
    user zodbuser
    passwd mypassword
    shared-blob-dir false
    blob-dir /Plone/zinstance/var/blobstorage
    blob-cache-size 32mb

had to install libffi-dev libmysqlclient-dev to run buildout.

so i got: Error:

The requirement ('transaction>=2.0.3') is not allowed by your [versions] constraint (1.1.1)

while buildout so i changed version in Plone/zinstance/zopetoolkit-1-0-8-ztk-versions.cfg to recent 2.1.2.
After that buildout passed through.

now when i try to start plone in foreground i got this Error:

instance: Traceback (most recent call last):
  File "/home/achim/Plone/zinstance/parts/instance/bin/interpreter", line 281, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/run.py", line 76, in <module> run()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/run.py", line 17, in run
    import Zope2.Startup
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/__init__.py", line 60, in <module>
    from Zope2.Startup.run import configure
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/__init__.py", line 27, in <module>
    from zope.event import notify
ImportError: No module named event

tried to solve with

bin/pip install zope.event 

and next error appeared:

instance: Traceback (most recent call last):

  File "/home/achim/Plone/zinstance/parts/instance/bin/interpreter", line 281, in <module>
exec(compile(__file__f.read(), __file__, "exec")) 
File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
run()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/run.py", line 17, in run
import Zope2.Startup
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/__init__.py", line 60, in <module>
from Zope2.Startup.run import configure
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/__init__.py", line 28, in <module>
from zope.processlifetime import ProcessStarting
ImportError: No module named processlifetime

again:

bin/pip install zope.processlifetime

next:

2017-06-29 13:51:47 ERROR Application Could not import Products.TemporaryFolder
Traceback (most recent call last):
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Application.py", line 606, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/TemporaryFolder/__init__.py", line 21, in <module>
from TemporaryFolder import SimpleTemporaryContainer as TemporaryContainer
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/TemporaryFolder/TemporaryFolder.py", line 29, in <module>
from tempstorage.TemporaryStorage import TemporaryStorage
  File "/home/achim/Plone/buildout-cache/eggs/tempstorage-2.12.2-py2.7.egg/tempstorage/TemporaryStorage.py", line 28, in <module>
from ZODB.ConflictResolution import ResolvedSerial
ImportError: cannot import name ResolvedSerial
Traceback (most recent call last):
  File "/home/achim/Plone/zinstance/parts/instance/bin/interpreter", line 281, in <module>
exec(compile(__file__f.read(), __file__, "exec"))
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
run()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/run.py", line 22, in run
starter.prepare()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/__init__.py", line 92, in prepare
self.startZope()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/Startup/__init__.py", line 268, in startZope
Zope2.startup()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/__init__.py", line 47, in startup
_startup()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Zope2/App/startup.py", line 69, in startup
OFS.Application.import_products()
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Application.py", line 583, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/OFS/Application.py", line 606, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/TemporaryFolder/__init__.py", line 21, in <module>
from TemporaryFolder import SimpleTemporaryContainer as TemporaryContainer
  File "/home/achim/Plone/buildout-cache/eggs/Zope2-2.13.26-py2.7.egg/Products/TemporaryFolder/TemporaryFolder.py", line 29, in <module>
from tempstorage.TemporaryStorage import TemporaryStorage
  File "/home/achim/Plone/buildout-cache/eggs/tempstorage-2.12.2-py2.7.egg/tempstorage/TemporaryStorage.py", line 28, in <module>
from ZODB.ConflictResolution import ResolvedSerial
ImportError: cannot import name ResolvedSerial

just got to this point.

Thinking about that some versions are conflicting or that the eggs or application don't get the right zope and zodb libs they need, but unfortunately don't know what to do.

so.... i just want to make plone work with relstorage mysql without filestorage and blobstorage.
i read a lot about but a lot about older versions and didn't get it run with recent plone 5 and relstorage 2.

As i say, I'm new to this and hope i can get help by getting plone 5 running with purely mysql. Will make a detailed tutorial about it if it is done to help others, too.
I hope i could give detailed information about what i exactly done.

thanks for your help, tried a lot....

best regards,
sivla

I think you are dealing with somewhere north of 20+ version pins needing changed to approximate where Plone 5.1 (unreleased in buildout.coredev master) is with ZODB5 and (therefore) RelStorage 2.x support.

Can you elaborate why you need RelStorage 2.x (and what RDBMS you are using, why you are using RelStorage instead of ZEO)?

Sean

Thank you for your answer.
As I said I'm new to this, and i simple-minded thought, that recent Plone could be compatible with the recent RelStorage, i try it with the older one (1.6.4) and will post my progress.

I'm actual using mysql 14.14 now but will change to MariaDB. I try it first as standalone and then with cluster and see how it works. Using MariaDB because i try to expand it with Galera cluster etc. but that's another topic....

I was just fighting this same thing, but my buildout wanted transaction 1.5,
I have a fix and a theory:

Fix:
Back away from the upgrade of zopetoolkit - you're moving forward and running an untested Plone build.
Instead, downgrade relstorage:

add to your buildout [versions] section (or add one)

[versions]
relstorage = 1.5.1

Theory:
The Plone5 unified buildout doesn't pin relstorage - because the "average user" doesn't use relstorage
if you're not version pinned, buildout gets the latest version (2.0.0)
The latest version relies on lots of other "latest version" stuff which relies on a "later verson" of transaction.

Plone5 DOES pin transaction to version 1.1.1 - but something else needs transaction at a higher version.

For me, it was:
Relstorage 2.0.0 <-- 'ZODB<5.0,>=4.4.2' <---- transaction>=1.5.0

Using ./bin/buildout -vvv helped me track that down.

HTH

2 Likes