Sometimes printing is completed without printing

I have a Brother laser printer DCP-1612W and when I print some PDFs with images the job is flagged as completed even if nothing was printed (but the printer makes some noise). Printing the same from Ubuntu works fine.
In cups log I cannot find anything useful.

My print config:

{ config, pkgs, users, lib, ... }:
let
  ip = "192.168.1.4";
  model = "DCP-1612W";
in
{
  services.printing.enable = true;
  programs.system-config-printer.enable = true;
  hardware.sane.enable = true;
  services.avahi = {
    enable = true;
    nssmdns = true;
    openFirewall = true;
  };
  services.printing.drivers = with pkgs; [
    brlaser
  ];
  hardware.printers = {
    ensureDefaultPrinter = "Brother";
    ensurePrinters = [{
      name = "Brother";
      location = "cjase";
      description = "Brother ${model}";
      deviceUri = "ipp://${ip}/ipp";
      model = "drv:///brlaser.drv/br1600.ppd";
      ppdOptions = {
        PageSize = "A4";
      };
    }];
  };
  hardware.sane.brscan4 = {
    enable = true;
    netDevices = {
      cjase = { inherit model ip; };
    };
  };
}
journalctl --follow --unit=cups
Dec 06 21:24:31 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Adding start banner page "none".
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Queued on "Brother" by "dpd-".
Dec 06 21:24:31 PereBook cupsd[177160]: REQUEST localhost - - "POST /printers/Brother HTTP/1.1" 200 567 Create-Job successful-ok
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] File of type application/postscript queued by "dpd-".
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Adding end banner page "none".
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/gstopdf (PID 178823)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/pdftopdf (PID 178824)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/gstoraster (PID 178825)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/rastertobrlaser (PID 178826)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started backend /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/backend/ipp (PID 178827)
Dec 06 21:24:31 PereBook cupsd[177160]: REQUEST localhost - - "POST /printers/Brother HTTP/1.1" 200 3542310 Send-Document successful-ok
Dec 06 21:24:32 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:33 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:34 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:35 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:36 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:37 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:38 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:39 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:40 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:41 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:41 PereBook cupsd[177160]: Brother dpd- 95 [06/Dec/2023:21:24:41 +0100] total 1 1 localhost 2023.pdf A4 one-sided
Dec 06 21:24:41 PereBook cupsd[177160]: [Job 95] Job completed.
Dec 06 21:24:41 PereBook cupsd[177160]: Expiring subscriptions...

I’m not an expert on CUPS drivers, but I don’t see a br1600.ppd just a brlaser.ppd:

┬─[azazel@bean:~]─[22:11:28]─[G:=]
╰─>@ nix shell 'nixpkgs#brlaser'
Skipping application of 'ls' alias from 'bash' since it shares a name with an existing xonsh alias. Use "--overwrite-alias" option to apply it anyway. You may prevent this message with "--suppress-skip-message" or "$FOREIGN_ALIASES_SUPPRESS_SKIP_MESSAGE = True".
┬─[azazel@bean:~]─[22:11:39]─[G:=]
╰─>@ echo $PATH
[...]:/nix/store/7w6lyig8cdmrb59844r7z547m874b678-brlaser-6/bin:/home/azazel/bin:[...]
┬─[azazel@bean:~]─[22:12:24]─[G:=]
╰─>@ ll /nix/store/7w6lyig8cdmrb59844r7z547m874b678-brlaser-6/
totale 0
dr-xr-xr-x 1 root root 8  1 gen  1970 lib
dr-xr-xr-x 1 root root 8  1 gen  1970 share
┬─[azazel@bean:~]─[22:12:28]─[G:=]
╰─>@  /nix/store/7w6lyig8cdmrb59844r7z547m874b678-brlaser-6/lib/cups/filter/rastertobrlaser
INFO: brlaser version 6
ERROR: rastertobrlaser job-id user title copies options [file]
INFO: This program is a CUPS filter. It is not intended to be run manually.
┬─[azazel@bean:~]─[22:16:39]─[G:=]
╰─>@ tree  /nix/store/7w6lyig8cdmrb59844r7z547m874b678-brlaser-6/share/cups
/nix/store/7w6lyig8cdmrb59844r7z547m874b678-brlaser-6/share/cups
└── drv
    └── brlaser.drv

I have it:

https://search.nixos.org/options?channel=23.11&show=hardware.printers.ensurePrinters.*.model&from=0&size=50&sort=relevance&type=packages&query=ensureprinters

