> I also get an email saying "24-Feb 21:46 bacula-dir JobId 0: Loaded
plugin: ldap-dir.so”. Backups are running normally with no errors and
normal completion emails (Bacula-v15/Debian-Bookworm compiled from source).

That's pretty interesting. Are you using ldap?
https://docs.baculasystems.com/BEDedicatedBackupSolutions/Applications/OnPremise/ldap/index.html
That link says:
"The *Plugin Directory* directive of the *File Daemon* resource in
/opt/bacula/etc/bacula-fd.conf must point to where the ldap-fd.so or
msad-fd.so plugin files are installed. The standard Bacula plugin directory
is /opt/bacula/plugins"

I found the following in the bacula 15.x manual online, from the section
'new features for 13.0'
https://www.bacula.org/15.0.x-manuals/en/main/New_Features_in_13_0_0.html#SECTION003040000000000000000
It mentions build time options involving ldap, and provides a sample
'console {}' block defining the ldap options.

I grepped one of my bacula.log files and found a number of "JobId 0:"
messages. They all appeared to be informational, stuff like recycling
volumes (far fewer messages like this than I have recycled volumes, so
jobid 0 messages that also result in recycling volumes must be an unusual
condition), cancelling duplicate jobs (a feature I turned on), upgrading to
a full backup, fileset changes necessitating a new full backup, etc.

Perhaps that information is useful to you if you want to look into the ldap
message further. I would suspect that the ldap message is not indicative of
an issue, except you might be annoyed with spurious informational only
emails. Maybe your messages block could be adjusted to exclude messages
like this, if it bothers you. I guess you could also filter the messages at
your email client.

One of my systems runs bacula 15.x from the bacula CE repo on rocky linux
9. I grepped my bacula.log, and no mentions of ldap there. I guess the
plugin wasn't included by default, at least.

I use Bill A's updated baculabackupreport script. It gives status for jobs
during the last x hours. It also indicates if the jobs had any issues by
putting a green, yellow, or red emoji in the subject line. Very handy. I
just ignore reports with a green emoji. Less email to read makes me happy.
You'll still need postfix to send the report emails if you go that way. The
script doesn't do SSL or any OAUTH stuff.
I have a daily cron job that launches a little bash script to generate the
relevant reports.
https://github.com/waa/baculabackupreport


>bacula@m910q:/home/chrisw$ /opt/bacula/bin/bacula-dir -t
...
>bacula-dir: smartall.c:418-0 Orphaned buffer: bacula-dir 32 bytes at
560cf70c0eb8 from watchdog.c:90
>bacula-dir: smartall.c:418-0 Orphaned buffer: bacula-dir 32 bytes at
560cf70c0518 from watchdog.c:91


I found this really old manual page. Looks like you have a couple tiny
memory leaks. I don't think the below link will be really helpful except to
explain what those messages are talking about.
https://bacula.org/2.4.x-manuals/en/developers/Smart_Memory_Allocatio_With.html
In the 15.x manual, the only modern reference to 'smartalloc' is a compile
time option (which you want to leave enabled).

I found this 10 year old bareos bug report complaining about very similar
messages (the memory leak is smaller). They say it's just a heartbeat and
that they might fix it later. Maybe related?
https://web.archive.org/web/20191117170225/https://bugs.bareos.org/view.php?id=535

>chrisw@m910q:~$ ls -l /opt/bacula/working/
>...
>-rw-r--r-- 1 bacula bacula    60 Feb 23 20:30 bacula-dir.bacula-dir.
*1914724472.mail*

>bacula@m910q:/home/chrisw$ /opt/bacula/bin/bacula-dir -t
>bacula-dir: bsys.c:161-0 Safe_unlink excluded:
/opt/bacula/working/bacula-dir.bacula-dir.-*150400904.mail*

This is interesting. I only realized today that the mail file seen in
bacula's working dir was different than the one complained about by the
bacula-dir config check. I wonder if the file you originally saw in your
working directory has disappeared or changed. Maybe it is eventually
processed? I also wonder if the contents of the mail file(s) found in the
working directory are found in any email (in other words, did we prove this
specific mail message was eventually sent?).

