View Issue Details

IDProjectCategoryView StatusLast Update
0001486bareos-coreGeneralpublic2022-10-06 17:40
Reporterstevec Assigned Tobruno-at-bareos  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionreopened 
Platformx86_64OSUbuntuOS Version20.04.5
Product Version20.0.7 
Summary0001486: compiled binaries not finding shared libraries when using custom location
DescriptionTrying to compile 20.0.7 from source, compiles fine. however when trying to do a simple config file check bareos-[dir|fd|sd] abort due to unable to load shared libraries (can't find them). using strace it's looking for libraries in different locations than where I'm specifying them to be located (looks to create subdirs for /tls/ ; /x86_64/ ; etc.

Note, I am compiling the cmake version here as a newbie my last version was v17.2.10 with automake so it's possible that some flags are not set. Which then would go more towards documentation (as compile / cmake flags seem to be not well documented).

As you can see in the strace it appears the binaries are coded to look in subdirectories of -Dlibdir which the install script is not creating or putting the libraries in there. So is this a problem with the cmake variables; build process; or install script?
Steps To Reproduce
build script setting directories, intent is to keep bareos in it's own mount point (I keep bareos on a ssd separate from the OS files).

----
cmake \
        -Dscsi-crypto=yes \
        -Dbatch-insert=yes \
        -Dsqlite3=yes \
        -Dopenssl=yes \
        -Dsbindir=/opt/bareos/sbin \
        -Dbindir=/opt/bareos/bin \
        -Dlibdir=/opt/bareos/lib \
        -Dsysconfdir=/opt/bareos/etc \
        -Dconfdir=/opt/bareos/etc/bareos \
        -Darchivedir=/tmp \
        -Dbackenddir=/opt/bareos/lib \
        -Dscriptdir=/opt/bareos/etc/bareos \
        -Dplugindir=/opt/bareos/lib \
        -Dworkingdir=/opt/bareos/var/working \
        -Dpiddir=/var/run \
        -Dsubsysdir=/var/lock/subsys \
        -Dbsrdir=/opt/bareos/var/working/bsr \
        -Dlogdir=/opt/bareos/var/logs \
        -Dmandir=/opt/bareos/share/man \
        -Ddatarootdir=/opt/bareos/share \
        -DSHARE_INSTALL_PREFIX:PATH=/opt/bareos/share \
        -Dsmartalloc=yes \
        -Ddir-password="xxxx" \
        -Dfd-password="xxxx" \
        -Dsd-password="xxxx" \
        ../bareos

make
make install

then test with :
strace /opt/bareos/sbin/bareos-dir -c /opt/bareos/etc/bareos/bareos-dir.conf -t

bareos-dir ABORTING due to ERROR
Unable to load any shared library for libbareoscats-postgresql.so
BAREOS aborting to obtain traceback.
BAREOS interrupted by signal 6: IOT trap
bareos-dir, bareos-dir got signal 6 - IOT trap. Attempting traceback.
exepath=/opt/bareos/sbin/
Calling: /opt/bareos/sbin/btraceback /opt/bareos/sbin/bareos-dir 3950715 /opt/bareos/var/working
It looks like the traceback worked...
Dumping: /opt/bareos/var/working/bareos-dir.3950715.bactrace


Additional Informationstrace errors:
----
openat(AT_FDCWD, "/opt/bareos/lib/tls/x86_64/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/tls/x86_64/x86_64", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/bareos/lib/tls/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/tls/x86_64", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/bareos/lib/tls/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/tls/x86_64", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/bareos/lib/tls/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/tls", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/bareos/lib/x86_64/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/x86_64/x86_64", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/bareos/lib/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/x86_64", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/opt/bareos/lib/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/bareos/lib/x86_64", 0x7ffe064f64b0) = -1 ENOENT (No such file or directory)

----
TagsNo tags attached.

Activities

bruno-at-bareos

bruno-at-bareos

2022-10-04 10:23

manager   ~0004797

You seems to want to build with sqlite3
this is no more supported, you can build only with postgresql (see the libbareoscats-postgresql.so )

The delivered binaries allow people to still run bareos 20 with other database to permit them to migrate to PostgreSQL.
It is not intended to build with.
bruno-at-bareos

bruno-at-bareos

2022-10-04 10:25

manager   ~0004798

btw for the cmake flags you can consult the different parts of how is build Bareos packages on debian, freebsd, rpm like by consulting the source code on github.com/bareos/bareos.
bruno-at-bareos

bruno-at-bareos

2022-10-04 10:25

manager   ~0004799

only PostgreSQL is supported as database.
stevec

stevec

2022-10-04 11:21

reporter   ~0004802


This is version 20.0.7, sqlite was dropped in version 21.0. Also since this is being built under ubuntu (debian) postgress is enabled by the spec file and if you note here that this is NOT running the software but doing a config file test only (-t flag). The issue as mentioned is NOT the database but the fact that the libraries called by the program are NOT installed in the correct directories.

-Dlibdir=/opt/bareos/lib

openat(AT_FDCWD, "/opt/bareos/lib/tls/x86_64/x86_64/libbareossql.so.20", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

see the '/tls/x86_64/x86_64/" that is a problem with the config/build or install process.

As for the location for the cmake/build flags, I am aware of the source code library at github (that's where I'm pulling the code from). I do not see a documented list of the flags there, I've been having to troll through the cmake, debian, etc directories and parse through each to find flags manually as I also cannot find information in the bareos docs either. Can you point to what file actually contains these flags?

bruno-at-bareos

bruno-at-bareos

2022-10-04 14:05

manager   ~0004803

Hello again, as stated before your build is missing postgresql (mandatory since 20) so you need to add the -Dpostgresql=yes to your cmake.

I add a full log of the cmake, build, install and usage of bareos 20 under Ubuntu 20.04 and this work well using your flags + -Dpostgresql=yes

If you want to have a list of cmake flags you can get inspired by
https://github.com/bareos/bareos/blob/master/core/platforms/packaging/bareos.spec#L924
or parsing the different debian/*rules

Hope this will help you to achieve your goal.
bareos20_ubuntu20_opt.log (411,175 bytes)
bruno-at-bareos

bruno-at-bareos

2022-10-04 14:05

manager   ~0004804

With 20 -Dpostgresql=yes is mandatory, as PostgreSQL is mandatory
stevec

stevec

2022-10-04 23:49

reporter   ~0004807

Last edited: 2022-10-04 23:50

Wanting to add a note to this case for the benefit for any future person running into a similar issue. The statement from bruno-at-bareos is incorrect. You can still use & test with sqlite3 in version 20.x (so documentation is correct that sqlite3 is still in version 20).

 The issue was a cmake compile time flag that you need:

        -Ddefault_db_backend="sqlite3"

As the default is postgresql and if that database is not there or configured correctly the binaries will not continue from the 'default' to any other backend database.

This was found in file core/cmake/BareosSetVariableDefaults.cmake
bruno-at-bareos

bruno-at-bareos

2022-10-05 10:36

manager   ~0004811

Of course you can still run a last time another database, but what will be the future of your installation?
So the advise to move as soon as you can to PostgreSQL backend is important, so any future potentially impacted user will keep in this important fact.
In almost a year from now 20 will be declared out of maintenance.

Can we close this report, or you want to propose a change in documentation, programs?
stevec

stevec

2022-10-05 15:08

reporter   ~0004812

The point is that in my use case sqlite works much better than postgresql and will give us time to figure out another solution to have the database not installed system-wide but localized with the backup program.

Anyway, yes the ticket can be closed. The only documentation change that would be really helpful but can open another ticket on that sometime later would be to somehow get a parsed list of all cmake declaration variables and their options/possible values/defaults. Opposed to digging through each file (like a master list of flags). But that's a completely different item.

Thanks.
bruno-at-bareos

bruno-at-bareos

2022-10-06 17:39

manager   ~0004815

You're right on the point that we lack cmake flags documentation, and beside that re-standardization (I've opened a developer task for that internally), but if you want to contribute, please do so by sending a PR ;-)

For your database, you can start postgresql also as another user than system installed like bareos user itself and use the initdb binary to located the database wherever you want. so you can compile and have postgresql and bareos running in whatever location you want.
bruno-at-bareos

bruno-at-bareos

2022-10-06 17:40

manager   ~0004816

All comments have been explained

Issue History

Date Modified Username Field Change
2022-10-04 02:56 stevec New Issue
2022-10-04 10:23 bruno-at-bareos Note Added: 0004797
2022-10-04 10:25 bruno-at-bareos Note Added: 0004798
2022-10-04 10:25 bruno-at-bareos Assigned To => bruno-at-bareos
2022-10-04 10:25 bruno-at-bareos Status new => closed
2022-10-04 10:25 bruno-at-bareos Resolution open => won't fix
2022-10-04 10:25 bruno-at-bareos Note Added: 0004799
2022-10-04 11:21 stevec Status closed => new
2022-10-04 11:21 stevec Resolution won't fix => reopened
2022-10-04 11:21 stevec Note Added: 0004802
2022-10-04 14:05 bruno-at-bareos Note Added: 0004803
2022-10-04 14:05 bruno-at-bareos File Added: bareos20_ubuntu20_opt.log
2022-10-04 14:05 bruno-at-bareos Status new => resolved
2022-10-04 14:05 bruno-at-bareos Resolution reopened => no change required
2022-10-04 14:05 bruno-at-bareos Note Added: 0004804
2022-10-04 23:49 stevec Status resolved => new
2022-10-04 23:49 stevec Resolution no change required => reopened
2022-10-04 23:49 stevec Note Added: 0004807
2022-10-04 23:50 stevec Note Edited: 0004807
2022-10-05 10:36 bruno-at-bareos Note Added: 0004811
2022-10-05 15:08 stevec Note Added: 0004812
2022-10-06 17:39 bruno-at-bareos Note Added: 0004815
2022-10-06 17:40 bruno-at-bareos Status new => closed
2022-10-06 17:40 bruno-at-bareos Note Added: 0004816