Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install problem with Postgres 16.1 installed with Postgres app on a Mac #6474

Closed
nicofr83 opened this issue Dec 28, 2023 · 7 comments
Closed

Comments

@nicofr83
Copy link

What type of bug is this?

Configuration

What subsystems and features are affected?

Other

What happened?

I installed timescales 2.13.0 with Postgres 16 (installed with Postgres app), and the server do not start. The log is saying:
2023-12-28 11:58:43.280 CET [4741] FATAL: could not access file "timescaledb": No such file or directory
2023-12-28 11:58:43.280 CET [4741] LOG: database system is shut down

I used the same installation procedure with postgres15 (installed with Postgres app), and the server works well.

Here is the installation script I used:

brew tap timescale/tap
brew install timescaledb

timescaledb-tune --yes --conf-path=/Users/nico/Library/Application\ Support/Postgres/var-16/postgresql.conf

/usr/bin/install -c -m 755 /opt/homebrew/Cellar/timescaledb/2.13.0/lib/timescaledb/postgresql/timescaledb-2.13.0.so /Applications/Postgres.app/Contents/Versions/16/lib/postgresql/
/usr/bin/install -c -m 755 /opt/homebrew/Cellar/timescaledb/2.13.0/lib/timescaledb/postgresql/timescaledb-tsl-2.13.0.so /Applications/Postgres.app/Contents/Versions/16/lib/postgresql/
/usr/bin/install -c -m 755 /opt/homebrew/Cellar/timescaledb/2.13.0/lib/timescaledb/postgresql/timescaledb.so /Applications/Postgres.app/Contents/Versions/16/lib/postgresql/