❯ lpinfo -m
drv:///brlaser.drv/br1510.ppd Brother DCP-1510 series, using brlaser v6
drv:///brlaser.drv/br1600.ppd Brother DCP-1600 series, using brlaser v6
drv:///brlaser.drv/br7030.ppd Brother DCP-7030, using brlaser v6
drv:///brlaser.drv/br7040.ppd Brother DCP-7040, using brlaser v6
drv:///brlaser.drv/br7055.ppd Brother DCP-7055, using brlaser v6
drv:///brlaser.drv/br7055w.ppd Brother DCP-7055W, using brlaser v6
drv:///brlaser.drv/br7060d.ppd Brother DCP-7060D, using brlaser v6
drv:///brlaser.drv/br7065dn.ppd Brother DCP-7065DN, using brlaser v6
drv:///brlaser.drv/br7080.ppd Brother DCP-7080, using brlaser v6
drv:///brlaser.drv/br7080d.ppd Brother DCP-7080D, using brlaser v6
drv:///brlaser.drv/brl2500d.ppd Brother DCP-L2500D series, using brlaser v6
drv:///brlaser.drv/brl2520d.ppd Brother DCP-L2520D series, using brlaser v6
drv:///brlaser.drv/brl2540.ppd Brother DCP-L2540DW series, using brlaser v6
drv:///brlaser.drv/br1110.ppd Brother HL-1110 series, using brlaser v6
drv:///brlaser.drv/br1200.ppd Brother HL-1200 series, using brlaser v6
drv:///brlaser.drv/br2030.ppd Brother HL-2030 series, using brlaser v6
drv:///brlaser.drv/br2140.ppd Brother HL-2140 series, using brlaser v6
drv:///brlaser.drv/br2220.ppd Brother HL-2220 series, using brlaser v6
drv:///brlaser.drv/br2270dw.ppd Brother HL-2270DW series, using brlaser v6
drv:///brlaser.drv/br5030.ppd Brother HL-5030 series, using brlaser v6
drv:///brlaser.drv/brl2300d.ppd Brother HL-L2300D series, using brlaser v6
drv:///brlaser.drv/brl2320d.ppd Brother HL-L2320D series, using brlaser v6
drv:///brlaser.drv/brl2340d.ppd Brother HL-L2340D series, using brlaser v6
drv:///brlaser.drv/brl2360d.ppd Brother HL-L2360D series, using brlaser v6
drv:///brlaser.drv/br1910w.ppd Brother MFC-1910W, using brlaser v6
drv:///brlaser.drv/br7240.ppd Brother MFC-7240, using brlaser v6
drv:///brlaser.drv/br7360n.ppd Brother MFC-7360N, using brlaser v6
drv:///brlaser.drv/br7365dn.ppd Brother MFC-7365DN, using brlaser v6
drv:///brlaser.drv/brl2710.ppd Brother MFC-L2710DW series, using brlaser v6
drv:///sample.drv/dymo.ppd DYMO Label Printer
drv:///sample.drv/epson9.ppd Epson 9-Pin Series
drv:///sample.drv/epson24.ppd Epson 24-Pin Series
drv:///generic-brf.drv/gen-brf.ppd Generic Braille embosser, 1.0
drv:///cupsfilters.drv/pwgrast.ppd Generic IPP Everywhere Printer
drv:///sample.drv/generpcl.ppd Generic PCL Laser Printer
drv:///sample.drv/generic.ppd Generic PostScript Printer
drv:///cupsfilters.drv/textonly.ppd Generic Text-Only Printer
drv:///generic-ubrl.drv/gen-ubrl.ppd Generic UBRL generator, 1.0
drv:///cupsfilters.drv/dsgnjt600pcl.ppd HP DesignJet 600 pcl, 1.0
drv:///cupsfilters.drv/dsgnjt750cpcl.ppd HP DesignJet 750c pcl, 1.0
drv:///cupsfilters.drv/dsgnjt1050cpcl.ppd HP DesignJet 1050c pcl, 1.0
drv:///cupsfilters.drv/dsgnjt4000pcl.ppd HP DesignJet 4000 pcl, 1.0
drv:///cupsfilters.drv/dsgnjtt790pcl.ppd HP DesignJet T790 pcl, 1.0
drv:///cupsfilters.drv/dsgnjtt1100pcl.ppd HP DesignJet T1100 pcl, 1.0
drv:///sample.drv/deskjet.ppd HP DeskJet Series
drv:///sample.drv/laserjet.ppd HP LaserJet Series PCL 4/5
drv:///indexv3.drv/i4waves3.ppd Index 4-Waves PRO, 1.0
drv:///indexv3.drv/i4x4pro3.ppd Index 4x4 PRO V3, 1.0
drv:///indexv3.drv/ibasicd3.ppd Index Basic-D V3, 1.0
drv:///indexv4.drv/ibasicd4.ppd Index Basic-D V4/V5, 1.0
drv:///indexv3.drv/ibasics3.ppd Index Basic-S V3, 1.0
drv:///indexv4.drv/ibasics4.ppd Index Basic-S V4/V5, 1.0
drv:///indexv4.drv/ibrlbox4.ppd Index Braille Box V4/V5, 1.0
drv:///indexv3.drv/ieveres3.ppd Index Everest-D V3, 1.0
drv:///indexv4.drv/ieveres4.ppd Index Everest-D V4/V5, 1.0
drv:///sample.drv/intelbar.ppd Intellitech IntelliBar Label Printer, 2.4
drv:///sample.drv/okidata9.ppd Oki 9-Pin Series
drv:///sample.drv/okidat24.ppd Oki 24-Pin Series
raw Raw Queue
drv:///sample.drv/zebracpl.ppd Zebra CPCL Label Printer
drv:///sample.drv/zebraep1.ppd Zebra EPL1 Label Printer
drv:///sample.drv/zebraep2.ppd Zebra EPL2 Label Printer
drv:///sample.drv/zebra.ppd Zebra ZPL Label Printer
everywhere IPP Everywhere

As stated here the problem is that brlaser is not updated. Using a fork it now works:

{ config, pkgs, ... }:
let
  # Using Owl-Maintain fork, which addresses issues printing large graphicals documents.
  #   - https://github.com/pdewacht/brlaser/issues/40
  #   - https://github.com/pdewacht/brlaser/issues/52
  #   - https://github.com/pdewacht/brlaser/issues/95
  brlaser-master = pkgs.brlaser.overrideAttrs (finalAttrs: previousAttrs: {
    src = pkgs.fetchFromGitHub {
      owner = "Owl-Maintain";
      repo = "brlaser";
      rev = "bfaf936bf46f7d3a8a993352fbbb9615b4fc532a";
      sha256 = "d5pS75Z7iUaw8qo4U6tqsZR7IJa/PJzJUApz/27elaM=";
    };
  });
in
{
  services.printing.drivers = [ brlaser-master ];
}
1 Like