FATAL: could not access file "timescaledb": No such file or directory

I had left my installation for a few weeks and could not remember how I set it up or get it started! So I decided to start again. As you do.

However, my PostgreSQL logs are filled with entires like this:

2023-07-07 07:16:50.214 BST [34596] FATAL:  could not access file "timescaledb": No such file or directory
2023-07-07 07:16:50.214 BST [34596] LOG:  database system is shut down
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise.  See the documentation for
more information on how to properly start the server.

For one thing, I am not starting it as root, but as my own account. So I don’t know why it’s complaining about that.

More importantly, why can’t it find the installation? I installed PostgreSQL@14 using brew, but then it seemingly did that as part of the installation of TimescaleDB anyway.

So I ran the standard commands:

brew tap timescale/tap
brew install timescaledb
timescaledb-tune --quiet --yes
cd /opt/homebrew/Cellar/timescaledb/2.11.1/bin/
./timescaledb_move.sh
brew services restart postgresql@14

What’s going on with this? I had to specify the conf path when running timescaledb-tune, since it could not find it.

Hi Mark, I remember I fall into something similar a few days ago because I have multiple versions of postgresql and for some reason I need to relink postgres again.

When I read your post, my first action was double check the actual version and it seems 14 so you’re good to go with your actual version. If you for some reason got like postgresql 15 then probably you’ll need to brew relink postgresql@14 to use it.

I remember I struggled a lot and that was a very confusing process because of my multiple installations. AFAIR the timescaledb_tune uses the pg_config, so you can also double check if pg_config path is using the right path for pg 14.

Same here FATAL: could not access file "timescaledb": No such file or directory but because I inadvertently started a Postgres v16 whereas all my apps were on v15, but now I can’t seem to start v15 because of this error.

macOS
Postgres.app from download
PGAdmin via Homebrew.

Welcome MtnBiker,

If you want to have your data, you’ll need to relink your Postgres.app as brew link postgresql@16 overrides it.

The app recommends you to remove the brew to not collide service ports and so on.

@ jonatasdp Thanks. Since I posted I realize I’m stuck in v16. I’m trying to get back to v15. I have two databases there that I don’t have recent backups of. Once I get back to v15 I’ll export and bring into v16. I was and am getting Postgres via the macOS app, not Homebrew (although I had in the past). I need to get to v15 or find some other way to get those databases back.

Log when I try to start v15 server:

2023-12-12 13:33:18.811 PST [43001] FATAL:  could not access file "timescaledb": No such file or directory
2023-12-12 13:33:18.811 PST [43001] LOG:  database system is shut down

I was working on a db with Timescale in v15 before.

Do you have Timescale running on PG 15?
Edit the postgres.conf file and remove the timescaledb reference as preloaded extension. This line can be removed in case you were not using it before and it will start.

Hello,

my postgres db is running on postgres 13 with timescaledb 2.6. it shows like this on the database.

default_version | installed_version
-----------------±------------------
2.6.1 | 2.6.1
(1 row)

I am trying to upgrade from postgres13 to postgres 15 and I got failure message from pre-upgrade check.

Your installation references loadable libraries that are missing from the
new installation. You can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
/db/postgres/15/data/pg_upgrade_output.d/20240501T085606.397/loadable_libraries.txt

Failure, exiting

cat /db/postgres/15/data/pg_upgrade_output.d/20240501T085606.397/loadable_libraries.txt
could not load library “$libdir/timescaledb”: ERROR: could not access file “$libdir/timescaledb”: No such file or directory
In database: postgres
In database: example
In database: example1
In database: directories_heartbeat
In database: aspen_publishing
could not load library “$libdir/timescaledb-2.6.1”: ERROR: could not access file “$libdir/timescaledb-2.6.1”: No such file or directory
In database: postgres
In database: example
In database: example1
In database: directories_heartbeat
In database: aspen_publishing

Can you help me how to set the lib on it?

pwd
/usr/lib64/timescaledb-pg13

-rwxr-xr-x 1 root root 875344 Apr 11 2022 timescaledb-tsl-2.6.1.so
-rwxr-xr-x 1 root root 927672 Apr 11 2022 timescaledb-2.6.1.so

Thanks,

Hi @Kevin_Kim , the $libdir is on the pg_config file.

You can use the command pg_config to check all configuration.

pg_config | grep LIBDIR
LIBDIR = /usr/local/opt/postgresql@15/lib
PKGLIBDIR = /usr/local/opt/postgresql@15/lib/postgresql

Thanks for update. I tried to change the library path to postgres 13 but not changed.

$ pg_config |grep LIBDIR
LIBDIR = /usr/pgsql-15/lib
PKGLIBDIR = /usr/pgsql-15/lib

$ export LIBDIR=/usr/pgsql-13/lib

$ export PKGLIBDIR=/usr/pgsql-13/lib

$ pg_config |grep LIBDIR
LIBDIR = /usr/pgsql-15/lib
PKGLIBDIR = /usr/pgsql-15/lib

I think to update such detail, you’ll need to change the postgresql.conf and other related files to reflect on it. Check more details here: PostgreSQL: Documentation: 16: pg_config