/usr/bin/install -c -m 644 /opt/homebrew/Cellar/timescaledb/2.13.0/share/timescaledb/* /Applications/Postgres.app/Contents/Versions/16/share/postgresql/extension/

I am running Mac OS 14.2.1, on an M2 Mac studio
Any idea ?

TimescaleDB version affected

2.13.0

PostgreSQL version used

16.1

What operating system did you use?

Mac OS 14.2.1

What installation method did you use?

Other

What platform did you run on?

Not applicable

Relevant log output and stack trace

No response

How can we reproduce the bug?

Install and run the postgres app on the Mac (https://postgresapp.com)
  I am using Postgres 11 to 16 config.
  start postgres 16

Run the script given in the description

add in Postgres config file: shared_preload_libraries = 'timescaledb'

restart postgres, you should get the problem
@nicofr83 nicofr83 added the bug label Dec 28, 2023
@jnidzwetzki
Copy link
Contributor

Hello @nicofr83,

Thank you for reaching out. The error message could not access file "timescaledb": No such file or directory indicates that PostgreSQL can not find the timescaledb shared library.

There seems to be a problem with your local TimescaleDB build. According to the output you posted, the created TimescaleDB library is suffixed with .so. However, for PG 16 the .dylib suffix should be used (postgres/postgres@b55f62a) on OS X.

The Homebrew Tap for TimescaleDB is intended to work with the Homebrew version of PostgreSQL. It seems Homebrew detected a wrong PostgreSQL version when the build was configured. So, I recommend deinstalling the Homebrew build, checking that pg_conf points to the proper PostgreSQL version, and reinstalling the Homebrew build again. If this does not help, please use the source installation method.

@pauljsymonds
Copy link

pauljsymonds commented Feb 11, 2024

SOLVED

I had a similar problem to this, I installed the PostgresApp (brew install postres@16 errors).

Postgres App is awesome on Mac it just works.

I followed your docs here then to Install from Source

Side note.......
You need to update your docs to point to latest 2.14.0 though.

I had to install CMAKE again as a Mac App and set the path etc. all good to here.

Then....

git checkout 2.14.0  


Note: switching to '2.14.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 5ede37005 Release 2.14.0
(base)  timescaledb % ./bootstrap
cmake is required to build TimescaleDB. Please install via your system's preferred method.
(base)  timescaledb % PATH="/Applications/CMake.app/Contents/bin":"$PATH"
(base)  timescaledb % ./bootstrap                                        
-- The C compiler identification is AppleClang 15.0.0.15000100
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- TimescaleDB version 2.14.0. Can be updated from version 2.13.1
-- Build type is Release
-- Install method is 'source'
-- Performing Test CC_SUPPORTS_NO_UNUSED_CLI_ARG
-- Performing Test CC_SUPPORTS_NO_UNUSED_CLI_ARG - Success
-- Performing Test CC_SUPPORTS_NO_FORMAT_TRUNCATION
-- Performing Test CC_SUPPORTS_NO_FORMAT_TRUNCATION - Failed
-- Compiler does not support -Wno-format-truncation
-- Performing Test CC_STRINGOP_TRUNCATION
-- Performing Test CC_STRINGOP_TRUNCATION - Failed
-- Compiler does not support -Wno-stringop-truncation
-- Performing Test CC_SUPPORTS_IMPLICIT_FALLTHROUGH
-- Performing Test CC_SUPPORTS_IMPLICIT_FALLTHROUGH - Success
-- Performing Test CC_SUPPORTS_NEWLINE_EOF
-- Performing Test CC_SUPPORTS_NEWLINE_EOF - Success
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN
-- Performing Test CC_SUPPORTS_VISIBILITY_HIDDEN - Success
-- Using compiler AppleClang
-- Found Git: /opt/homebrew/bin/git (found version "2.43.1") 
CMake Error at CMakeLists.txt:350 (message):
  TimescaleDB only supports PostgreSQL 13, 14, 15 and 16


-- Configuring incomplete, errors occurred!

The issue is that the user may have Anaconda Installed and this defaults to Postgres 12.5 in some instances or another copy of Postgres.

Also you need a good understanding or a lot of googling around $PATH Apple have modified this and its not straight forwards.

I used the which command found all paths and rm -rf all postgres and anaconda leaving just the PostgresApp.

cd build && make 

[100%] Linking C shared module timescaledb-tsl-2.14.0.dylib
ld: warning: -multiply_defined is obsolete
ld: warning: -multiply_defined is obsolete
[100%] Built target timescaledb-tsl

BUT......... Failure Apple locks down the App folder.

% make install
[  0%] Built target sqlfile
[ 18%] Built target sqlupdatescripts
[ 18%] Built target gitcheck
[ 66%] Built target timescaledb
[ 70%] Built target timescaledb-loader
[100%] Built target timescaledb-tsl
Install the project...
-- Install configuration: "Release"
-- Installing: /Applications/Postgres.app/Contents/Versions/16/share/postgresql/extension/timescaledb.control
CMake Error at cmake_install.cmake:49 (file):
  file INSTALL cannot copy file
  "/Users/home/Development/timescaledb/build/timescaledb.control" to
  "/Applications/Postgres.app/Contents/Versions/16/share/postgresql/extension/timescaledb.control":
  Operation not permitted.


make: *** [install] Error 1

SOLVED
Apple have clearly locked this down

There is a way though you can allow Terminal Access in Settings!

Privacy & Security ---- App Management + Terminal

@nicofr83
Copy link
Author

nicofr83 commented Feb 11, 2024 via email

@akuzm
Copy link
Member

akuzm commented Feb 12, 2024

CMake Error at CMakeLists.txt:350 (message):
  TimescaleDB only supports PostgreSQL 13, 14, 15 and 16

@nicofr83 This log means it's picking the wrong Postgres version again, you have to set proper path to Postgres as mentioned by @pauljsymonds

Copy link

Dear Author,

This issue has been automatically marked as stale due to lack of activity. With only the issue description that is currently provided, we do not have enough information to take action. If you have or find the answers we would need, please reach out. Otherwise, this issue will be closed in 30 days.

Thank you!

Copy link

Dear Author,

We are closing this issue due to lack of activity. Feel free to add a comment to this issue if you can provide more information and we will re-open it.

Thank you!

@toby5box
Copy link

I had the same issue as OP; logs spammed with:

2024-11-18 14:16:15.630 EST [55061] FATAL:  could not access file "timescaledb": No such file or directory
2024-11-18 14:16:15.633 EST [55061] LOG:  database system is shut down

None of the following worked:

  • brew reinstall timescaledb
  • brew uninstall timescaledb; brew install timescaledb

pg_config does point to Postgresql 16:

% pg_config                               
BINDIR = /usr/local/Cellar/postgresql@16/16.5/bin
DOCDIR = /usr/local/Cellar/postgresql@16/16.5/share/doc/postgresql@16
HTMLDIR = /usr/local/Cellar/postgresql@16/16.5/share/doc/postgresql@16
INCLUDEDIR = /usr/local/opt/postgresql@16/include
PKGINCLUDEDIR = /usr/local/opt/postgresql@16/include/postgresql
INCLUDEDIR-SERVER = /usr/local/opt/postgresql@16/include/postgresql/server
LIBDIR = /usr/local/Cellar/postgresql@16/16.5/lib
PKGLIBDIR = /usr/local/opt/postgresql@16/lib/postgresql
LOCALEDIR = /usr/local/Cellar/postgresql@16/16.5/share/locale
MANDIR = /usr/local/Cellar/postgresql@16/16.5/share/man
SHAREDIR = /usr/local/opt/postgresql@16/share/postgresql@16
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/opt/postgresql@16/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--datadir=/usr/local/opt/postgresql@16/share/postgresql@16' '--libdir=/usr/local/opt/postgresql@16/lib' '--includedir=/usr/local/opt/postgresql@16/include' '--sysconfdir=/usr/local/etc' '--docdir=/usr/local/Cellar/postgresql@16/16.5/share/doc/postgresql@16' '--enable-nls' '--enable-thread-safety' '--with-gssapi' '--with-icu' '--with-ldap' '--with-libxml' '--with-libxslt' '--with-lz4' '--with-zstd' '--with-openssl' '--with-pam' '--with-perl' '--with-uuid=e2fs' '--with-extra-version= (Homebrew)' '--with-bonjour' '--with-tcl' 'PG_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk' '--disable-debug' '--disable-dependency-tracking' '--prefix=/usr/local/Cellar/postgresql@16/16.5' '--libdir=/usr/local/Cellar/postgresql@16/16.5/lib' 'CC=clang' 'LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/krb5/lib -L/usr/local/opt/openssl@3/lib -L/usr/local/opt/readline/lib' 'CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/krb5/include -I/usr/local/opt/openssl@3/include -I/usr/local/opt/readline/include' 'CXX=clang++' 'PKG_CONFIG_PATH=/usr/local/opt/pkgconf/lib/pkgconfig:/usr/local/opt/icu4c@76/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/lz4/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/zstd/lib/pkgconfig'
CC = clang
CPPFLAGS = -I/usr/local/Cellar/icu4c@76/76.1_1/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I/usr/local/opt/gettext/include -I/usr/local/opt/krb5/include -I/usr/local/opt/openssl@3/include -I/usr/local/opt/readline/include -I/usr/local/opt/lz4/include -I/usr/local/opt/zstd/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -O2
CFLAGS_SL = 
LDFLAGS = -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -L/usr/local/opt/gettext/lib -L/usr/local/opt/krb5/lib -L/usr/local/opt/openssl@3/lib -L/usr/local/opt/readline/lib -L/usr/lib -L/usr/local/opt/lz4/lib -L/usr/local/opt/zstd/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lintl -lzstd -llz4 -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm 
VERSION = PostgreSQL 16.5 (Homebrew)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants