View Issue Details

IDProjectCategoryView StatusLast Update
0001561bareos-coredirectorpublic2024-02-28 09:59
Reportersmarsching Assigned Tobruno-at-bareos  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version22.1.1 
Summary0001561: Message about DelCandidates table pops up in Bareos director output
DescriptionThis bug has previously been reported as 0001472, but I cannot reopen the existing report, so I am creating a new one.

Each time a job is run, the following line turns up in the output of the Bareos director service (which can be displayed with “systemctl status bareos-director.service”:

NOTICE: table "delcandidates" does not exist, skipping

The DelCandidates table is a temporary table that is repeatedly created and dropped as part of the purging process in core/src/dird/ua_prune.cc. Specifically, the SQL statement “DROP TABLE DelCandidates IF NOT EXISTS” issued by DropTempTables(…) causes this message to be logged when the DelCandidates table does not exist.

This will happen during normal operation, because DropTempTables is always called before calling CreateTempTables in order to drop the table, it if already exists. However, usually this table will not exist because it is also dropped after using it, the call to DropTempTables before CreateTempTables is only there in case the table did not get properly dropped the last time because the process was interrupted (the computer might have crashed, etc.).

This message does NOT indicate a problem. It is just a notice from PostgreSQL that the table does not exist (which is not an error because of the “IF EXISTS” in the SQL statement). So, this is a purely cosmetic issue.

The proper way to get rid of this would be setting “client_min_messages” to “warning” (see https://dba.stackexchange.com/questions/228331). As far as I can tell, the Bareos DDL scripts that update the schema do this, but it is not done for the regular connections used by the director.

I think that this could be fixed by changing the call to PQsetdbLogin in coresrc/cats/postgresql.cc:

    db_handle_ = PQsetdbLogin(db_address_, /* default = localhost */
                              port, /* default port */
                              NULL, /* pg options */
                              NULL, /* tty, ignored */
                              db_name_, /* database name */
                              db_user_, /* login name */
                              db_password_); /* password */

should become

    db_handle_ = PQsetdbLogin(db_address_, /* default = localhost */
                              port, /* default port */
                              "-c client_min_messages=warning", /* pg options */
                              NULL, /* tty, ignored */
                              db_name_, /* database name */
                              db_user_, /* login name */
                              db_password_); /* password */

(but I have not tested this).

A workaround is adding this setting in the PostgreSQL server configuration (e.g. /etc/postgresql/12/main/postgresql.conf on Ubuntu 20.04):

echo "client_min_messages = warning" >>/etc/postgresql/12/main/postgresql.conf
systemctl restart postgresql.service

I tested that this works. However, such a change will apply to all connections made to the PostgreSQL server, not just to connections made by the Bareos director.
Steps To Reproduce1. Install Bareos 22.1.1 on Ubuntu 20.04.
2. Run a backup job.
3. Check the output of systemctl status bareos-director.service.
TagsNo tags attached.

Activities

bruno-at-bareos

bruno-at-bareos

2023-10-30 14:06

manager   ~0005484

You're using something which trigger this, by default nothing is reported
Ubuntu 22.0.4 / Bareos 22.1.1 current, dbconfig

● bareos-director.service - Bareos Director Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-director.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-10-30 13:04:24 UTC; 2s ago
       Docs: man:bareos-dir(8)
   Main PID: 3261 (bareos-dir)
      Tasks: 3 (limit: 965)
     Memory: 4.8M
        CPU: 14ms
     CGroup: /system.slice/bareos-director.service
             └─3261 /usr/sbin/bareos-dir -f

Oct 30 13:04:24 ubuntu-2204.intern.bareos systemd[1]: Started Bareos Director Daemon service.

root@ubuntu-2204:~# bconsole
Connecting to Director localhost:9101
 Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
1000 OK: bareos-dir Version: 22.1.1~pre160.72763729a (20 October 2023)
Bareos community build (UNSUPPORTED).
Get professional support from https://www.bareos.com
You are connected using the default console

Enter a period (.) to cancel a command.
*run job=backup-bareos-fd
Using Catalog "MyCatalog"
Run Backup job
JobName: backup-bareos-fd
Level: Incremental
Client: bareos-fd
Format: Native
FileSet: SelfTest
Pool: Incremental (From Job IncPool override)
Storage: File (From Job resource)
When: 2023-10-30 13:04:39
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=1
You have messages.
*m
30-Oct 13:04 bareos-dir JobId 1: No prior Full backup Job record found.
30-Oct 13:04 bareos-dir JobId 1: No prior or suitable Full backup found in catalog. Doing FULL backup.
30-Oct 13:04 bareos-dir JobId 1: Start Backup JobId 1, Job=backup-bareos-fd.2023-10-30_13.04.41_03
30-Oct 13:04 bareos-dir JobId 1: Connected Storage daemon at ubuntu-2204.intern.bareos:9103, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
30-Oct 13:04 bareos-dir JobId 1: Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
30-Oct 13:04 bareos-dir JobId 1: Probing client protocol... (result will be saved until config reload)
30-Oct 13:04 bareos-dir JobId 1: Connected Client: bareos-fd at localhost:9102, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
30-Oct 13:04 bareos-dir JobId 1: Handshake: Immediate TLS
30-Oct 13:04 bareos-dir JobId 1: Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
*m
30-Oct 13:04 bareos-dir JobId 1: Created new Volume "Full-0001" in catalog.
30-Oct 13:04 bareos-dir JobId 1: Using Device "FileStorage" to write.
30-Oct 13:04 ubuntu-2204.intern.bareos-fd JobId 1: Connected Storage daemon at ubuntu-2204.intern.bareos:9103, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
30-Oct 13:04 ubuntu-2204.intern.bareos-fd JobId 1: Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
30-Oct 13:04 ubuntu-2204.intern.bareos-fd JobId 1: Extended attribute support is enabled
30-Oct 13:04 ubuntu-2204.intern.bareos-fd JobId 1: ACL support is enabled
30-Oct 13:04 bareos-sd JobId 1: Labeled new Volume "Full-0001" on device "FileStorage" (/var/lib/bareos/storage).
30-Oct 13:04 bareos-sd JobId 1: Wrote label to prelabeled Volume "Full-0001" on device "FileStorage" (/var/lib/bareos/storage)
30-Oct 13:04 bareos-sd JobId 1: Releasing device "FileStorage" (/var/lib/bareos/storage).
30-Oct 13:04 bareos-sd JobId 1: Elapsed time=00:00:01, Transfer rate=61.75 M Bytes/second
30-Oct 13:04 bareos-dir JobId 1: Insert of attributes batch table with 447 entries start
30-Oct 13:04 bareos-dir JobId 1: Insert of attributes batch table done
30-Oct 13:04 bareos-dir JobId 1: Bareos bareos-dir 22.1.1~pre160.72763729a (20Oct23):
  Build OS: Ubuntu 22.04.1 LTS
  JobId: 1
  Job: backup-bareos-fd.2023-10-30_13.04.41_03
  Backup Level: Full (upgraded from Incremental)
  Client: "bareos-fd" 22.1.1~pre160.72763729a (20Oct23) Ubuntu 22.04.1 LTS,ubuntu
  FileSet: "SelfTest" 2023-10-30 13:04:41
  Pool: "Full" (From Job FullPool override)
  Catalog: "MyCatalog" (From Client resource)
  Storage: "File" (From Job resource)
  Scheduled time: 30-Oct-2023 13:04:39
  Start time: 30-Oct-2023 13:04:43
  End time: 30-Oct-2023 13:04:44
  Elapsed time: 1 sec
  Priority: 10
  FD Files Written: 447
  SD Files Written: 447
  FD Bytes Written: 61,710,119 (61.71 MB)
  SD Bytes Written: 61,755,337 (61.75 MB)
  Rate: 61710.1 KB/s
  Software Compression: None
  VSS: no
  Encryption: no
  Accurate: no
  Volume name(s): Full-0001
  Volume Session Id: 1
  Volume Session Time: 1698671064
  Last Volume Bytes: 61,812,941 (61.81 MB)
  Non-fatal FD errors: 0
  SD Errors: 0
  FD termination status: OK
  SD termination status: OK
  Bareos binary info: Bareos community build (UNSUPPORTED): Get professional support from https://www.bareos.com
  Job triggered by: User
  Termination: Backup OK

*q
root@ubuntu-2204:~# systemctl status bareos-dir
● bareos-director.service - Bareos Director Daemon service
     Loaded: loaded (/lib/systemd/system/bareos-director.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-10-30 13:04:24 UTC; 31s ago
       Docs: man:bareos-dir(8)
   Main PID: 3261 (bareos-dir)
      Tasks: 3 (limit: 965)
     Memory: 5.6M
        CPU: 74ms
     CGroup: /system.slice/bareos-director.service
             └─3261 /usr/sbin/bareos-dir -f

Oct 30 13:04:24 ubuntu-2204.intern.bareos systemd[1]: Started Bareos Director Daemon service.
root@ubuntu-2204:~#
smarsching

smarsching

2023-10-30 18:18

reporter   ~0005486

I just tested it in a fresh VM and you are right, that it does not happen immediately when running the first job: It actually is the prune action that causes this message. Instead of running a backup job, one has to run:

root@ubuntu:~# bconsole
Connecting to Director localhost:9101
 Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
1000 OK: bareos-dir Version: 22.1.1 (23 October 2023)
Self-compiled binaries (UNSUPPORTED)
Get professional support from https://www.bareos.com
You are connected using the default console

Enter a period (.) to cancel a command.
*prune jobs client=bareos-fd
Using Catalog "MyCatalog"
The current Job retention period is: 6 months
Continue? (yes/mod/no): yes
Begin pruning Jobs older than 6 months .
No jobids found to be purged

After this, the message turns up in the output of “systemctl status bareos-director.service”:

Okt 30 18:16:47 ubuntu bareos-dir[15778]: NOTICE: table "delcandidates" does not exist, skipping

I guess that due some configuration details, the prune action is not automatically run after the job in a freshly installed system using the default configuration, which is why just running a job does not trigger the message there.
bruno-at-bareos

bruno-at-bareos

2024-01-18 18:25

manager   ~0005703

Could you retry this with the current version 23.0.2~pre
bruno-at-bareos

bruno-at-bareos

2024-02-28 09:59

manager   ~0005817

Closing not feedback return

Related Changesets

bareos: master 67c62524

2023-11-09 15:40

bruno-at-bareos

Ported: N/A

Details Diff
PostgreSQL plugin: improvements / fixes

- adjust plugin code to ask configuration parameters from the cluster
- use `raise` error in private functions, and `except` in main
- apply black modify suggestions
- reorder alphabetically the private functions
- delete removed parameter postgresql_data_directory
- add wal_archive_symlink for testing
- add systemtest testrunner-walsymlink for wal_archive_dir as symlink
- add systemtest testrunner-debian for system with pg_*cluster* tools
add mention about support of debian like pg_*cluster* tools
- testrunner-roles adjust sentence checked, fix start_fast parameter
- setup_database_local.sh fix ID usage and double space

Fix issue 0001561

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
Affected Issues
0001561
mod - core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py Diff File
mod - systemtests/tests/py3plug-fd-postgresql/database/setup_local_db.sh.in Diff File
mod - systemtests/tests/py3plug-fd-postgresql/etc/bareos/bareos-dir.d/fileset/PluginTest.conf.in Diff File
add - systemtests/tests/py3plug-fd-postgresql/etc/bareos/bareos-dir.d/fileset/PluginTestDebian.conf.in Diff File
mod - systemtests/tests/py3plug-fd-postgresql/etc/bareos/bareos-dir.d/fileset/PluginTestNoRole.conf.in Diff File
mod - systemtests/tests/py3plug-fd-postgresql/etc/bareos/bareos-dir.d/fileset/PluginTestRole.conf.in Diff File
mod - systemtests/tests/py3plug-fd-postgresql/etc/bareos/bareos-dir.d/fileset/PluginTestTablespace.conf.in Diff File
add - systemtests/tests/py3plug-fd-postgresql/etc/bareos/bareos-dir.d/fileset/PluginTestWalSymlink.conf.in Diff File
add - systemtests/tests/py3plug-fd-postgresql/testrunner-debian Diff File
mod - systemtests/tests/py3plug-fd-postgresql/testrunner-roles Diff File
add - systemtests/tests/py3plug-fd-postgresql/testrunner-walsymlink Diff File

Issue History

Date Modified Username Field Change
2023-10-25 14:21 smarsching New Issue
2023-10-30 14:06 bruno-at-bareos Note Added: 0005484
2023-10-30 18:18 smarsching Note Added: 0005486
2023-11-20 13:11 bruno-at-bareos Changeset attached => bareos master 67c62524
2024-01-18 18:25 bruno-at-bareos Assigned To => bruno-at-bareos
2024-01-18 18:25 bruno-at-bareos Status new => feedback
2024-01-18 18:25 bruno-at-bareos Note Added: 0005703
2024-02-28 09:59 bruno-at-bareos Status feedback => closed
2024-02-28 09:59 bruno-at-bareos Resolution open => fixed
2024-02-28 09:59 bruno-at-bareos Note Added: 0005817