Closed bradgillap closed 4 months ago
looking at the code, I think if you duplicate the value of physical_printer_name
to a key simply named name
that should fix the latest error. I've also pushed a fix to fall back to physical_printer_name
if name
isn't set so you could just update to the latest version of master as an alternative!
Describe the bug Can't get libki to send print jobs to cups. Cups can print, libki can't find the printer.
To Reproduce Steps to reproduce the behavior:
Installed libki with the debian install script from the manual from the documentation site.
setup as normal with cups printing
installed cups locally, setup user lp to be allowed to print, added a brother print
tested brother printer from the cups admin and
lp -d Brother_DCP-7065DN test.txt
works.after a lot of testing I finally noticed the first issue. It's worth noting the rest of the system is working as expected, clients can connect and print jobs get sent from client folders to the libki server and the file adds the ".printed" extension indicating the job arrived at libki at least.
[2024/01/05 19:41:28] [libki] [ERROR] Caught exception in Libki::Controller::Administration::API::PrintJob->release "Can't locate Net/CUPS.pm in @INC (you may need to install the Net::CUPS module) (@INC contains: /home/libki/libki-server/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 415."
I think this indicates Net::CUPS module is missing from the installer bash script.
sudo cpan
New log errors
[2024/01/05 19:48:02] [libki] [INFO] Libki::Utils::Printing::release print_job_id: 7, user: , new_printer: [2024/01/05 19:48:02] [libki] [FATAL] Use of uninitialized value $cups_printer_name in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 366. [2024/01/05 19:49:19] [libki] [FATAL] Use of uninitialized value in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 226. [2024/01/05 19:49:19] [libki] [FATAL] Use of uninitialized value in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 226. [2024/01/05 19:49:19] [libki] [INFO] Libki::Utils::Printing::release print_job_id: 7, user: , new_printer: [2024/01/05 19:49:20] [libki] [FATAL] Use of uninitialized value $cups_printer_name in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 366. [2024/01/05 19:52:16] [libki] [FATAL] Use of uninitialized value in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 226. [2024/01/05 19:52:16] [libki] [FATAL] Use of uninitialized value in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 226. [2024/01/05 19:52:16] [libki] [INFO] Libki::Utils::Printing::release print_job_id: 8, user: , new_printer: [2024/01/05 19:52:16] [libki] [FATAL] Use of uninitialized value $cups_printer_name in concatenation (.) or string at /home/libki/libki-server/lib/Libki/Utils/Printing.pm line 366.
Printer yaml config (note spacing is fine on mine, github is code isn't doing the spacing justice.)
yaml validates on https://www.yamllint.com/
Expected behavior Expected after setting up yaml, configuring authentication to allow the lp user to print that libkey would send jobs to the local cup service.
Also now receive an error it can't find the printer name on cups. Verified name by running
lpstat -p -d printer Brother_DCP-7065DN is idle. enabled since Fri 05 Jan 2024 07:38:42 PM system default destination: Brother_DCP-7065DN
Screenshots If applicable, add screenshots to help explain your problem.
Deployment architecture:
Desktop (please complete the following information):
Additional context
I don't know if the install script isn't installing everything needed for cups to work but I'm fairly certain this is a bug and not a configuration problem at this point. I'm not a programmer so, I think I've hit as far as I can take this.