Libki / libki-server

Libki Server
Other
55 stars 28 forks source link

Cups missing module from install script and can't see my printer name still. Please see logs. #344

Closed bradgillap closed 4 months ago

bradgillap commented 7 months ago

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:

[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.

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/

public_print_release: enabled cups: server: 192.168.1.88 # also tried localhost username: lp printers: monochrome: chroming: monochrome physical_printer_name: Brother_DCP-7065DN public_printer_name: monochrome plexing: simplex type: cups auto_release: yes

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.

kylemhall commented 7 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!