Skip to content
Advertisement

Rocksdb undefined symbol: ZSTD_versionNumber Cpython

[2021-06-18 17:52:53,711: ERROR]: [^Worker]: Error: ImproperlyConfigured('RocksDB bindings not installed? pip install python-rocksdb',) 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/faust/stores/rocksdb.py", line 159, in __init__
    import rocksdb as _rocksdb  # noqa: F401
  File "/usr/local/lib/python3.6/site-packages/rocksdb/__init__.py", line 1, in <module>
    from ._rocksdb import *
ImportError: /usr/local/lib/python3.6/site-packages/rocksdb/_rocksdb.cpython-36m-x86_64-linux-gnu.so: undefined symbol: ZSTD_versionNumber

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/mode/worker.py", line 264, in execute_from_commandline
    self.loop.run_until_complete(self._starting_fut)
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 488, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 719, in start
    await self._default_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 726, in _default_start
    await self._actually_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 750, in _actually_start
    await child.maybe_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 778, in maybe_start
    await self.start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 719, in start
    await self._default_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 726, in _default_start
    await self._actually_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 750, in _actually_start
    await child.maybe_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 778, in maybe_start
    await self.start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 719, in start
    await self._default_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 726, in _default_start
    await self._actually_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 743, in _actually_start
    await self.on_start()
  File "/usr/local/lib/python3.6/site-packages/faust/tables/manager.py", line 130, in on_start
    await self._update_channels()
  File "/usr/local/lib/python3.6/site-packages/faust/tables/manager.py", line 140, in _update_channels
    await table.maybe_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 778, in maybe_start
    await self.start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 719, in start
    await self._default_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 726, in _default_start
    await self._actually_start()
  File "/usr/local/lib/python3.6/site-packages/mode/services.py", line 743, in _actually_start
    await self.on_start()
  File "/usr/local/lib/python3.6/site-packages/faust/tables/base.py", line 195, in on_start
    await self.add_runtime_dependency(self.data)
  File "/usr/local/lib/python3.6/site-packages/faust/tables/base.py", line 190, in data
    self._data = self._new_store()
  File "/usr/local/lib/python3.6/site-packages/faust/tables/base.py", line 171, in _new_store
    return self._new_store_by_url(self._store or self.app.conf.store)
  File "/usr/local/lib/python3.6/site-packages/faust/tables/base.py", line 182, in _new_store_by_url
    options=self.options,
  File "/usr/local/lib/python3.6/site-packages/faust/stores/rocksdb.py", line 161, in __init__
    raise error from exc
faust.exceptions.ImproperlyConfigured: RocksDB bindings not installed? pip install python-rocksdb

I am using python 3.6, and RocksDB is installed in the container by following command:

  9 RUN git clone https://github.com/facebook/rocksdb.git /tmp/roc    ksdb
 10 WORKDIR /tmp/rocksdb
 11 RUN make shared_lib INSTALL_PATH=/usr && make install && rm -rf /tmp/rocksdb
 12 
 13 ENV CGO_CFLAGS  "-I/usr/local/include"
 14 ENV CGO_LDFLAGS "-L/usr/local/lib -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy"
 15 ENV LD_LIBRARY_PATH="/usr/local/lib"

It looks like a version issue for me. Not sure how to resolve it. Tried add rocksdb and python-rocksdb to the requirement file. But not work either. The service was working before. However, the last working docker container was built a year ago. Many error raise when I try to re build this time. Appreciate for any help!

Advertisement

Answer

Don’t use the latest version of anything for automated builds, pin the version to the most recent, tested, working version. It looks like this project uses tags to denote release versions. You’ll need to figure out the date of the last build, go to the repository, find the tag immediately preceding the date of the last working build and check it out before running make.

RUN git clone https://github.com/facebook/rocksdb.git /tmp/rocksdb
WORKDIR /tmp/rocksdb
RUN git checkout tags/<tag_name>
RUN make shared_lib INSTALL_PATH=/usr && make install && rm -rf /tmp/rocksdb

Replace <tag_name> with the name of the appropriate tag. For example, say you want to install version 6.1.1.

RUN git checkout tags/v6.1.1

You may need to try a couple tags from around that time because the last working build actually installed the latest commit on the master branch. Once you have a successful build you can begin the process of testing new versions of rocksdb to find the newest version that works with your app.

Another thing: While you’re at it, pin the version of your docker image. For instance: don’t use debian:latest, use debian:9.13.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement