Error upon starting clientbackend

I’m trying to run urbackupclient. I compiled the client, but upon running urbackupclientbackend I get the following error:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string: construction from null is not valid
Aborted (core dumped)

I’m running:
urbackup-client 2.5.25 (also tried .24, same error)
crypto+±8.9.0
Nixos 24.11.716793.a880f49904d6 (Vicuna)

I’m unsure how to solve this or how to debug this further. Any help would be greatly appreciated.

Could you run it in gdb and post a backtrace?

gdb --args urbackupclientbackend -v debug

run
bt

Thanks for picking this up, running it in gdb gives:

Starting program: /home/<myuser>/Documents/urbackup/sources/urbackup-client-2.5.25.0/urbackupclientbackend -v debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libthread_db.so.1".
2025-04-09 08:39:09: ERROR: Cannot set working directory to directory /usr/local/var
[New Thread 0x7ffff73206c0 (LWP 4540)]
2025-04-09 08:39:09: ERROR: Error opening admin only file
2025-04-09 08:39:09: ERROR: Error setting file permissions to "urbackup/backup_client.db"
[New Thread 0x7ffff6b1f6c0 (LWP 4541)]
2025-04-09 08:39:09: WARNING: SQLite: cannot open file at line 43917 of [2d3a40c05c] errorcode: 14
2025-04-09 08:39:09: WARNING: SQLite: os_unix.c:43917: (2) open(/home/<myuser>/Documents/urbackup/sources/urbackup-client-2.5.25.0/urbackup/backup_client.db) -  errorcode: 14
2025-04-09 08:39:09: Could not open db [urbackup/backup_client.db]
2025-04-09 08:39:09: ERROR: Database "urbackup/backup_client.db" couldn't be opened

Thread 1 "urbackupclientb" received signal SIGSEGV, Segmentation fault.
upgrade_client () at urbackupclient/dllmain.cpp:765
765		IQuery *q=db->Prepare("SELECT tvalue FROM misc WHERE tkey='db_version'");
(gdb) bt
#0  upgrade_client () at urbackupclient/dllmain.cpp:765
#1  0x0000000000692bfa in LoadActions_urbackupclient (pServer=<optimized out>) at urbackupclient/dllmain.cpp:400
#2  0x0000000000487597 in CServer::LoadStaticPlugins (this=this@entry=0x8ee400) at Server.cpp:2257
#3  0x00000000004a64b0 in main_fkt (argc=<optimized out>, argv=<optimized out>) at main.cpp:571
#4  0x00000000004a9a0f in main_fkt_catch (argc=<optimized out>, argv=<optimized out>) at main.cpp:130
#5  0x00000000004a9a42 in real_main (argc=<optimized out>, argv=<optimized out>) at main.cpp:164
#6  0x0000000000790f68 in run_real_main (args=std::vector of length 18, capacity 18 = {...}) at urbackupclient/cmdline_preprocessor.cpp:59
#7  0x000000000046b2cd in main (argc=<optimized out>, argv=<optimized out>) at urbackupclient/cmdline_preprocessor.cpp:431

Looking at the logfile I created the directory urbackup inside the sources dir. I now get the somewhat interesting behaviour that if I run urbackupclientbackend -v debug it starts up and seems to work (I have a problem with the password file, but that’s probably just setup related).

However if I start it without -v debug it still crashes, here’s the backtrace for that (I can just run with -v debug, but I can imagine this is still something you might want to look at):

(gdb) run
Starting program: /home/<myuser>/Documents/urbackup/sources/urbackup-client-2.5.25.0/urbackupclientbackend 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libthread_db.so.1".
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string: construction from null is not valid

Program received signal SIGABRT, Aborted.
0x00007ffff73b388c in __pthread_kill_implementation ()
   from /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6
(gdb) bt
#0  0x00007ffff73b388c in __pthread_kill_implementation ()
   from /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6
#1  0x00007ffff7361576 in raise () from /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6
#2  0x00007ffff7349935 in abort () from /nix/store/maxa3xhmxggrc5v2vc0c3pjb79hjlkp9-glibc-2.40-66/lib/libc.so.6
#3  0x00007ffff76acc2b in __gnu_cxx::__verbose_terminate_handler() [clone .cold] ()
   from /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
#4  0x00007ffff76bc20a in __cxxabiv1::__terminate(void (*)()) ()
   from /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
#5  0x00007ffff76bc275 in std::terminate() ()
   from /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
#6  0x00007ffff76bc4c7 in __cxa_throw ()
   from /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
#7  0x00007ffff76af39c in std::__throw_logic_error(char const*) ()
   from /nix/store/mhd0rk497xm0xnip7262xdw9bylvzh99-gcc-13.3.0-lib/lib/libstdc++.so.6
#8  0x0000000000790873 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> > (this=this@entry=0x7fffffffb030, __s=<optimized out>, __a=...)
    at /nix/store/yg4ahy7gahx91nq80achmzilrjyv0scj-gcc-13.3.0/include/c++/13.3.0/bits/basic_string.h:646
#9  0x000000000046a2da in main (argc=1, argv=0x7fffffffb298)
    at /nix/store/yg4ahy7gahx91nq80achmzilrjyv0scj-gcc-13.3.0/include/c++/13.3.0/bits/new_allocator.h:88