Skip to content

fix Plugin Names without double quotes #2299

@sduehr

Description

@sduehr

Bareos component version

[root@rl9test1 ~]# bareos-fd --version
25.0.0~pre593.eec5ac8ed
[root@rl9test1 ~]# bareos-dir --version
25.0.0~pre593.eec5ac8ed
[root@rl9test1 ~]# bareos-sd --version
25.0.0~pre593.eec5ac8ed
[root@rl9test1 ~]# bconsole --version
25.0.0~pre593.eec5ac8ed

[root@rl9test1 ~]# rpm -qa "bareos*plugin*"
bareos-filedaemon-python-plugins-common-25.0.0~pre593.eec5ac8ed-2119.el9.x86_64
bareos-filedaemon-grpc-python3-plugin-25.0.0~pre593.eec5ac8ed-2119.el9.x86_64
bareos-filedaemon-python3-plugin-25.0.0~pre593.eec5ac8ed-2119.el9.x86_64
bareos-vmware-plugin-25.0.0~pre593.eec5ac8ed-2119.el9.x86_64
bareos-filedaemon-grpc-python3-plugin-debuginfo-25.0.0~pre593.eec5ac8ed-2119.el9.x86_64
bareos-filedaemon-python3-plugin-debuginfo-25.0.0~pre593.eec5ac8ed-2119.el9.x86_64

