GithubHelp home page GithubHelp logo

symbol not found about alpine-pkg-glibc HOT 10 CLOSED

sgerrand avatar sgerrand commented on June 11, 2024
symbol not found

from alpine-pkg-glibc.

Comments (10)

xdmitry avatar xdmitry commented on June 11, 2024 1

@sgerrand looks like there is an issue with oracle instant clinent + glibc on alpine, that npm example you've pasted above compiles oracledb package but it is not possible to use it, and you'll 'get symbol not found' if you try to run select.js from examples mentioned at https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#-3-node-oracledb-installation-on-linux-with-instant-client-zip-files

I am personally trying to build docker image with php and oracle instant client, and also have 'Error relocating /opt/oracle/instantclient/libclntsh.so.12.1: canonicalize_file_name: symbol not found' error message when trying to run php inside container, while everything compiles smoothly

below is how to reproduce that issue, assuming you have instantclient-basic-linux.x64-12.1.0.2.0.zip instantclient-sdk-linux.x64-12.1.0.2.0.zip in oracle folder


docker rm -f test-apk; docker build -f Dockerfile-apk -t test-apk . && docker run -d --name test-apk test-apk && docker exec -it test-apk php -i |grep oci8

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/oci8.so' - Error relocating /opt/oracle/instantclient/libclntsh.so.12.1: canonicalize_file_name: symbol not found in Unknown on line 0

cat Dockerfile-apk 
FROM php:7.1-fpm-alpine
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
RUN apk update && apk add libaio unzip ca-certificates openssl
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk && apk add glibc-2.23-r3.apk
ADD oracle/* /opt/oracle/
RUN cd /opt/oracle && unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip && unzip instantclient-basic-linux.x64-12.1.0.2.0.zip && mv instantclient_12_1 instantclient && cd instantclient && ln -s libclntsh.so.12.1 libclntsh.so
ENV LD_LIBRARY_PATH=/opt/oracle/instantclient:/usr/glibc-compat/lib:$LD_LIBRARY_PATH
RUN docker-php-ext-configure oci8 --with-oci8=instantclient,/opt/oracle/instantclient
RUN docker-php-ext-install oci8

Same works fine with ubuntu based docker image:

docker rm -f test-deb; docker build -f Dockerfile-deb -t test-deb . && docker run -d --name test-deb test-deb && docker exec -it test-deb php -i |grep oci8

oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20

cat Dockerfile-deb 
FROM php:7.1-fpm
RUN apt-get update && apt-get install libaio1 unzip
ADD oracle/* /opt/oracle/
RUN cd /opt/oracle && unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip && unzip instantclient-basic-linux.x64-12.1.0.2.0.zip && mv instantclient_12_1 instantclient && cd instantclient && ln -s libclntsh.so.12.1 libclntsh.so
ENV LD_LIBRARY_PATH=/opt/oracle/instantclient:/usr/glibc-compat/lib:$LD_LIBRARY_PATH
RUN docker-php-ext-configure oci8 --with-oci8=instantclient,/opt/oracle/instantclient
RUN docker-php-ext-install oci8

from alpine-pkg-glibc.

sgerrand avatar sgerrand commented on June 11, 2024

@nixgadget: It would be helpful to know more about the context of this issue you've encountered.

If you can answer these questions, it'd help in tracking down the cause of these issues:

  • What version of node-oracledb are you trying to install?
  • What version of Alpine Linux are you using?
  • How are you running Alpine Linux (e.g. in Docker)?
  • Do you have a repository or gist which demonstrates this issue in a repeatable way?

from alpine-pkg-glibc.

day0ops avatar day0ops commented on June 11, 2024

@sgerrand sorry for getting back to you late.

  • Im running version 1.9.3 of node-oracledb.
  • Running 3.4 Alpine Linux
  • So initially I pulled docker-alpine-glibc, extracted and installedNode v6 and also installed node-oracledb artifacts. There is no problem running npm i but what fails is when running the application. It throws the given exception which seems to suggest that it cannot discover the glibc symbols.
  • I'll see if I can spike this and create a repository for you to investigate.

On another note I see people others having similar issues else where. For instance #13

from alpine-pkg-glibc.

kubo avatar kubo commented on June 11, 2024

I made a minimum code to reproduce this issue if @nixgadget uses node-js compiled for musl libc and node-oracledb compiled for glibc.

My environment is:

  • Ubuntu 16.04 (used to compile binaries depending on glibc)
  • Alpine Linux v3.4 in lxc container on Ubuntu 16.04

Compile the following code on Ubuntu.

/* libtestgetcontext.c */
#include <ucontext.h>
int test_getcontext()
{
  ucontext_t ucp;
  return getcontext(&ucp);
}
$ cc -shared -fPIC -o libtestgetcontext.so libtestgetcontext.c # on Ubuntu

Copy libtestgetcontext.so to Alpine.

Compile the following code on Alpine

/* load_libtestgetcontext.c */
#include <stdio.h>
#include <dlfcn.h>
int main()
{
    void *handle = dlopen("./libtestgetcontext.so", RTLD_LAZY);
    int (*func)(void);
    if (handle == NULL) {
        printf("dlopen error: %s\n", dlerror());
        return 1;
    }
    func = (int(*)(void))dlsym(handle, "test_getcontext");
    if (func == NULL) {
        printf("dlsym error: %s\n", dlerror());
        return 1;
    }
    printf("test_getcontext() returns %d\n", func());
    return 0;
}
$ cc -o load_libtestgetcontext load_libtestgetcontext.c # on Alpine