Hope this helps.

Regards,
Robert Gerber
402-237-8692
[email protected]


On Wed, Feb 25, 2026 at 5:18 PM Chris Wilkinson <[email protected]>
wrote:

>
>
> -Chris-
>
> On Wed, 25 Feb 2026, 00:22 Rob Gerber, <[email protected]> wrote:
>
>> > I also get an email saying "24-Feb 21:46 bacula-dir JobId 0: Loaded
>> plugin: ldap-dir.so”.
>>
>> If a runscript stanza runs as 'console' instead of using 'command' to run
>> an actual script file, the resulting bacula log entries will be associated
>> with 'jobid 0'. I'd check your bacula director configuration for any
>> instance of the word 'console'.
>> 'grep -i console /opt/bacula/etc/bacula-dir.conf'
>> Look for lines like 'console = some bconsole command'
>>
>
> I use command= <script.sh> in all the Runscript blocks, so not that.
>
>>
>> Bill A previously had these words to say about why it's better to put
>> your bconsole commands in a script that echos the command to bconsole, vs
>> using 'console ='.
>>
>> From Bill A's previous emails on this list:
>> "
>> *NOTE: I don't recommend using the `Console =` option in RunsScript{}
>> stanzas for a few reasons.
>>
>> - If you use `Console =`, any output from them appears mixed into your
>> bacula.log file, identified as `JobID: 0` so you never
>> know what job actually caused the outputs
>> - Using `Command =` you are able to fully control everything in a script.
>> - Any stdout in your script is printed in the Admin joblog that called
>> it. So you can add any output you like so your Admin
>> job log is quite verbose and you know everything that happened, and when.
>> (bconsole: ll joblog jobid=xxxx)
>> - If you use `Console =` you cannot get the outputs from the above
>> bconsole
>>  command
>> "
>>
>> The alternative to 'console = some bconsole command' is to echo the
>> desired command to bconsole.
>>
>> In some cases you can get away with `echo "this is my command" |
>> bconsole` though for a script you should define things like the bconsole
>> binary path, and the bconsole config location.
>>
>> Additionally, you can use echo to pass newlines through to bconsole, and
>> thus step through an interactive bconsole menu.
>>
>> See example from Bill A below:
>> "
>> Example script to call with the `Command =` setting in your RunScript:
>> ----8<----
>> #!/bin/bash
>>
>> bcbin="/opt/bacula/bin/bconsole"
>> bccfg="/opt/bacula/etc/bconsole.conf"
>>
>> echo "Whatever you want to appear in Admin joblog"
>> echo -e "your bconsole command\nquit\n" | ${bcbin} -c ${bccfg}   # All
>> output will be in your Admin Job's joblog
>> echo "Whatever else you want to appear in Admin joblog"
>> ----8<----
>> "
>>
>> I THINK Bill has previously asserted that it's better to 'quit' your
>> bconsole sessions after entering commands. I'm fuzzy on the reason, but I
>> think it was something like 'if you don't quit your bconsole sessions,
>> they'll stay resident in the background', or something like that. I could
>> be hallucinating all of this. Don't blame Bill if I'm misremembering. IIRC,
>> others asserted that this wasn't current bacula behavior. Either way, you
>> can see how this could be useful, especially if you needed to provide
>> multiple stages of input.
>>
>> Martin S has warned that echo commands and shell behavior varies,
>> particularly around handling of newlines. Some echo's don't have -e. Some
>> shells directly handle \n, others don't. Test the echo command I gave and
>> make sure it works for you. Or try printf (I have no experience there, but
>> martin suggested it).
>>
>> >chrisw@m910q:~$ bacula-dir -t
>> >24-Feb 21:46  Message delivery ERROR: Msg delivery error: fopen
>> /opt/bacula/working/bacula-dir.bacula-dir.-1616568216.mail failed:
>> ERR=Permission denied
>> >24-Feb 21:46  Message delivery ERROR: fopen /var/log/bacula/bacula.log
>> failed: ERR=Permission denied
>>
>> Those errors make sense, at least.
>> Only user bacula can write to /opt/bacula/working. User chrisw is not
>> user bacula.
>> Members of group bacula, or 'others' cannot write to the
>> /opt/bacula/working directory.
>> > chrisw@m910q:~$ ls -l /opt/bacula/
>> ...
>> > drwxr-xr-x 2 bacula bacula 12288 Feb 24 06:15 working
>>
>> I'd guess similarly, user chrisw doesn't have write permission for
>> logfile /var/log/bacula/log/bacula.log.
>> On my systems, file bacula.log only allowes user bacula to write to the
>> log.
>> example:
>> [gerber@td-bacula ~]$ ls -l /opt/bacula/log/bacula.log
>> -rw-r--r--. 1 bacula bacula 51378289 Feb 24 16:01
>> /opt/bacula/log/bacula.log
>>
>> # I am curious to see the output of
>> id chrisw
>> # and
>> ls -l /var/log/bacula/log/bacula.log
>>
>
> chrisw@m910q:~$ id chrisw
> uid=1000(chrisw) gid=1000(chrisw)
> groups=1000(chrisw),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),106(netdev),111(bluetooth),113(lpadmin),116(scanner),993(docker)
>
> chrisw@m910q:~$ ls -l /var/log/bacula
> lrwxrwxrwx 1 root root 15 Mar 25 2024 /var/log/bacula -> /opt/bacula/log
>
> chrisw@m910q:~$ ls -l /opt/bacula/log/
> total 1032
> -rw-r--r-- 1 bacula bacula 357472 Feb 25 06:15 bacula.log
> -rw-r--r-- 1 bacula bacula 471377 Jan 31 06:15 bacula.log.1
> -rw-r--r-- 1 bacula bacula 185679 Dec 31 06:15 bacula.log.2
> -rw-r--r-- 1 bacula bacula 6211 Dec 22 22:45 bacula.log.3
> -rw-r--r-- 1 bacula bacula 246 Nov 25 13:48 bacula.log.4
> -rw-r--r-- 1 bacula bacula 7055 Feb 8 2025 bacula.log
>
> Ok so far I think
>
>>
>>
>> What happens if you either:
>>
>> # As root, order bacula-dir to run itself with user bacula, and group
>> bacula
>> sudo bacula-dir -t -u bacula -g bacula
>>
>
> This gives error 'sudo: bacula-dir: command not found'
>
> Or with full path
>
> chrisw@m910q:~$ sudo /opt/bacula/bin/bacula-dir -t -u bacula -g bacula
> bacula-dir: bsys.c:161-0 Safe_unlink excluded:
> /opt/bacula/working/bacula-dir.bacula-dir.1605382264.mail
> bacula-dir: smartall.c:418-0 Orphaned buffer: bacula-dir 32 bytes at
> 55d35fb707d8 from watchdog.c:90
> bacula-dir: smartall.c:418-0 Orphaned buffer: bacula-dir 32 bytes at
> 55d35fb7cc08 from watchdog.c:91
>
>>
>> # Or, as any user besides bacula, run:
>> sudo su bacula
>> # then as user bacula, run:
>> bacula-dir -t
>>
>
> chrisw@m910q:~$ sudo su bacula
>
> bacula@m910q:/home/chrisw$ /opt/bacula/bin/bacula-dir -t
> bacula-dir: bsys.c:161-0 Safe_unlink excluded:
> /opt/bacula/working/bacula-dir.bacula-dir.-150400904.mail
> bacula-dir: smartall.c:418-0 Orphaned buffer: bacula-dir 32 bytes at
> 560cf70c0eb8 from watchdog.c:90
> bacula-dir: smartall.c:418-0 Orphaned buffer: bacula-dir 32 bytes at
> 560cf70c0518 from watchdog.c:91
>
> So much the same as before. However the log write doesn't error since the
> user is now bacula.
>
> I suspect there's something wrong in my mail config but can't find it.
> Thanks for those suggestions, I'll keep digging. Mail is sent to
> root@localhost which Postfix picks up and relays to Gmail.
>
>
>
>> (for this second option, you might have to set a shell for user bacula,
>> if you've never become bacula before)
>>
>> As a reminder, *never run the director or SD as root* (or any other user
>> besides bacula) to avoid messing up permissions on PID and state files
>> The FD already runs as root. So 'sudo bacula-fd -t' is correct for it.
>>
>>
>> Robert Gerber
>> 402-237-8692
>> [email protected]
>>
>> On Tue, Feb 24, 2026, 4:20 PM Chris Wilkinson <[email protected]>
>> wrote:
>>
>>> Just recently I’ve been getting the following error in response to the
>>> check config command bacula-dir -t. I also get an email saying "24-Feb
>>> 21:46 bacula-dir JobId 0: Loaded plugin: ldap-dir.so”. Backups are running
>>> normally with no errors and normal completion emails
>>> (Bacula-v15/Debian-Bookworm compiled from source).
>>>
>>> <
>>> chrisw@m910q:~$ bacula-dir -t
>>> 24-Feb 21:46  Message delivery ERROR: Msg delivery error: fopen
>>> /opt/bacula/working/bacula-dir.bacula-dir.-1616568216.mail failed:
>>> ERR=Permission denied
>>> 24-Feb 21:46  Message delivery ERROR: fopen /var/log/bacula/bacula.log
>>> failed: ERR=Permission denied
>>> >
>>>
>>> DIR runs as bacula:bacula
>>>
>>> chrisw@m910q:~$ ls -l /opt/bacula/
>>> total 44
>>> drwxr-xr-x 2 root   root    4096 Nov  7  2024 bin
>>> drwxr-x--- 2 bacula bacula  4096 Dec 24 18:32 bsr
>>> drwxr-xr-x 7 bacula tape    4096 Feb 21 00:16 cache
>>> drwxr-xr-x 2 bacula bacula  4096 Feb 23 19:44 etc
>>> drwxr-xr-x 2 root   root    4096 Nov  9  2024 lib
>>> drwxr-xr-x 2 bacula bacula  4096 Feb  1 00:00 log
>>> drwxr-xr-x 2 root   root    4096 Nov  9  2024 plugins
>>> drwxr-xr-x 3 root   root    4096 Nov  7  2024 scripts
>>> drwxr-xr-x 2 bacula bacula 12288 Feb 24 06:15 working
>>>
>>> chrisw@m910q:~$ ls -l /opt/bacula/working/
>>> total 40
>>> -rw-r--r-- 1 bacula bacula   857 Jan  1 08:59 bacula.3513.traceback
>>> -rw-r----- 1 bacula bacula  2196 Feb 24 06:15 bacula-dir.9101.state
>>> -rw-r--r-- 1 bacula bacula    60 Feb 23 20:30
>>> bacula-dir.bacula-dir.1914724472.mail
>>> -rw-r----- 1 root   root    2196 Feb 24 06:15 bacula-fd.9102.state
>>> -rw-r----- 1 bacula tape       8 Feb 23 17:39 bacula-sd.9103.pid
>>> -rw-r----- 1 bacula tape    2196 Feb 24 06:15 bacula-sd.9103.state
>>> -rw------- 1 bacula bacula 13309 Feb 24 06:15 m910q-dir.conmsg
>>>
>>> The messages resource is more or less per manual.
>>>
>>> <
>>> Messages {
>>>   Name = "Standard"
>>>   MailCommand = "/opt/bacula/bin/bsmtp -h localhost -s \"Bacula %n\" %r"
>>>   OperatorCommand = "/opt/bacula/bin/bsmtp -h localhost -f \"\(Bacula\)
>>> %r\" -s \"Bacula: Intervention needed for Job:%n %j\" %r"
>>>   Syslog = All, !Skipped
>>>   Mail = root@localhost = All, !Skipped
>>>   Append = /var/log/bacula/bacula.log = All, !Skipped
>>>   Console = All, !Skipped
>>>   Operator = root@localhost = All, !Skipped
>>>   Catalog = All, !Skipped
>>> }
>>> >
>>>
>>> Similar commands for FD and SD run without error.
>>>
>>> I’m guessing that there is a permissions issue somewhere but I’m
>>> struggling to know where to look. Any suggestions would be great.
>>>
>>> Best
>>> -Chris-
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Bacula-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>>
>>
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to