似乎无法使用新的 GridDB Python 客户端查询时间序列容器?

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

查询集合容器工作正常,但查询任何类型的时间序列容器——即使只是一个简单的 select *——都会导致分段错误。

这是我的 Dockerfile 的样子:

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"]

这里是 gdb 在 运行 griddb 示例代码 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

如果我查询收集容器,没有段错误。有什么想法吗?

查看docker文件,问题可能是因为同时安装了Python 3.6和Python 3.10。 Python 3.6 用于构建,但 Python 3.10 用于 运行 示例,如下所示:

  • 您安装 Python 3.10:从源代码构建 python。然后你安装 pandas 和 Python 3.10.
  • 您安装 Python 3.6:使用 yum。你没有安装 pandas 和 Python 3.6.
  • 您安装Python客户端:系统使用python3.6构建Python客户端
  • 你 运行 sample2.py 与 Python 3.10.