-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CUPS Printers not found in GTK applications #69559
Comments
Perhaps dbus is not started properly? My printers are showing up for firefox & evince when launched through plasma5. |
@matthewbauer thanks for the suggestion, unfortunately it didn't solve the issue for me. I just tried running sway with |
Some further information, I just rebooted into the last configuration I had for NixOS 19.09 on the unstable channel and printing is working again. So this seems to be related to the update to 20.03. Perhaps there was a GTK upgrade or something else major introduced in that time? |
#69434 Fixes this |
I am still experiencing the issue unfortunately :( Printers still do not show up in GTK applications (e.g. firefox, evince), even with #69434 . I am using i3 as my WM, is that relevant? |
@noneucat Can you paste Are you using the configuration mentioned in the issue? To get the proper info from DBus you can maybe do
while you interact with it for some info. The original report here said
|
@worldofpeace Yes -- no options appear in the print dialog for
I am not using the configuration listed in the original report. Relevant part of my config: services.printing.enable = true;
services.printing.browsing = true;
services.printing.drivers =
with pkgs; [
gutenprint
gutenprintBin
samsung-unified-linux-driver_1_00_36
];
services.samsung-unified-linux-driver_1_00_36.enable = true;
programs.system-config-printer.enable = true; System information:
No activity on DBus related to printing while I interact with it:
|
@wkral I'm seeing there's an |
@worldofpeace Yes my I left this issue open because the #69404 fixes haven't made their way into master yet as It might be more urgent for @noneucat but I've just been booting into my earlier config to print, it's not an everyday activity for me. |
@worldofpeace Sorry, I think I gave some bad information on Friday. I do see your fix included in master, I was in a detached head position on my repo from working on another issue and didn't realize. I did a rebuild against my local copy of
If you have any suggestions on how to diagnose the issue I'm happy to help I don't have a great deal of knowledge about the working of dbus, but I can run stuff on this configuration. As far as the declarative printers goes, I did notice that feature was recently merged as it came up while I was investigating this issue. It doesn't seem to affect printers set up by other means so I was hoping to give it a try after resolving this issue. |
Since 19.09 was released today I tried switching to that channel off of |
@worldofpeace thanks for pointing me to this issue from discourse. I'm trying to track this down. It seems cups support is enabled by default for Linux systems:
However, I've found this interesting Link: https://wiki.debian.org/CUPSDriverlessPrinting#CUPS_2.2.4_and_the_GTK_Print_Dialog @wkral do you use a driverless printer setup with cups? I get the following error in CUPS' web interface when adding a printer with a certain PPD file: The Arch wiki points that this issue is a cause of nss-mdns not configured properly. Although I'm rather sure nss-mdns is configured properly on my machine (as a proof, cups does find my network printer) this troubleshooting hint indicates the debian's wiki page statement:
Is correct. Anyway, I didn't figure out yet why / how editing services.printing.browsedConf = ''
CreateIPPPrinterQueues driverless
CreateRemoteCUPSPrinterQueues No
''; But it didn't make any difference. |
Update: I've found an evidence I'm not the only one experiencing the "Unable to copy PPD file" error: https://bbs.archlinux.org/viewtopic.php?pid=1861730#p1861730 On NixOS, I've managed to copy the ppd file from the store, Never mind that, this doesn't have to do anything with what printer driver / ppd is used.. The problem is that GTK isn't able to locate printers using DNS-SD. It doesn't even use CUPS at all. |
@wkral this issue bothers me sincerely. I have a strong suspicion this has to do something with dbus, as @matthewbauer has suggested. I'd be glad to compare our configurations - from |
@doronbehar I'll be available in a few hours, I gather our timezones are rather separated but maybe tonight for me tomorrow morning for you? |
@wkral the time fits for me now, I hope it's not too late for you. I'm available on Keybase, Telegram, and Riot as |
Just wanted to let you know that I have the very same problem. The list of printers in the printing dialogue turned empty with an update ( My current workaround is to always save stuff as PDF and use |
This is so annoying right?! @dpaetzel If you are interested, I'd be happy to try to debug this together with you, if the time fits. |
If it's of any help, you can find my current printing configuration here https://github.com/dpaetzel/nixos-config/blob/master/sokrates/configuration.nix#L88 . Sorry, the time currently does not fit :-/ Perhaps during the weekend sometime. |
While trying to investigate this, I've reached the conclusion that GTK doesn't use CUPS at all to find the printers, it uses dBus / avahi (or something like that) to find them. Therefor, I'm more interested in the following:
I'm addressing both of you @wkral and @dpaetzel , and whoever that's experiencing this issue as well. |
I do not have Avahi enabled.
Yes, I do. https://github.com/dpaetzel/nixos-config/blob/c176ad12eea6cffe8c7f032e17088b1e3618a169/xmonad.nix#L5
This variable is empty in a bare TTY. In my window environment (window manager: XMonad, display manager: lightdm) its value is:
I don't have that file. Thank you for your effort :) |
Thanks for the info. It seems that with either one of the following options:
set or unset, We get the same behavior of @matthewbauer What is the value of your |
Good news everyone! While investigating this issue in a non-Nix way, I've encountered many instructions such as this and this stating that this issue is related to gtk3's use of the cups libraries. This led me to the conclusion that the problem is with gtk's cups printing backend. These backends can be found here:
Their inclusion is controlled in Nix here: nixpkgs/pkgs/development/libraries/gtk/3.x.nix Lines 36 to 42 in 1739d34
Current GTK3 in master is not yet compiled by hydra so it may take a while until you'll see the update maybe improving something. Besides that, our version of cups is outdated for 2 weeks now (v2.3.0). While attempting to update cups through an overlay in my `I'm pretty sure that once cups 2.3.0 will be here and the gtk will be recompiled with it, the issue will be fixed 😌.~ EDIT: It seems that although upgrading these might help, a simple workaround in the meantime is explained in my next comment. |
I just ran into this issue as well, great that a fix appears to be imminent! For now I worked around it by printing from the
So there's a workaround? Can it be explained for 'mere mortal' users like me or should we rather just wait it out? |
My comments must be confusing.. Actually, now I see that while writing that previous comment, I haven't mentioned that I've also tried installing to my user environment
Firefox loads libraries dynamically and somehow it could found gtk3's printbackends only when gtk3 was explicitly installed in my user environment. That's why Firefox didn't even need a restart. Upgrading gtk3 or cups shouldn't make a difference. I'll edit my previous comment according to this new discovery. The question is, why doesn't Firefox find the gtk3's printbackends? This is one of those issues that would have never appear in a "Normal" FHS compatible distribution.. ccing @eelco @andir and @vcunat as you are the maintainers of Firefox and Evince - our example / showcase GTK3 based programs. Our task: Make these GTK applications (by wrapping / patching them) find GTK's printbackends. |
Well, I'm pretty new to NixOS, so that's probably on me ;)
Ah! Adding it to my |
Update: After reading
We need to add this variable to all of the shell wrappers that wrap GTK3 based programs. Somewhere around here: nixpkgs/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh Lines 18 to 23 in 1739d34
What do you think @worldofpeace ? |
Yes! Works for me as well! Thank you! |
@doronbehar We set
On my system |
I see. The problem is that if a certain user doesn't have modules enabled which somehow add nixpkgs/nixos/modules/services/x11/desktop-managers/gnome3.nix Lines 265 to 279 in 1739d34
Mate as well: nixpkgs/nixos/modules/services/x11/desktop-managers/mate.nix Lines 77 to 85 in 1739d34
Pantheon: nixpkgs/nixos/modules/services/x11/desktop-managers/pantheon.nix Lines 174 to 190 in 1739d34
Xfce: nixpkgs/nixos/modules/services/x11/desktop-managers/xfce4-14.nix Lines 51 to 54 in 1739d34
This is quite a dilemma... Even if the services Perhaps a new configuration to be named |
I was affected by this problem but with Chrome. The Chrome's print dialog listed my printer but cups didn't seem to receive the print job. If I opened the "system print dialog" from Chrome's print dialog, my printer wasn't listed. Everything seems to work if I add 'gtk3' to systemPackages. |
@doronbehar Yeah that was a bit too late for me last night. But I'm glad to see a lot of progress on identifying the issue. Thanks. Exploring the
But none of those directories exist. When adding the @worldofpeace To actually fix this issue, I would guess there are probably two ways to go about this. First, as @doronbehar pointed out most of the desktop environments add Second, it would seem that things that depend on Any advice on what would be the preferred way? Maybe there is still something missing to explain why things are working on |
I should have on optimal solution in a few days @wkral. And it works in |
Thanks, that's great news, looking forward to it. It seems that on my system |
This is one of those issues which always reminds me of #60260 |
Adding gtk3 fixes this issue for me, using xfce4 on unstable. |
This is from the documentation
We define |
So it turns out we were setting environment variables completely unnecessarily. |
Indeed, unsetting I'm sorry but I'm currently not able to build my complete system from master to test your specific commit (however, I cannot see why it would not work). |
Closing as I feel this is confirmed fixed. |
@worldofpeace I did a rebuild from head of master and can (I guess double) confirm the fix. Thanks very much. |
Nice job, thank you very much! 🙂 |
GTK_EXE_PREFIX is not set in my case and I still dont see printers in evince |
Describe the bug
Printers which are configured and working in CUPS do not show up in the print dialog of GTK applications. Previously there was a Print to file (PDF) printer option which is no longer present. Notably Firefox and Evince are effected.
I am using Sway as my window manager which may be relevant, but printing worked previously.
I tested with Okular a QT application and it does still have all the printers available to it including print to file.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
See configured printers in the print dialog as well as the Print to File (PDF) option.
Additional context
Relevant sections of `/etc/nixos/configuration.nix:
Metadata
"x86_64-linux"
Linux 5.2.16, NixOS, 20.03pre193829.f0fec244ca3 (Markhor)
yes
yes
nix-env (Nix) 2.3
"nixos-20.03pre193829.f0fec244ca3"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: