timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.96k stars 883 forks source link

missing symbols from source build #1098

Closed esatterwhite closed 5 years ago

esatterwhite commented 5 years ago

Relevant system information:

Describe the bug following the install instructions. It seems to start fine, but when starting the container + postgres, I get

could not load library "/usr/lib/postgresql/11/lib/timescaledb.so": /usr/lib/postgresql/11/lib/timescaledb.so: undefined symbol: getmissingattr

It seemed to install fine

[100%] Built target timescaledb-tsl                                                
Install the project...                                                                                                                              
-- Install configuration: "Release"                                                           
-- Installing: /usr/share/postgresql/11/extension/timescaledb.control               
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.2.1.sql                                                                         
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.2.0--1.2.1.sql                 
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.1.1--1.2.1.sql         
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.1.0--1.2.1.sql                
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.0.1--1.2.1.sql                       
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.0.0--1.2.1.sql                                                                                                                                                                       
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.0.0-rc3--1.2.1.sql          
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.0.0-rc2--1.2.1.sql           
-- Installing: /usr/share/postgresql/11/extension/timescaledb--1.0.0-rc1--1.2.1.sql                                                                                                                                                                                  
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.12.1--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.12.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.11.0--1.2.1.sql 
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.10.1--1.2.1.sql   
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.10.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.9.2--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.9.1--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.9.0--1.2.1.sql  
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.8.0--1.2.1.sql     
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.7.1--1.2.1.sql      
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.7.0--1.2.1.sql          
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.6.1--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.6.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.5.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.4.2--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.4.1--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.4.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.3.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.2.0--1.2.1.sql
-- Installing: /usr/share/postgresql/11/extension/timescaledb--0.1.0--1.2.1.sql
-- Installing: /usr/lib/postgresql/11/lib/timescaledb-1.2.1.so
-- Installing: /usr/lib/postgresql/11/lib/timescaledb.so
-- Installing: /usr/lib/postgresql/11/lib/timescaledb-tsl-1.2.1.so

To Reproduce I'm using the postgres:11 container and pretty much just cloning the project and building the 1.2.1 tag

svenklemm commented 5 years ago

Hmm getmissingattr is a static postgres function, did you modify the source code cause i dont see any references to it in our code

esatterwhite commented 5 years ago

No, nothing like that

FROM postgres:11
ENV POSTGRES_VERSION=11
ENV TIMESCALEDB_VERSION 1.2.1

RUN set -ex \
  apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 \
  && apt-get update \
  && apt-get -y install postgresql-common \
                ca-certificates \
                build-essential libpq-dev locales wget unzip tree libkrb5-dev git \
                openssl \
                libssl-dev \
                curl \
                python3 \
                python3-pip \
                tar \
                make \
                cmake \
                postgresql-server-dev-${POSTGRES_VERSION} \
    && mkdir -p /build/timescaledb \
    && wget -O /timescaledb.tar.gz https://github.com/timescale/timescaledb/archive/$TIMESCALEDB_VERSION.tar.gz \
    && tar -C /build/timescaledb --strip-components 1 -zxf /timescaledb.tar.gz \
    && rm -f /timescaledb.tar.gz \
    && cd /build/timescaledb \
    && ./bootstrap \
    && cd build && make install \
    && cd ~ \
    && rm -rf /build \
    && rm -rf /var/lib/apt/lists/* \
    && sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,pg_stat_statements\2'/;s/,'/'/" /usr/share/postgresql/postgresql.conf.sample \
    && echo "wal_level = logical" >> /usr/share/postgresql/postgresql.conf.sample \
    && echo "max_replication_slots = 10" >> /usr/share/postgresql/postgresql.conf.sample \
    && echo "timescaledb.telemetry_level = off" >> /usr/share/postgresql/postgresql.conf.sample \
    && echo "max_worker_processes = 96" >> /usr/share/postgresql/postgresql.conf.sample

RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
esatterwhite commented 5 years ago

do you need more information than this? what would you need?

svenklemm commented 5 years ago

@esatterwhite Hmm i used your Dockerfile to build an image and I could install timescaledb in a database inside the container

root@2b85fdb124af:/# psql -U postgres
psql (11.2 (Debian 11.2-1.pgdg90+1))
Type "help" for help.

postgres=# create extension timescaledb;
WARNING:
WELCOME TO
 _____ _                               _     ____________
|_   _(_)                             | |    |  _  \ ___ \
  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ /
  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \
  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ /
  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/
               Running version 1.2.1
For more information on TimescaleDB, please visit the following links:

 1. Getting started: https://docs.timescale.com/getting-started
 2. API reference documentation: https://docs.timescale.com/api
 3. How TimescaleDB is designed: https://docs.timescale.com/introduction/architecture

Note: TimescaleDB collects anonymous reports to better understand and assist our users.
For more information and how to disable, please see our docs https://docs.timescaledb.com/using-timescaledb/telemetry.

CREATE EXTENSION
esatterwhite commented 5 years ago

ah. I must have had some bad cached layers from previous builds. Cleared things out and it seems fine.

User Error. Sorry to waste your time on this one.

enggarranu commented 4 years ago

hi @esatterwhite , how the steps to clear cached from previous builds? because i had problem when install wal2json plugin

pg_recvlogical: could not send replication command "CREATE_REPLICATION_SLOT "striim_slot" LOGICAL "wal2json" NOEXPORT_SNAPSHOT": ERROR:  could not load library "/usr/lib/postgresql/11/lib/wal2json.so": /usr/lib/postgresql/11/lib/wal2json.so: undefined symbol: getmissingattr
esatterwhite commented 4 years ago
$ docker rmi $(docker images -f dangling=true -q)
$ docker build --no-cache ...