Bug 2221364 - Problem to access printer the sharing via CUPS
Summary: Problem to access printer the sharing via CUPS
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 38
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-08 10:37 UTC by Mike
Modified: 2024-02-09 04:25 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-10-11 13:36:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Step 1 - Modify printer before added g-c-c (78.66 KB, image/png)
2023-07-21 22:32 UTC, Mike
no flags Details
Step 2 - Selected IPP Everywhere driver (88.55 KB, image/png)
2023-07-21 22:33 UTC, Mike
no flags Details
Step 3 - Apply new driver and he name changed (83.11 KB, image/png)
2023-07-21 22:34 UTC, Mike
no flags Details

Description Mike 2023-07-08 10:37:03 UTC
Incomprehensible behavior if i try shared my printer via CUPS.
I have old printer Xerox Phaser 3140 (https://bugzilla.redhat.com/show_bug.cgi?id=2012698)
I want make printer a shared in local network.
Through the SAMBA (https://bugzilla.redhat.com/show_bug.cgi?id=2216813) problem was not resolved.
Through the CUPS (selected shared printer)

Reproducible: Always

Steps to Reproduce:
My enviornment:
1. Printer Xerox
2. Laptop (Fedora Workstation 38)
3. miniPC (Fedora Server 38)

On miniPC added printer xerox_3140 and set him be public.
On Laptop if i open Printers my xerox_3140 appearse rigth now on name `Xerox_Phaser_3140_lxbox` where lxbox - name my miniPC. That's cool. And this printer working!

First Problem:
I don't have any settings printing (blank window) and info about have adress (null).
If i click on adress - opened URL http://%28null%29:631/

Second Problem:
If i try added priner via gnome observer i have new printer by name 3140. After added him will be have model HP Designjet T920 PostScript. Not clear
This printer have properties printing but not working if i change drivers.
Adress is localhost. Not clear

Third Problem:
For this sharing CUPS used avahi daemon.
This functionality shoud be provide ability printing with mobile devices.
My Android 10 not see printer via out of the box print service. My printer can saw only use app Mopria.
But if i add unit file into /etc/avahi/services/AirPrint-xerox-3140.service:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">AirPrint Xerox 3140 @ %h</name>
  <service>
    <type>_ipp._tcp</type>
    <subtype>_universal._sub._ipp._tcp</subtype>
    <port>631</port>
    <txt-record>txtvers=1</txt-record>
    <txt-record>qtotal=1</txt-record>
    <txt-record>Transparent=T</txt-record>
    <txt-record>URF=none</txt-record>
    <txt-record>rp=printers/xerox_3140</txt-record>
    <txt-record>note=Xerox Phaser 3140</txt-record>
    <txt-record>product=(GPL Ghostscript)</txt-record>
    <txt-record>printer-state=3</txt-record>
    <txt-record>printer-type=0x2900c</txt-record>
    <txt-record>pdl=application/octet-stream,application/pdf,application/postscript,application/vnd.cups-raster,image/gif,image/jpeg,image/png,image/tiff,image/urf,text/html,text/plain,application/vnd.adobe-reader-postscript,application/vnd.cups-pdf</txt-record>
  </service>
</service-group>

My printer available on Android fine, but not wirking.

This is method sharing simple to enable but have problems and create misunderstanding what doing around.
Needed more examples and explain.
How setting unit file for avahi i find only one example and not documentation.

Comment 1 Zdenek Dohnal 2023-07-13 15:26:07 UTC
Hi,

(In reply to Mike from comment #0)
> First Problem:
> I don't have any settings printing (blank window) and info about have adress
> (null).
> If i click on adress - opened URL http://%28null%29:631/

This is known issue https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1877 - you can see your printer settings in print dialog, when you are going to print.

> 
> Second Problem:
> If i try added priner via gnome observer i have new printer by name 3140.
> After added him will be have model HP Designjet T920 PostScript. Not clear
> This printer have properties printing but not working if i change drivers.
> Adress is localhost. Not clear

If there is no exact driver, daemon which does this will assign the closest similar driver, which might not work if the difference is too big.

> 
> Third Problem:
> For this sharing CUPS used avahi daemon.
> This functionality shoud be provide ability printing with mobile devices.
> My Android 10 not see printer via out of the box print service. My printer
> can saw only use app Mopria.

Since the other laptop is able to see the device, IMO the phone does not support/have enabled mDNS support which is needed for seeing shared printers by CUPS. This would need an investigation on Android side to see why it ignores valid mDNS services.

*** This bug has been marked as a duplicate of bug 1765328 ***

Comment 2 Mike 2023-07-13 18:01:51 UTC
I have misunderstood the sharing printer via CUPS.
If i enable sharing in CUPS, that mean will be used IPP and mDNS protocols.

In my Fedora Workstation 38 when i open Prints in Settings i have already ready to work printer without manually added printer by name Xerox_Phaser_3140_<server name>
I expect if i try added new printer i see same Xerox_Phaser_3140_<server name> printer, but i see 3140.
Where is who?
Where ipp printer? Where mDNS printer?

Second my misunderstood why 3140 don't printing if i set right drivers?

Comment 3 Zdenek Dohnal 2023-07-14 08:59:17 UTC
(In reply to Mike from comment #2)
> I have misunderstood the sharing printer via CUPS.
> If i enable sharing in CUPS, that mean will be used IPP and mDNS protocols.

To be precise mDNS helps with discovery (any local machine can see there is a printer and can get the connection data from the service txt) and IPP does the communication - the Android client has to support both to work correctly without any configuration.

> 
> In my Fedora Workstation 38 when i open Prints in Settings i have already
> ready to work printer without manually added printer by name
> Xerox_Phaser_3140_<server name>
> I expect if i try added new printer i see same Xerox_Phaser_3140_<server
> name> printer, but i see 3140.

What is reported by 'lpstat -e'?

gnome control center gets the printer names the same way as this command, so the names should be similar (unless g-c-c does additional operations with them).

My output is:

Server:
# lpstat -a
xerox_4310 accepting requests since Fri 14 Jul 2023 08:44:09 AM UTC

Client (the queue from server is shared):
# avahi-browse -avrt
...
=   eth0 IPv4 xerox_4310 @ default-0                        _ipp._tcp            local
   hostname = [default-0.local]
   address = [192.168.122.46]
   port = [631]
   txt = ["printer-type=0x80304E" "Copies=T" "Color=T" "mopria-certified=1.3" "URF=V1.4,CP1,W8,PQ4,SRGB24,RS300,FN3" "TLS=1.2" "UUID=a0b4e49b-e925-36cc-7a85-292ca4e3f1e1" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(PostScript Printer)" "priority=0" "adminurl=https://default-0.local.:631/printers/xerox_4310" "ty=Generic PostScript Printer" "rp=printers/xerox_4310" "qtotal=1" "txtvers=1"]
=   eth0 IPv4 xerox_4310 @ default-0                        _ipps._tcp           local
   hostname = [default-0.local]
   address = [192.168.122.46]
   port = [631]
   txt = ["printer-type=0x80304E" "Copies=T" "Color=T" "mopria-certified=1.3" "URF=V1.4,CP1,W8,PQ4,SRGB24,RS300,FN3" "TLS=1.2" "UUID=a0b4e49b-e925-36cc-7a85-292ca4e3f1e1" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(PostScript Printer)" "priority=0" "adminurl=https://default-0.local.:631/printers/xerox_4310" "ty=Generic PostScript Printer" "rp=printers/xerox_4310" "qtotal=1" "txtvers=1"]
...

# lpstat -e
xerox_4310_default_0

, so it looks g-c-c changes the name.

> Second my misunderstood why 3140 don't printing if i set right drivers?

You apply the print driver twice - once on the client, then on the server, corrupting the file. You have to use 'everywhere' model (which gnome-control-center currently doesn't support) via CUPS Web UI/CLI, or use that automatically created printer (which is a temporary queue and works in print dialogs).

Comment 4 Mike 2023-07-19 07:08:40 UTC
On Server:
[root@lxbox ~]# lpstat -a
xerox_3140 accepting requests since Thu Jul 13 20:26:15 2023

On Client:
[root@blackknight ~]# avahi-browse -avrt
+ wlp0s20f3 IPv6 Xerox Phaser 3140 @ lxbox                     _ipps._tcp           local
+ wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _ipps._tcp           local
+ wlp0s20f3 IPv6 Xerox Phaser 3140 @ lxbox                     _ipp._tcp            local
+ wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _ipp._tcp            local
...
+ wlp0s20f3 IPv6 Xerox Phaser 3140 @ lxbox                     _printer._tcp        local
+ wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _printer._tcp        local
...
= wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _printer._tcp        local
   hostname = [lxbox.local]
   address = [192.168.0.102]
   port = [0]
   txt = []

root@blackknight ~]# lpstat -e
3140
Xerox_Phaser_3140_lxbox

_printer._tcp recognized gnome control center like as 3140 without port

Comment 5 Mike 2023-07-19 07:24:31 UTC
CUPS suggest only "HP Designjet T920 PostScript - IPP Everywhere ™"
Simple IPP Everywhere like as RHEL Documentation (step 9) https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/configuring_and_using_a_cups_printing_server/index#configuring-driverless-printing_configuring-printing
i have not. Maybe because the connection is written by dnssd?

Comment 6 Mike 2023-07-19 07:41:25 UTC
Ha ha. I don't understand how this working :-D.
I selected via CUPS Web UI driver "HP Designjet T920 PostScript - IPP Everywhere ™" -> Save preferences.
Now printer is worked and driver show - Phaser 3140, 2.0.0 - IPP Everywhere.
How? It's very don't obviously.

Now i have two worked printers shared via ipp(s) and DNS-SD - success!

Comment 7 Zdenek Dohnal 2023-07-19 10:56:27 UTC
(In reply to Mike from comment #4)
> On Client:
> [root@blackknight ~]# avahi-browse -avrt
> + wlp0s20f3 IPv6 Xerox Phaser 3140 @ lxbox                     _ipps._tcp   
> local
> + wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _ipps._tcp   
> local
> + wlp0s20f3 IPv6 Xerox Phaser 3140 @ lxbox                     _ipp._tcp    
> local
> + wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _ipp._tcp    
> local
> ...
> + wlp0s20f3 IPv6 Xerox Phaser 3140 @ lxbox                     _printer._tcp
> local
> + wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _printer._tcp
> local
> ...
> = wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox                     _printer._tcp
> local
>    hostname = [lxbox.local]
>    address = [192.168.0.102]
>    port = [0]
>    txt = []
> 
> root@blackknight ~]# lpstat -e
> 3140
> Xerox_Phaser_3140_lxbox

Ok, I would guess gnome-control-center wanted to use 'Xerox_Phase_3140_lxbox' as the name of found printer, but that is taken by temporary queue - so it uses an algorithm to come up with a different one.

(In reply to Mike from comment #5)
> CUPS suggest only "HP Designjet T920 PostScript - IPP Everywhere ™"
> Simple IPP Everywhere like as RHEL Documentation (step 9)
> https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/
> html-single/configuring_and_using_a_cups_printing_server/index#configuring-
> driverless-printing_configuring-printing
> i have not.

You should have 'Make: Generic' and there is a simple 'IPP Everywhere'.

Isn't that HP Designjet somewhere in your location? Based on the name it looks like a device/driver based on shared CUPS queue from a different server.

And where does CUPS suggest it? Can you upload screenshots?


(In reply to Mike from comment #6)
> I selected via CUPS Web UI driver "HP Designjet T920 PostScript - IPP
> Everywhere ™" -> Save preferences.

Can you give a screenshot? I don't recall we have a 'Save preferences' button.


Either way, you don't have to install the printer at all unless you want to share the printer further. The temporary queue found on client by mDNS works in common print dialogs.

Comment 8 Mike 2023-07-21 22:32:44 UTC
Created attachment 1976999 [details]
Step 1 - Modify printer before added g-c-c

Comment 9 Mike 2023-07-21 22:33:27 UTC
Created attachment 1977000 [details]
Step 2 - Selected IPP Everywhere driver

Comment 10 Mike 2023-07-21 22:34:13 UTC
Created attachment 1977001 [details]
Step 3 - Apply new driver and he name changed

Comment 11 Mike 2023-07-21 22:39:47 UTC
I attachment three screenshot.
I added via gnome control center new printer 3140.
After that i open CUPS in web UI (step 1)
Select Modify printer and try select the IPP Everywhere driver (step 2) - available only "HP Designjet T920 PostScript - IPP Everywhere ™"
Select "HP Designjet T920 PostScript - IPP Everywhere ™"
After apply changes i have new name driver (step 3)

Strange working CUPS

Comment 12 Mike 2023-07-21 22:55:50 UTC
I won the problem with sharing printer on Android devices via default print service.
Thanks Zdenek Dohnal your command: avahi-browse -avrt
If i enable sharing via CUPS i have next options in avahi:
= wlp0s20f3 IPv4 Xerox Phaser 3140 @ lxbox    _ipp._tcp    local
   hostname = [lxbox.local]
   address = [192.168.0.102]
   port = [631]
   txt = [
       "printer-type=0x3056"
       "Copies=T"
       "Duplex=T"
       "mopria-certified=1.3"
       "URF=V1.4,CP1,W8,PQ4,RS600,DM1,FN3"
       "TLS=1.2"
       "UUID=a5b76e05-8e0a-393e-6af4-af04d15ba686"
       "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf"
       "product=(Phaser 3140)"
       "priority=0"
       "note=\208\147\208\190\209\129\209\130\208\184\208\189\208\189\208\176\209\143"
       "adminurl=https://lxbox.local.:631/printers/xerox_3140"
       "ty=Xerox Phaser 3140, 2.0.0"
       "rp=printers/xerox_3140"
       "qtotal=1"
       "txtvers=1"
   ]
This configuration dont't work with default Android print server. Only via Mopria App.

Workaroud:
1. In CUPS config changed Browsing Yes -> Browsing No (disabled ipp and mdns)
2. Added new avahi service for manuall sharing printer via IPP - /etc/avahi/services/AirPrint-Xerox-Phaser-3140.service
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">AirPrint Xerox Phaser 3140 @ %h</name>
  <service>
    <type>_ipp._tcp</type>
    <subtype>_universal._sub._ipp._tcp</subtype>
    <port>631</port>
    <txt-record>printer-type=0x3056</txt-record>
    <txt-record>Copies=T</txt-record>
    <txt-record>Duplex=T</txt-record>
    <txt-record>mopria-certified=1.3</txt-record>
    <txt-record>URF=V1.4,CP1,W8,PQ4,RS600,DM1,FN3</txt-record>
    <!-- <txt-record>TLS=1.2</txt-record> -->
    <txt-record>pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf</txt-record>
    <txt-record>product=(Phaser 3140)</txt-record>
    <txt-record>priority=0</txt-record>
    <txt-record>adminurl=https://lxbox.local.:631/printers/xerox_3140</txt-record>
    <!-- <txt-record>ty=Xerox Phaser 3140, 2.0.0</txt-record> -->
    <txt-record>note=Гостинная</txt-record>
    <txt-record>rp=printers/xerox_3140</txt-record>
    <txt-record>qtotal=1</txt-record>
    <txt-record>txtvers=1</txt-record>
  </service>
</service-group>

I copy paraments from before configure, but if set TLS 1.2 then recognised slow down but working.
If set ty=Xerox Phaser 3140, 2.0.0 - then recognised is broken. Working only via Mopria App, but not working via default Android print server.
I know what TLS, but i dont know what mean ty field and i dont know how may by changed this option without create new file service.

Comment 13 Zdenek Dohnal 2023-07-24 11:20:06 UTC
(In reply to Mike from comment #11)
> I attachment three screenshot.
> I added via gnome control center new printer 3140.
> After that i open CUPS in web UI (step 1)
> Select Modify printer and try select the IPP Everywhere driver (step 2) -
> available only "HP Designjet T920 PostScript - IPP Everywhere ™"
> Select "HP Designjet T920 PostScript - IPP Everywhere ™"
> After apply changes i have new name driver (step 3)
> 
> Strange working CUPS

Ok, I think I'm getting a grip of it.

When do you install the printer via g-c-c, do you have splix installed?

My suspicion is splix is not installed, so system-config-printer (tool, which g-c-c calls to get the best driver) finds something similar - that's how "HP Designjet T920" gets in. And if you try to modify the printer in CUPS, it takes the model name from the current PPD, so it looks strange, but correct based on the current PPD file :( .

I was able to check that in Fedora default conf (only hplip installed with cups), system-config-printer returns that HP driver for that printer:

$ busctl --user call --timeout=120000 org.fedoraproject.Config.Printing /org/fedoraproject/Config/Printing org.fedoraproject.Config.Printing GetBestDrivers sss "MFG:Xerox;MDL:Phaser 3140;CMD:PS;" "Xerox Phaser 3140" ""
a(ss) 1 "lsb/usr/HP/hp-designjet_t920-postscript.ppd.gz" "none"

Once I install splix, I get:

$ busctl --user call --timeout=120000 org.fedoraproject.Config.Printing /org/fedoraproject/Config/Printing org.fedoraproject.Config.Printing GetBestDrivers sss "MFG:Xerox;MDL:Phaser 3140;CMD:PS;" "Xerox Phaser 3140" ""
a(ss) 1 "drv:///splix/splix-xerox.drv/ph3140.ppd" "exact"


Can you verify my suspicion? Which is splix is not installed and once you install the printer via g-c-c, there is HP Designjet T920 PPD file at /etc/cups/ppd/3140.ppd



Ad Android - according Mike Sweet the default print service should be a IPP Everywhere client, so it should work with CUPS shared queues without any additional setup - you should contact Android support if it does not work.

Comment 14 Zdenek Dohnal 2023-10-11 13:36:23 UTC
No response for 2 months, closing.

Comment 15 Red Hat Bugzilla 2024-02-09 04:25:16 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.