Skip to content

Job finishes with warning if file list is taken by pipe from script

Summary

Reproducibility Platform OS OS Version Product Version
always AMD64 CentOS 8 15.0-current

Description

Hello Eric,

Thanks for fixing #2737 (closed).

While I was trying this fix, I found something different. I mean that this Fileset with a script that returns paths to backup causes warning in the job log:

Fileset {
  Name = "FILE backup"
  Include {
    File = "\\|/tmp/list/files.sh"
  }
}
# ls -l /tmp/list/files.sh 
-rwxr-xr-x. 1 root root 132 12-04 10:27 /tmp/list/files.sh
localhost-dir JobId 308: Start Backup JobId 308, Job=FILE_backup_1.2024-12-04_10.36.49_50
localhost-dir JobId 308: Connected to Storage "File1" at 10.0.0.134:9103 with TLS
localhost-dir JobId 308: Using Device "FileChgr1-Dev1" to write.
localhost-dir JobId 308: Connected to Client "localhost-fd" at localhost:9102 without encryption
localhost-fd JobId 308: Connected to Storage at 10.0.0.134:9103 without encryption
localhost-sd JobId 308: Volume "Vol-0011" previously written, moving to end of data.
localhost-sd JobId 308: Ready to append to end of Volume "Vol-0011" size=3,424,492,244
localhost-fd JobId 308:      Could not stat "localhost-fd: bsys.c:2182-308 Enter: int check_open_fd()": ERR=Nie ma takiego pliku ani katalogu
localhost-sd JobId 308: Elapsed time=00:00:01, Transfer rate=910.5 K Bytes/second
localhost-sd JobId 308: Sending spooled attrs to the Director. Despooling 1,199 bytes ...
localhost-dir JobId 308: Bacula localhost-dir 15.0.2 (21Mar24):
  Build OS:               x86_64-redhat-linux-gnu-bacula redhat Oncilla)
  JobId:                  308
  Job:                    FILE_backup_1.2024-12-04_10.36.49_50
  Backup Level:           Full
  Client:                 "localhost-fd" 15.0.2 (21Mar24) x86_64-pc-linux-gnu,redhat,
  FileSet:                "FILE backup" 2024-12-04 10:29:29
  Pool:                   "File" (From Command input)
  Catalog:                "MyCatalog" (From Client resource)
  Storage:                "File1" (From Command input)
  Scheduled time:         04-gru-2024 10:36:49
  Start time:             04-gru-2024 10:36:51
  End time:               04-gru-2024 10:36:51
  Elapsed time:           1 sec
  Priority:               10
  FD Files Written:       8
  SD Files Written:       8
  FD Bytes Written:       909,774 (909.7 KB)
  SD Bytes Written:       910,525 (910.5 KB)
  Rate:                   909.8 KB/s
  Software Compression:   None
  Comm Line Compression:  90.6% 10.6:1
  Snapshot/VSS:           no
  Encryption:             no
  Accurate:               no
  Volume name(s):         Vol-0011
  Volume Session Id:      16
  Volume Session Time:    1733301910
  Last Volume Bytes:      3,425,404,087 (3.425 GB)
  Non-fatal FD errors:    1
  SD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Backup OK -- with warnings
localhost-dir JobId 308: Begin pruning Jobs older than 6 months .
localhost-dir JobId 308: No Jobs found to prune.
localhost-dir JobId 308: Begin pruning Files.
localhost-dir JobId 308: No Files found to prune.
localhost-dir JobId 308: End auto prune.

This Polish message "Nie ma takiego pliku ani katalogu" in English means "No such file or directory"

I think it is caused by Enter(0) call in bacula/lib/bsys.c in check_open_fd() function:

/* Check the FDs that are currently open */
static int check_open_fd()
{
#ifndef HAVE_WIN32
   int max_fd = 0;
   struct dirent *entry;
   DIR *dir = opendir(PROC_SELF_FD);
   if (!dir) {
      return -1;
   }
   Enter(0);

Without the Enter(0) call backups work fine.

Thanks in advance for your help with fixing it.

Best regards, Marcin

Steps to Reproduce

  1. Use script running with pipe in Fileset