load_libtestgetcontext tries to load libtestgetcontext.so in the current directory and call test_getcontext() in the library. It fails on Alpine as follows:

$ ./load_libtestgetcontext # on Alpine
dlopen error: Error relocating ./libtestgetcontext.so: getcontext: symbol not found

The error message is same with the error in the first comment.

If load_libtestgetcontext is compiled on Ubuntu, it works fine on Alpine.

$ cc -o load_libtestgetcontext_glibc load_libtestgetcontext.c -ldl # on Ubuntu

Copy load_libtestgetcontext_glibc to Alpine

$ ./load_libtestgetcontext_glibc # on Alpine
test_getcontext() returns 0

I guess that if node-js is compiled for glibc, it can load node-oracledb without error.

from alpine-pkg-glibc.

day0ops avatar day0ops commented on June 11, 2024

@kubo Thats brilliant. When you meant node-js compiled for glibc .. im guessing you meant both node-js and node-oracledb compiled for glibc ? I could give that ago and see.

from alpine-pkg-glibc.

sgerrand avatar sgerrand commented on June 11, 2024

@nixgadget: I think the main cause of your problem is the self compiled version of nodejs. I strongly suggest you do not do this and use the Alpine Linux nodejs package instead. You don't need glibc installed to compile the node-oracledb npm package. I've been able to compile this npm package without issue using Alpine Linux 3.4, both with and without glibc installed.

You need to add the g++, libaio, make, nodejs and python packages (apk add g++ libaio make nodejs python) first and otherwise follow the installation steps for "Instant Client ZIP files"

npm install oracledb

> [email protected] install /opt/oracle/node_modules/oracledb
> node-gyp rebuild

make: Entering directory '/opt/oracle/node_modules/oracledb/build'
  CXX(target) Release/obj.target/oracledb/src/njs/src/njsOracle.o
  CXX(target) Release/obj.target/oracledb/src/njs/src/njsPool.o
  CXX(target) Release/obj.target/oracledb/src/njs/src/njsConnection.o
  CXX(target) Release/obj.target/oracledb/src/njs/src/njsResultSet.o
  CXX(target) Release/obj.target/oracledb/src/njs/src/njsMessages.o
  CXX(target) Release/obj.target/oracledb/src/njs/src/njsIntLob.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnv.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnvImpl.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiException.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiExceptionImpl.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiConnImpl.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiDateTimeArrayImpl.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiPoolImpl.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiStmtImpl.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiUtils.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiLob.o
  CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiCommon.o
  SOLINK_MODULE(target) Release/obj.target/oracledb.node
  COPY Release/oracledb.node
make: Leaving directory '/opt/oracle/node_modules/oracledb/build'
/opt/oracle
`-- [email protected] 
  `-- [email protected] 

npm WARN enoent ENOENT: no such file or directory, open '/opt/oracle/package.json'
npm WARN oracle No description
npm WARN oracle No repository field.
npm WARN oracle No README data
npm WARN oracle No license field.

from alpine-pkg-glibc.

sgerrand avatar sgerrand commented on June 11, 2024

@nixgadget: I've closed this issue because I don't believe it relates to the package per se, rather the way you're using glibc. Please feel free to add a comment if you believe this is not the case.

from alpine-pkg-glibc.

kubo avatar kubo commented on June 11, 2024

@nixgadget: Yes, I meant both node-js and node-oracledb.

@sgerrand: I bet that the Alpine Linux nodejs package cannot use node-oracledb because Oracle instant client uses glibc. However I agree to your last comment.

from alpine-pkg-glibc.

bmulcahy avatar bmulcahy commented on June 11, 2024

getting the same error builds fine but can' t find symbols. Also have this issue when trying to build gdal with oci

from alpine-pkg-glibc.

saneax avatar saneax commented on June 11, 2024

Me using youtube-dl - and getting this error -
docker run -it --rm -v "$(pwd)/videos:/src" jbergknoff/youtube-dl -x -c --audio-format wav --audio-quality 0 -o '/src/%(uploader)s/%(title)s-%(id)s.%(ext)s' -a /src/videos.list
[youtube] aNS6U5a0dzQ: Downloading webpage
[youtube] aNS6U5a0dzQ: Downloading video info webpage
[download] Destination: /src/Vinod Bihari Das/10 अगस्त 2018 कष्ट स्वीकार किये बिना भक्ति संभव नही श्री श्री बाबा द्वारा-aNS6U5a0dzQ.m4a
[download] 100% of 17.67MiB in 00:03
[ffmpeg] Correcting container in "/src/Vinod Bihari Das/10 अगस्त 2018 कष्ट स्वीकार किये बिना भक्ति संभव नही श्री श्री बाबा द्वारा-aNS6U5a0dzQ.m4a"
ERROR: Error relocating /lib/libuuid.so.1: getrandom: symbol not found

not sure if the above issue is same as I am seeing. But when searching for 'Error relocating /lib/libuuid.so.1' I get this as the first result.

from alpine-pkg-glibc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.