Here is the error:
$ gpg --no-permission-warning --homedir A_HOMEDIR --recipient A_RECIPIENT --multifile --encrypt <A_FILE_CONTAINING_THOUSANDS_OF_FILENAMES gpg: encryption of 'A_FILENAME' failed: Too many open files
Translation: ask gpg to encrypt thousands of files by using --multiple
and feeding them from stdin, and gpg runs out of file handles.
Evidently someone didn't close() the input file.
This occurred on Debian stretch, version 2.1.18. Same thing happens with 2.2.5. It didn't happen on Debian Jessie, 2.0.26.