How do I troubleshoot CUPS on NixOS?

Any ideas on what to do?

Haven’t been able to print from my NixOS machine to Xerox Phaser 6360DN network printer. The same printer works on Windows and Ubuntu 19.10, 20.04/10, 21.04/10, etc.

No success using both CUPS and the GNOME utility for setting up the printer. I’ve also had no success with either the text-only generic driver, the Xerox Phaser 6360DN PPD file, nor the associated GutenPrint driver.

Related configuration I’ve picked up from the Printing part of the Wiki is:

  # Enable CUPS to print documents.
  services.printing = {
    enable = true;
    drivers = [ pkgs.gutenprint ];
  };
  # This avahi config can be necessary to connect to network print servers.
  services.avahi = {
    enable = true;
    nssmdns = true;
  };

This CUPS error appears in journalctl every second:

Nov 04 12:32:21 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:22 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:31 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:32 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:41 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:42 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:51 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:32:52 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:33:01 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:33:02 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:33:11 x570-nixos cupsd[34782]: Expiring subscriptions...
Nov 04 12:33:12 x570-nixos cupsd[34782]: Expiring subscriptions...

There is also no printing-related packets in Wireshark when I attempt to print over the network.

1 Like

How do you connect to the printer? I’m not familiar with this printer but one of the issues may be that the protocol you specified when you configured it in cups isn’t actually supported or enabled. The conf should be in /etc/cups .
Another issue may be that the ppd calls a program to do a conversion that isn’t available or isn’t in the right path into your system. Try to open the ppd with a text editor and look for command executions.

1 Like

Thanks for the reply!

In CUPS I saw this after ~1 minute waiting for a test page to print:

"Unable to locate printer "XRX0000AAA1CEC3.local"."

I noticed a long and complicated URL in the printer’s “Connection” parameter:

dnssd://Phaser%206360DN%20(00%3A00%3Aaa%3Aa1%3Ace%3Ac3)._pdl-datastream._tcp.local/

After googling it I saw this was related to Avahi. I decided to remove this part of the configuration.nix file:

  # This avahi config can be necessary to connect to network print servers.
  services.avahi = {
    enable = true;
    nssmdns = true;
  };

After removal, nixos-rebuild switch, and re-adding the printer to CUPS, I was able to do a successful test print!

FWIW, the protocol this printer provides is both IPP over HTTP and AppSocket/JetDirect. I have it working with Jet/Direct, so the connection is simply:

socket://192.168.1.200:9100
1 Like