Steps to reproduce

  1. Have Plugin Names = grpc (without double quotes) in the Client resource config of bareos-fd
  2. restart bareos-fd
  3. run a incremental backup that uses a python plugin (Plugin = "python:..." in FileSet

Expected results

Successful backup

Actual results

The bareos-fd crashes with

Jun 11 15:22:42 rl9test1 bareos-fd[5532]: /opt/rh/gcc-toolset-14/root/usr/include/c++/14/optional:475: constexpr _Tp& std::_Optional_base_impl<_Tp, _Dp>::_M_get() [with _Tp = 
grpc_child; _Dp = std::_Optional_base<grpc_child, false, false>]: Assertion 'this->_M_is_engaged()' failed.
Jun 11 15:22:42 rl9test1 bareos-fd[5532]: BAREOS interrupted by signal 6: IOT trap
Jun 11 15:22:42 rl9test1 bareos-fd[5532]: BAREOS interrupted by signal 6: IOT trap
Jun 11 15:22:42 rl9test1 bareos-fd[5532]: bareos-fd, rl9test1.ovirt1.bareos.test-fd got signal 6 - IOT trap. Attempting traceback.
Jun 11 15:22:42 rl9test1 bareos-fd[5532]: exepath=/usr/sbin/
Jun 11 15:22:42 rl9test1 bareos-fd[5580]: Calling: /usr/sbin/btraceback /usr/sbin/bareos-fd 5532 /var/lib/bareos
Jun 11 15:22:47 rl9test1 bareos-fd[5532]: It looks like the traceback worked...
Jun 11 15:22:47 rl9test1 bareos-fd[5532]: Dumping: /var/lib/bareos/rl9test1.ovirt1.bareos.test-fd.5532.bactrace

Environment

- OS: `Rocky Linux 9.6`
- component:

Relevant log output

11-Jun 15:22 bareos-dir JobId 973: Version: 25.0.0~pre593.eec5ac8ed (10 June 2025) Red Hat Enterprise Linux release 9.6 (Plow)
11-Jun 15:22 bareos-dir JobId 973: Start Backup JobId 973, Job=v8dc1_templates-bak.deb12-template_Job.2025-06-11_15.22.39_13
11-Jun 15:22 bareos-dir JobId 973: Connected Storage daemon at rl9test1.ovirt1.bareos.test:9103, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
11-Jun 15:22 bareos-dir JobId 973:  Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
11-Jun 15:22 bareos-dir JobId 973: Connected Client: bareos-fd at localhost:9102, encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
11-Jun 15:22 bareos-dir JobId 973:  Handshake: Immediate TLS 
11-Jun 15:22 bareos-dir JobId 973:  Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
11-Jun 15:22 bareos-dir JobId 973: Fatal error: lib/tls_openssl_private.cc:336 TLS read/write failure.: ERR=error:0A000126:SSL routines::unexpected eof while reading
11-Jun 15:22 bareos-dir JobId 973: Fatal error: Socket error on RestoreObject command: ERR=No data available
11-Jun 15:22 bareos-dir JobId 973: Fatal error: RestoreObject failed.
11-Jun 15:22 bareos-dir JobId 973: Fatal error: Network error with FD during Backup: ERR=No data available
11-Jun 15:23 bareos-dir JobId 973: Fatal error: No Job status returned from FD.
11-Jun 15:23 bareos-dir JobId 973: Error: Bareos bareos-dir 25.0.0~pre593.eec5ac8ed (10Jun25):
  Build OS:               Red Hat Enterprise Linux release 9.6 (Plow)
  JobId:                  973
  Job:                    v8dc1_templates-bak.deb12-template_Job.2025-06-11_15.22.39_13
  Backup Level:           Incremental, since=2025-06-11 15:16:31
  Client:                 "bareos-fd" 25.0.0~pre593.eec5ac8ed (10Jun25) Red Hat Enterprise Linux release 9.6 (Plow),redhat
  FileSet:                "v8dc1_templates-bak.deb12-template_FileSet" 2025-03-17 19:59:14
  Pool:                   "VM-OneHour-Dedup" (From Job resource)
  Catalog:                "MyCatalog" (From Client resource)
  Storage:                "DedupFile1" (From Pool resource)
  Scheduled time:         11-Jun-2025 15:22:39
  Start time:             11-Jun-2025 15:22:41
  End time:               11-Jun-2025 15:23:23
  Elapsed time:           42 secs
  Priority:               10
  Allow Mixed Priority:   no
  FD Files Written:       0
  SD Files Written:       0
  FD Bytes Written:       0 (0 B)
  SD Bytes Written:       0 (0 B)
  Rate:                   0.0 KB/s
  Software Compression:   None
  VSS:                    no
  Encryption:             no
  Accurate:               no
  Volume name(s):         
  Volume Session Id:      3
  Volume Session Time:    1749647678
  Last Volume Bytes:      0 (0 B)
  Non-fatal FD errors:    1
  SD Errors:              0
  FD termination status:  Error
  SD termination status:  
  FD  Secure Erase Cmd:   (null)
  Bareos binary info:     Bareos pre-release (UNSUPPORTED): Get professional support from https://www.bareos.com
  Job triggered by:       User
  Termination:            *** Backup Error ***

Relevant traces output

11-Jun-2025 15:22:42.086327 rl9test1.ovirt1.bareos.test-fd (100): module/bareosfd.cc:1422-973 python3-fd.so: python3-fd-mod: ROP.object_name(<class 'str'>): /VMS/v8dc1/templates-bak/deb12-template/[esxi3-ds1] deb12-template/deb12-template.vmdk
11-Jun-2025 15:22:42.086342 rl9test1.ovirt1.bareos.test-fd (100): module/bareosfd.cc:1422-973 python3-fd.so: python3-fd-mod: ROP.plugin_name(<class 'str'>): python:module_name=bareos-fd-vmware:config_file=/etc/bareos/vmware.d/VMware-esxi1vc.ovirt1.bareos.test-administrator_at_vsphere.local.ini:dc=v8dc1:folder=/templates-bak:vmname=deb12-template
11-Jun-2025 15:22:42.086362 rl9test1.ovirt1.bareos.test-fd (100): module/bareosfd.cc:1422-973 python3-fd.so: python3-fd-mod: ROP.object_len(<class 'int'>): 583
11-Jun-2025 15:22:42.086376 rl9test1.ovirt1.bareos.test-fd (100): module/bareosfd.cc:1422-973 python3-fd.so: python3-fd-mod: ROP.object_full_len(<class 'int'>): 583
11-Jun-2025 15:22:42.086396 rl9test1.ovirt1.bareos.test-fd (100): module/bareosfd.cc:1422-973 python3-fd.so: python3-fd-mod: ROP.object(<class 'bytearray'>): bytearray(b'{"ConnParams": {"VmMoRef": "moref=vm-166011", "VsphereHostName": "esxi1vc.ovirt1.bareos.test", "VsphereUsername": "administrator@vsphere.local", "VspherePassword": "secretpassword", "VsphereThumbPrint": "7B:32:9A:67:2F:46:AB:52:39:01:8F:84:1E:71:2D:88:D5:D4:8D:6D", "VsphereSnapshotMoRef": "snapshot-166070"}, "DiskParams": {"diskPath": "[esxi3-ds1] deb12-template/deb12-template.vmdk", "diskPathRoot": "[esxi3-ds1] deb12-template/deb12-template.vmdk", "changeId": "52 79 4f 07 13 e8 ba eb-8d 0e a1 2b 3d ae 6e 1e/24"}, "DiskChangeInfo": {"startOffset": 0, "length": 17179869184}}')
11-Jun-2025 15:22:42.086502 rl9test1.ovirt1.bareos.test-fd (100): filed/dir_cmd.cc:1159-973 Send: 2000 OK ObjectRestored
11-Jun-2025 15:22:42.086549 rl9test1.ovirt1.bareos.test-fd (100): filed/dir_cmd.cc:441-973 <dird: restoreobject end

11-Jun-2025 15:22:42.086567 rl9test1.ovirt1.bareos.test-fd (100): filed/dir_cmd.cc:460-973 Executing restoreobject command.
11-Jun-2025 15:22:42.086578 rl9test1.ovirt1.bareos.test-fd (100): filed/dir_cmd.cc:1059-973 Enter restoreobject_cmd: restoreobject end
11-Jun-2025 15:22:42.086589 rl9test1.ovirt1.bareos.test-fd (150): filed/fd_plugins.cc:526-973 plugin_ctx=0x7f50840497e0 JobId=973
11-Jun-2025 15:22:42.086599 rl9test1.ovirt1.bareos.test-fd (150): filed/fd_plugins.cc:304-973 IsEventForThisPlugin? name=(null) len=0 plugin=bpipe-fd.so plen=5
11-Jun-2025 15:22:42.086606 rl9test1.ovirt1.bareos.test-fd (150): filed/fd_plugins.cc:236-973 Event 15 disabled for this plugin.
11-Jun-2025 15:22:42.086612 rl9test1.ovirt1.bareos.test-fd (150): filed/fd_plugins.cc:304-973 IsEventForThisPlugin? name=(null) len=0 plugin=python3-fd.so plen=7
11-Jun-2025 15:22:42.086619 rl9test1.ovirt1.bareos.test-fd (150): filed/fd_plugins.cc:304-973 IsEventForThisPlugin? name=(null) len=0 plugin=grpc-fd.so plen=4
11-Jun-2025 15:22:42.088574 rl9test1.ovirt1.bareos.test-fd (300): lib/signal.cc:172-973 Working=/var/lib/bareos
11-Jun-2025 15:22:42.088609 rl9test1.ovirt1.bareos.test-fd (300): lib/signal.cc:173-973 btpath=/usr/sbin/btraceback
11-Jun-2025 15:22:42.088624 rl9test1.ovirt1.bareos.test-fd (300): lib/signal.cc:174-973 exepath=/usr/sbin/bareos-fd
11-Jun-2025 15:22:42.089636 rl9test1.ovirt1.bareos.test-fd (500): lib/signal.cc:202-973 Doing waitpid
11-Jun-2025 15:22:47.579647 rl9test1.ovirt1.bareos.test-fd (500): lib/signal.cc:204-973 Done waitpid

Anything else?

One part of the problem is that specifying the Plugin Names argument without double quotes is silently ignored, it behaves like omitting Plugin Names at all, resulting in loading all plugins:

[root@rl9test1 ~]# cat /etc/bareos/bareos-fd.d/client/myself.conf
Client {
  Name = rl9test1.ovirt1.bareos.test-fd
  Plugin Directory = "/usr/lib64/bareos/plugins"
  Plugin Names = grpc
}
[root@rl9test1 ~]# systemctl restart bareos-fd
[root@rl9test1 ~]# 
[root@rl9test1 ~]# echo "status client=bareos-fd" | bconsole
Connecting to Director localhost:9101
 Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
1000 OK: bareos-dir Version: 25.0.0~pre593.eec5ac8ed (10 June 2025)
Bareos pre-release (UNSUPPORTED).
Get professional support from https://www.bareos.com
You are connected using the default console

Enter a period (.) to cancel a command.
status client=bareos-fd
Connecting to Client bareos-fd at localhost:9102
 Handshake: Immediate TLS, Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3

rl9test1.ovirt1.bareos.test-fd Version: 25.0.0~pre593.eec5ac8ed (10 June 2025)  Red Hat Enterprise Linux release 9.6 (Plow)
Daemon started 11-Jun-25 17:12. Jobs: run=0 running=0, Bareos pre-release binary
 Sizeof: boffset_t=8 size_t=8 debug=0 trace=0 bwlimit=0kB/s
Plugin Info:
 Plugin     : bpipe-fd.so
 Description: Bareos Pipe File Daemon Plugin
 Version    : 2 (January 2014)
 Author     : Kern Sibbald
 License    : Bareos AGPLv3
 Usage      : bpipe:file=<filepath>:reader=<readprogram>:writer=<writeprogram>
 readprogram runs on backup and its stdout is saved
 writeprogram runs on restore and gets restored data into stdin
 the data is internally stored as filepath (e.g. mybackup/backup1)

 Plugin     : python3-fd.so
 Description: Python File Daemon Plugin
 Version    : 4 (May 2020)
 Author     : Bareos GmbH & Co. KG
 License    : Bareos AGPLv3
 Usage      : python3:module_name=<python-module-to-load>:module_path=<path-to-python-modules>:...

  module_name: The name of the Python module.
  module_path: Python search path for the module.
               The path '/usr/lib64/bareos/plugins' is always checked for modules.
  Additional parameters are plugin specific.

 Plugin     : grpc-fd.so
 Description: This plugin is a shim that allows you to run separate programs as bareos plugins by the use of a grpc interface.
 Version    : 0.1.0 (September 2024)
 Author     : Sebastian Sura
 License    : Bareos AGPLv3
 Usage      : grpc:<grpc executable>:...
Additional paramenters are parsed by the executable instead.
EXAMPLE grpc:grpc-test-module:file=/my/file



Running Jobs:
bareos-dir (director) connected at: 11-Jun-25 17:12
No Jobs running.
====
...

The other problem seems to be that grpc fallback doesn't work when both python and grpc are loaded (see https://docs.bareos.org/TasksAndConcepts/Plugins.html#grpc-fallback for details about grpc fallback).

Metadata

Metadata

Assignees

Labels

bugThis addresses a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions