Comments (13)
This actually works totally fine with the official Postgres Alpine image. Here's a Dockerfile that uses the official image to build/install wal2json:
FROM postgres:10.5-alpine AS builder
RUN apk add --no-cache build-base git
RUN git clone https://github.com/eulerto/wal2json.git
WORKDIR wal2json
RUN USE_PGXS=1 make && make install
FROM postgres:10.5-alpine
COPY --from=builder /wal2json/wal2json.so /usr/local/lib/postgresql/
Works with https://github.com/disneystreaming/pg2k4j (which relies on this plugin).
from wal2json.
What are the steps to compile wal2json?
ERROR: could not load library "/usr/local/lib/postgresql/wal2json.so": Error relocating /usr/local/lib/postgresql/wal2json.so: __snprintf_chk: symbol not found
It seems something wrong with your OS, no?
Are there any compiled builds with static linking?
Extensions are not linked statically to Postgres.
from wal2json.
What are the steps to compile wal2json?
sudo apt install libpq-dev
sudo apt install postgresql-common
sudo apt install postgresql-server-dev-all
git clone https://github.com/eulerto/wal2json.git
cd wal2json
PATH=`which pg_config`:$PATH
USE_PGXS=1 make
#USE_PGXS=1 make install
chmod a+rx wal2json.so
sudo cp wal2json.so /usr/local/lib/postgresql
It seems something wrong with your OS, no?
Doesn't seem so, all other thing works fine. It's a standard Ubuntu 18.04.
Update: It's a Docker image postgres:9.5-alpine
with musl
instead of glibc
.
Extensions are not linked statically to Postgres.
I meant to compile the .so
statically with it's dependencies.
from wal2json.
I think the issue is I am actually running PostgreSQL in Alpine Linux based Docker container, and the issue is that you depend on glibc
but Alpine has musl
. I've changed the title and the description.
I have found a probable solution - glibc
package for Alpine Linux.
from wal2json.
I'm not sure PostgreSQL works with musl
(I've never tried). I found other reports from this same error message.
from wal2json.
PostgreSQL works fine on Alpine, there is an official Docker image:
https://hub.docker.com/r/library/postgres/tags/
I have tried to install the alpine-pkg-glibc
in the container but no success yet.
Is there any chance __snprintf_chk
could be replaced? (Sorry if being too obnoxious)
Personally, it's not a blocker for me because I am heading to RDS, but I like to develop against Docker containers. Others will run to the same issue with wal2json
in postgres:*-alpine
.
from wal2json.
I recalled ldd
. Here's a list of what's missing. I think there's too much to get rid of glibc
.
$ ldd /usr/local/lib/postgresql/wal2json.so
ldd (0x7ffade911000)
libc.so.6 => ldd (0x7ffade911000)
Error relocating /usr/local/lib/postgresql/wal2json.so: palloc0: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: __snprintf_chk: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: pg_lsn_out: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: parse_bool: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: pg_strncasecmp: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: nocachegetattr: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: CurrentMemoryContext: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: OidOutputFunctionCall: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: RelationIdGetRelation: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: OutputPluginWrite: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: lappend: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: ReleaseSysCache: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: elog_finish: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: initStringInfo: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: AllocSetContextCreate: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: list_free_deep: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: text_to_cstring: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: errstart: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: OutputPluginPrepareWrite: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: appendStringInfoChar: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: appendStringInfo: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: get_namespace_name: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: pg_detoast_datum: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: TopMemoryContext: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: escape_json: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: MemoryContextDelete: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: pstrdup: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: RelationClose: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: elog_start: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: format_type: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: getTypeOutputInfo: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: SearchSysCache: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: errmsg: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: timestamptz_to_str: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: DirectFunctionCall2Coll: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: errfinish: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: appendStringInfoString: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: DirectFunctionCall1Coll: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: RelationGetIndexList: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: heap_getsysattr: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: MemoryContextReset: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: pfree: symbol not found
Error relocating /usr/local/lib/postgresql/wal2json.so: errcode: symbol not found
from wal2json.
Seems like I am in a dead end with Alpine: gliderlabs/docker-alpine#149
from wal2json.
I have tried to install glibc
like it's done in this Dockerfile: https://github.com/jeanblanchard/docker-alpine-glibc/blob/master/Dockerfile
Still no success.
from wal2json.
One more info - what I see after my build:
gcc-nm /usr/local/lib/postgresql/wal2json.so | grep GLIB
U __ctype_b_loc@@GLIBC_2.3
w __cxa_finalize@@GLIBC_2.2.5
U __snprintf_chk@@GLIBC_2.3.4
U __stack_chk_fail@@GLIBC_2.4
U memmove@@GLIBC_2.2.5
U strcmp@@GLIBC_2.2.5
U strlen@@GLIBC_2.2.5
U strncpy@@GLIBC_2.2.5
U strspn@@GLIBC_2.2.5
I have read in man pages for ld(8)
that it tries to deduce what dependencies to use based on what it was linked against. I am not sure if there's some fallback if it can't find the exact version...
from wal2json.
I am also facing the similar issue.
I am running postgres DB as a container on alpine linux.
Please guide me how to resolve this issue
from wal2json.
Alpine is becoming (or maybe already is) the standard for running Docker containers. In dev, prod, and everywhere in between. There are official Postgres Docker images for Alpine. It seems that this should build on officially supported distros.
from wal2json.
RUN USE_PGXS=1 make && make install
In the latest versions, disable the llvm if you see errors related to clang or llvm.
RUN make with_llvm=no && make with_llvm=no install
from wal2json.
Related Issues (20)
- Can't enable truncation for format-version 1 HOT 1
- WAL2JSON Format-1 not including Current lsn HOT 3
- When attempting logical decoding : /usr/lib64/pgsql/wal2json.so: undefined symbol: elog_finish HOT 2
- Change data not captured properly while operating with partition tables HOT 1
- Getting table name in double Quotes HOT 2
- Segmentation fault HOT 1
- ERROR: could not load library "C:/Program Files/PostgreSQL/9.5/lib/wal2json.dll": The specified module could not be found. HOT 1
- START_REPLICATION command does not work with wal2json options HOT 1
- NaN values are received as "null" for NUMERIC type while capturing change data HOT 4
- Invalid JSON with non-transactional message HOT 5
- WAL record received in different formats when the table name contains the single quote HOT 1
- Add support for update_replication_progress introduced in pg15
- Install failed on Alpine 15 HOT 2
- ProgramLimitExceeded plugin wal2json HOT 2
- include-pk can't work with identity full? HOT 2
- Official instructions to build from source for production use HOT 1
- Change data not captured HOT 3
- LSN not picking from "withStartPosition" in format version-2 HOT 2
- Building dll for windows HOT 4
- Build and Install In RDS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wal2json.