Home > database >  Cannot seem to query time series containers with the new GridDB Python Client?
Cannot seem to query time series containers with the new GridDB Python Client?

Time:04-23

Querying collection containers works fine, but querying any sort of time series container -- even just a simple select * -- causes a Segmentation Fault.

Here is what my Dockerfile looks like:

FROM centos:7

RUN yum -y groupinstall "Development Tools"
RUN yum -y install epel-release wget
RUN yum -y install pcre2-devel.x86_64
RUN yum -y install openssl-devel libffi-devel bzip2-devel -y
RUN yum -y install xz-devel  perl-core zlib-devel -y
RUN yum -y install numpy scipy

#COPY griddb.repo /etc/yum.repos.d/
#RUN yum -y update
#RUN yum -y install griddb-c-client

# Make c_client
WORKDIR /
RUN wget --no-check-certificate https://github.com/griddb/c_client/archive/refs/tags/v4.6.0.tar.gz
RUN tar -xzvf v4.6.0.tar.gz
WORKDIR /c_client-4.6.0/client/c
RUN  ./bootstrap.sh
RUN ./configure
RUN make
WORKDIR /c_client-4.6.0/bin
RUN ls
ENV LIBRARY_PATH ${LIBRARY_PATH}:/c_client-4.6.0/bin
ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/c_client-4.6.0/bin

# Make SSL for Python3.10
WORKDIR /
RUN wget  --no-check-certificate https://www.openssl.org/source/openssl-1.1.1c.tar.gz
RUN tar -xzvf openssl-1.1.1c.tar.gz
WORKDIR /openssl-1.1.1c
RUN ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic
RUN make
RUN make test
RUN make install

# Build Python3.10
WORKDIR /
RUN wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
RUN tar xvf Python-3.10.4.tgz
WORKDIR /Python-3.10.4
RUN ./configure --enable-optimizations  -C --with-openssl=/usr --with-openssl-rpath=auto --prefix=/usr/local/python-3.version
RUN make altinstall
ENV PATH ${PATH}:/usr/local/python-3.version/bin

RUN python3.10 -m pip install pandas

# Make Swig
WORKDIR /
RUN wget https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz
RUN tar xvfz v4.0.2.tar.gz
WORKDIR /swig-4.0.2
RUN chmod  x autogen.sh
RUN ./autogen.sh
RUN ./configure
RUN make 
RUN make install
WORKDIR /

RUN wget https://github.com/griddb/python_client/archive/refs/tags/0.8.5.tar.gz
RUN tar xvf 0.8.5.tar.gz
WORKDIR /python_client-0.8.5

RUN yum -y install python36 python36-devel
RUN make
ENV PYTHONPATH /python_client-0.8.5

WORKDIR /app

COPY sample2.py /app
COPY time_series_example.py /app
#ENTRYPOINT ["python3.10", "-u", "sample2.py"]

#ENTRYPOINT ["tail"]
#CMD ["-f","/dev/null"]

Here is the output of gdb when running the griddb sample code sample2.py

(gdb) run -u sample2.py 
Starting program: /usr/local/python-3.version/bin/python3.10 -u sample2.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /usr/local/python-3.version/lib/python3.10/site-packages/numpy/core/../../numpy.libs/libgfortran-040039e1.so.5.0.0
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/5b/be74eb6855e0a2c043c0bec2f484bf3e9f14c0.debug
Missing separate debuginfo for /usr/local/python-3.version/lib/python3.10/site-packages/numpy/core/../../numpy.libs/libquadmath-96973f99.so.0.0.0
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/54/9b4c82347785459571c79239872ad31509dcf4.debug
[New Thread 0x7ffff3960700 (LWP 78)]
connected to store
connected to container
Getting store

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff0d3a511 in new_date_ex (year=2022, month=4, day=12, type=<optimized out>) at /Python-3.10.4/Modules/_datetimemodule.c:856
856         self = (PyDateTime_Date *)(type->tp_alloc(type, 0));
Missing separate debuginfos, use: debuginfo-install bzip2-libs-1.0.6-13.el7.x86_64 glibc-2.17-325.el7_9.x86_64 libffi-3.0.13-19.el7.x86_64 libgcc-4.8.5-44.el7.x86_64 libstdc  -4.8.5-44.el7.x86_64 nss-softokn-freebl-3.53.1-6.el7_9.x86_64 xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-19.el7_9.x86_64

If I query the collection containers, no seg fault. Any ideas?

CodePudding user response:

Lookin at the docker file, the issue maybe because both Python 3.6 and Python 3.10 are installed. Python 3.6 is used for building but Python 3.10 is used instead for running the sample, as follows:

  • You install Python 3.10 : build python from source code. Then you install pandas with Python 3.10.
  • You install Python 3.6 : by using yum. You do not install pandas with Python 3.6.
  • You install Python Client : system use python 3.6 to build Python Client
  • You run sample2.py with Python 3.10.
  • Related