xpra icon
Bug tracker and wiki

Opened 2 weeks ago

Last modified 39 hours ago

#2948 new defect

printing documentation changes

Reported by: Francesco Potortì Owned by: Francesco Potortì
Priority: trivial Milestone: 4.1
Component: android Version: 3.0.x
Keywords: printing documentation Cc:

Description

I am trying to debug why printing does not work and I found these documentation problems:

The man page does not mention printing. I don't know if this is as it should be.

On the wiki:

Debian nowadays should mention python3-cups in addition to the older python-cups, which is no more available in testing (bullseye)

The debugging section does not mention on which side one should run printing.py

When I run printing.py I get an error. I suppose it is some paths missing:

$ python /usr/lib/python3/dist-packages/xpra/platform/printing.py
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/platform/printing.py", line 11, in <module>
    from xpra.util import envbool, print_nested_dict
ImportError: No module named xpra.util

Attachments (2)

xpra-log (6.2 KB) - added by Francesco Potortì 2 days ago.
xpra-log2 (6.0 KB) - added by Francesco Potortì 39 hours ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 2 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to Francesco Potortì

The man page does not mention printing. I don't know if this is as it should be.

Probably not, but writing documentation takes time.. Feel free to suggest edits.

Debian nowadays should mention python3-cups in addition to the older python-cups, which is no more available in testing (bullseye)

Replaced: wiki/Printing

When I run printing.py I get an error. I suppose it is some paths missing:
ImportError: No module named xpra.util

That's not right, xpra.util is always there:

python3 -c "from xpra.util import envbool, print_nested_dict"

Maybe something is damaged in your installation?

comment:2 Changed 2 weeks ago by Francesco Potortì

The printer was there, I had just missed it.

The error from python comes from Debian testing having python as v2, while the python3-cups is v3. So when calling it one should use python3, not python.

The debugging example is written as if printing.py were executable, which on Debian is not. If it were, the first line would need to use python3 rather than python.

The script works for listing printers (and the printer is there) but if I try printing I get:

$ python3 /usr/lib/python3/dist-packages/xpra/platform/printing.py /tmp/oneline.txt 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/xpra/platform/printing.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/usr/lib/python3/dist-packages/xpra/platform/printing.py", line 181, in main
    printer = printers.keys()[0]
TypeError: 'dict_keys' object is not subscriptable

Printing remotely now apparently works, but the printer does not print...

The remote cups server says the file has been printed without error, but the local cups has nothing in the queue of current or completed jobs.

One possible source of problem is that the local printer is a wireless network printer and cups sees it, but in the local print dialogs I see two printers, or sometimes three ones, the other ones I suppose are identified by avahi. I don't think this is a problem with xpra, bunt I wanted to mention it anyway.

These are messages in the server syslog after an attempt at printing. All of them are created by xpraforwarder and have the ame timestamp:

'/usr/lib/cups/backend/xpraforwarder' '3919' 'pot' 'Unsaved Document 1' '1' 'Resolution=600dpi PageSize=A4 overridea4withletter=yes noCollate Duplex=None edgetoedge=yes ColorModel=color joboffset=on manualduplex=off manualfeed=off number-up=1 borderless=on lowsupplies=continue ret=notset job-uuid=urn:uuid:a4737c35-515a-3fd1-51df-6e603ce19026 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1605890948 time-at-processing=1605890948'
version 4.0.4, username: pot, title: Unsaved Document 1, filename: -, job_id: 3919
uid=(0, 0, 0), gid=(7, 7, 7)
DEVICE_URI=xpraforwarder:/tmp?display=%3A7&source=e489d47d8bd040350eec458e399ddf196a5543bb&socket-path=%2Frun%2Fuser%2F1000%2Fxpra%2Ftucano.isti.cnr.it-7&remote-printer=HP_LaserJet_M15w_8EA306_&remote-device-uri=implicitclass%3A%2F%2FHP_LaserJet_M15w_8EA306_%2F&mimetype=application%2Fpdf
parsed attributes={'display': [':7'], 'source': ['e489d47d8bd040350eec458e399ddf196a5543bb'], 'socket-path': ['/run/user/1000/xpra/tucano.isti.cnr.it-7'], 'remote-printer': ['HP_LaserJet_M15w_8EA306_'], 'remote-device-uri': ['implicitclass://HP_LaserJet_M15w_8EA306_/'], 'mimetype': ['application/pdf']}
xpra display: :7, socket-path: /run/user/1000/xpra/tucano.isti.cnr.it-7
running: ['xpra', 'print', 'socket:/run/user/1000/xpra/tucano.isti.cnr.it-7', '-', 'application/pdf', 'e489d47d8bd040350eec458e399ddf196a5543bb', 'Unsaved Document 1', 'HP_LaserJet_M15w_8EA306_', '1', 'Resolution=600dpi PageSize=A4 overridea4withletter=yes noCollate Duplex=None edgetoedge=yes ColorModel=color joboffset=on manualduplex=off manualfeed=off number-up=1 borderless=on lowsupplies=continue ret=notset job-uuid=urn:uuid:a4737c35-515a-3fd1-51df-6e603ce19026 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1605890948 time-at-processing=1605890948']
returncode=0

I suppose the next step is to set -d printing on both the server and client, right?

Last edited 13 days ago by Francesco Potortì (previous) (diff)

Changed 2 days ago by Francesco Potortì

Attachment: xpra-log added

comment:3 Changed 2 days ago by Francesco Potortì

I run xpra with -d printing and saved stderr to a file, which is attached as xpra.log. I opened a remote pdf file and printed it on the local printer. No errors were shown by the printing application, but the local printer did not print.

I think that the offending line in the log may be this one:

org.freedesktop.DBus.Error.ServiceUnknown: The name :1.1683 was not provided by any .service files

but I don't know what it means

comment:4 Changed 43 hours ago by Antoine Martin

TypeError: 'dict_keys' object is not subscriptable

Fixed in r28074: this script should work with both python2 and python3.

Xpra GTK3 X11 client version 4.0.4-r27557 64-bit
...
The remote cups server says the file has been printed without error, but the local cups has nothing in the queue of current or completed jobs.

I have a suspicion that the file to print has been sent to the client but wrongly rejected.
Try updating to 4.0.5 which has this fix.

comment:5 Changed 43 hours ago by Antoine Martin

Try updating to 4.0.5 which has this fix.

I was wrong, it does not: you need r28028.

comment:6 Changed 39 hours ago by Francesco Potortì

I applied r28074 and r28028, removed the __pycache__ directory from both the net and platform directories, stopped the server and restarted. I see no apparent change. I am attaching the new log as xpra-log-2, but I can see that there is no difference with the previous log.

Edit: the Debian version is xpra (4.0.4-r27557-1) UNRELEASED

Last edited 39 hours ago by Francesco Potortì (previous) (diff)

Changed 39 hours ago by Francesco Potortì

Attachment: xpra-log2 added
Note: See TracTickets for help on using tickets.