Printer configuration

2020-06-25 Thread Kyle Andrews


Dear Guix,

Could you help me get my printer working?

I setup my cups service:

...
(use-modules ...
 (gnu packages cups)
 ...)
(use-service-modules ... cups ...)
...
  (service cups-service-type
   (cups-configuration
(extensions
 (list hplip-minimal cups-filters splix))
(server-name host-name)
(host-name-lookups #t)
(web-interface? #t)))
...

Then I reconfigured my system and restarted. Now I can access the CUPS
page on localhost:631. However, I could not figure out that interface
for the life of me. Instead, I found out I could install the
`system-config-printer' package which provided a setup utility that
actually made sense, giving me hope of falling into a "pit of
success". It detected my printer, great! Unfortunately, it failed to
print a test page, popping up a warning box with the text:

Printer 'SCX-4200' requires the '/gnu/store/.../cups/filter/rastertoqpdl'
program but it is not currently installed.

I'm not sure what to do now. Thanks in advance for any suggestions on
how to resolve this.

Best Regards,
Kyle



Re: Printer configuration

2020-06-25 Thread Kyle Andrews


Kyle Andrews writes:

> Dear Guix,
>
> Could you help me get my printer working?
>
> I setup my cups service:
>
> ...
> (use-modules ...
>(gnu packages cups)
>  ...)
> (use-service-modules ... cups ...)
> ...
>   (service cups-service-type
>  (cups-configuration
>   (extensions
>(list hplip-minimal cups-filters splix))
>   (server-name host-name)
>   (host-name-lookups #t)
>   (web-interface? #t)))
> ...
>
> Then I reconfigured my system and restarted. Now I can access the CUPS
> page on localhost:631. However, I could not figure out that interface
> for the life of me. Instead, I found out I could install the
> `system-config-printer' package which provided a setup utility that
> actually made sense, giving me hope of falling into a "pit of
> success". It detected my printer, great! Unfortunately, it failed to
> print a test page, popping up a warning box with the text:
>
> Printer 'SCX-4200' requires the '/gnu/store/.../cups/filter/rastertoqpdl'
> program but it is not currently installed.
>
> I'm not sure what to do now. Thanks in advance for any suggestions on
> how to resolve this.
>
> Best Regards,
> Kyle

After sending I realized there were two pieces of information I forgot
to include that might be of interest towards diagnosing the difficulty:

1.) The printer is a SCX-4200 and is listed as working on
openprinting.org.

2.) the slice of the error message I showed was incomplete: the guix
package where rastertoqpdl is being searched for is in cups, yet the
tool is clearly available in the splix package. Why is
system-config-printer looking in the wrong package? How can I make the
service see both?

Thanks,
Kyle




Re: Printer configuration

2020-06-26 Thread Wiktor Żelazny
On Thu, Jun 25, 2020 at 10:11:36PM -0400, Kyle Andrews wrote:

> (use-modules ...
>(gnu packages cups)
>  ...)

>   (service cups-service-type
>  (cups-configuration
>   (extensions
>(list hplip-minimal cups-filters splix))
>   (server-name host-name)
>   (host-name-lookups #t)
>   (web-interface? #t)))

Hi Kyle,

Just a wild guess, but how about declaring cups and splix in the
`packages` part of your config.scm?

WŻ


signature.asc
Description: PGP signature


Re: Printer configuration

2020-06-26 Thread Kyle Andrews


Wiktor Żelazny writes:

> On Thu, Jun 25, 2020 at 10:11:36PM -0400, Kyle Andrews wrote:
>
>> (use-modules ...
>>   (gnu packages cups)
>>  ...)
>
>>   (service cups-service-type
>> (cups-configuration
>>  (extensions
>>   (list hplip-minimal cups-filters splix))
>>  (server-name host-name)
>>  (host-name-lookups #t)
>>  (web-interface? #t)))
>
> Hi Kyle,
>
> Just a wild guess, but how about declaring cups and splix in the
> `packages` part of your config.scm?
>
> WŻ

Thanks for the suggestion, WZ! I gave it a shot adding cups and splix
into my default packages. Unfortunately, even after completely
restarting the computer I observed no change in the error I get when
trying to print a test page.



Re: Printer configuration

2020-06-26 Thread Wiktor Żelazny
On Fri, Jun 26, 2020 at 12:56:08PM -0400, Kyle Andrews wrote:

> I observed no change in the error I get when trying to print a test
> page.

Does /gnu/store/.../cups/filter/rastertoqpdl exist?

Is the user printing the test page a member of the lp group (lpadmin
might also help)?

WŻ


signature.asc
Description: PGP signature


Re: Printer configuration

2020-06-26 Thread Kyle Andrews


Wiktor Żelazny writes:

> On Fri, Jun 26, 2020 at 12:56:08PM -0400, Kyle Andrews wrote:
>
>> I observed no change in the error I get when trying to print a test
>> page.
>
> Does /gnu/store/.../cups/filter/rastertoqpdl exist?
>
> Is the user printing the test page a member of the lp group (lpadmin
> might also help)?
>
> WŻ

Hi WZ,

Thanks for following up.

> Does /gnu/store/.../cups/filter/rastertoqpdl exist?

Yes, it exists in the splix package, but not in the cups
package. Looking at the Guix source code I saw that
~system-config-printer~ (in ~guix/gnu/packages/gnome.scm~) takes input
from cups on build, but not from splix or other print drivers. Could
that be part of the problem?

> Is the user printing the test page a member of the lp group (lpadmin
> might also help)?

The user is in the lp group. I didn't know about lpadmin. I will add
that group as well and see if it changes anything. The CUPS localhost
page was behaving strangely (stalling on load) when I tried to click the
administration tab. Thanks for the tip!

Kyle




Re: Printer configuration

2020-06-26 Thread Wiktor Żelazny
On Fri, Jun 26, 2020 at 02:13:14PM -0400, Kyle Andrews wrote:
>
> Wiktor Żelazny writes:
>
> > Does /gnu/store/.../cups/filter/rastertoqpdl exist?
>
> Yes, it exists in the splix package, but not in the cups package.
> Looking at the Guix source code I saw that ~system-config-printer~ (in
> ~guix/gnu/packages/gnome.scm~) takes input from cups on build, but not
> from splix or other print drivers. Could that be part of the problem?

I wouldn’t be surprised. On the other hand, it does not import other
extensions, such as hplip and foomatic-filters, either.

Did you run guix system reconfigure after adding the packages to
config.scm? Did you try removing and adding the printer again
afterwards?

Does a /var/guix/profiles/system/profile/lib/cups/filter/rastertoqpdl
symlink exist in your filesystem? I think you could try changing the
rastertoqpdl path defined in the system-config-printer configuration (or
CUPS configuration, assuming it’s just a CUPS GUI frontend) from
/gnu/store/… to that path. /gnu/store/ contents are volatile. Again,
just guessing; perhaps the path is hardcoded into the CUPS/splix build
and uneditable.

WŻ


signature.asc
Description: PGP signature


Re: Printer configuration

2020-06-26 Thread Tobias Geerinckx-Rice

Kyle,

I'd strongly recommend using the ‘real’ CUPS interface at 
localhost:631 over any third-party helper, but…


Kyle Andrews 写道:
The CUPS localhost page was behaving strangely (stalling on 
load)

when I tried to click the administration tab.


I can confirm that the Administration tab freezes on my laptop and 
print server (CUPS proxied through nginx).  That's new :-/  I'll 
report a bug for that.


Thanks,

T G-R


signature.asc
Description: PGP signature


Re: Printer configuration

2020-06-26 Thread Kyle Andrews


Wiktor Żelazny writes:

> On Fri, Jun 26, 2020 at 02:13:14PM -0400, Kyle Andrews wrote:
>>
>> Wiktor Żelazny writes:
>>
>> > Does /gnu/store/.../cups/filter/rastertoqpdl exist?
>>
>> Yes, it exists in the splix package, but not in the cups package.
>> Looking at the Guix source code I saw that ~system-config-printer~ (in
>> ~guix/gnu/packages/gnome.scm~) takes input from cups on build, but not
>> from splix or other print drivers. Could that be part of the problem?
>
> I wouldn’t be surprised. On the other hand, it does not import other
> extensions, such as hplip and foomatic-filters, either.
>
> Did you run guix system reconfigure after adding the packages to
> config.scm? Did you try removing and adding the printer again
> afterwards?
>
> Does a /var/guix/profiles/system/profile/lib/cups/filter/rastertoqpdl
> symlink exist in your filesystem? I think you could try changing the
> rastertoqpdl path defined in the system-config-printer configuration (or
> CUPS configuration, assuming it’s just a CUPS GUI frontend) from
> /gnu/store/… to that path. /gnu/store/ contents are volatile. Again,
> just guessing; perhaps the path is hardcoded into the CUPS/splix build
> and uneditable.
>
> WŻ

Hi WZ,

> Did you run guix system reconfigure after adding the packages to
> config.scm? Did you try removing and adding the printer again
> afterwards?

I did reconfigure, but I didn't try removing and adding the printer
again.

> Does a /var/guix/profiles/system/profile/lib/cups/filter/rastertoqpdl
> symlink exist in your filesystem? I think you could try changing the
> rastertoqpdl path defined in the system-config-printer configuration (or
> CUPS configuration, assuming it’s just a CUPS GUI frontend) from
> /gnu/store/… to that path. /gnu/store/ contents are volatile. Again,
> just guessing; perhaps the path is hardcoded into the CUPS/splix build
> and uneditable.

It does appear to exist. Actually, I figured out how to successfully
print a document using ~libreoffice --headless -p test.odt~. So, I think
my printer problem is actually reflecting a problem with
system-config-printer.

Kyle




Re: Printer configuration

2020-06-27 Thread Wiktor Żelazny
On Fri, Jun 26, 2020 at 06:12:23PM -0400, Kyle Andrews wrote:

> I figured out how to successfully print a document using ~libreoffice
> --headless -p test.odt~. So, I think my printer problem is actually
> reflecting a problem with system-config-printer.

Or perhaps the difference is that that print job did not have to involve
rastertoqpdl. Have you tried something like

   lpr a-simple-text-file.txt

?

Of course, I second Tobias in advising you to try localhost:631. CUPS
may figure out some smart configuration for you.

Good luck,

WŻ


signature.asc
Description: PGP signature


Re: Printer configuration

2020-06-27 Thread Kyle Andrews


Wiktor Żelazny writes:

> On Fri, Jun 26, 2020 at 06:12:23PM -0400, Kyle Andrews wrote:
>
>> I figured out how to successfully print a document using ~libreoffice
>> --headless -p test.odt~. So, I think my printer problem is actually
>> reflecting a problem with system-config-printer.
>
> Or perhaps the difference is that that print job did not have to involve
> rastertoqpdl. Have you tried something like
>
>lpr a-simple-text-file.txt
>
> ?
>

Yes, I did. That worked too!

> Of course, I second Tobias in advising you to try localhost:631. CUPS
> may figure out some smart configuration for you.

I was able to print a test page through the CUPS web interface as
well. So, this further points to system-config-printer being buggy.

> Good luck,
>
> WŻ

Thanks for all your help.

Kyle



Printer configuration failed due to missing filters

2021-12-02 Thread Daniel Meißner
Hi Guix!

I am currently trying to configure my Epson printer on Guix system using
system-config-printer.  The printer is connected via USB and is
automatically detected in the dialog window that opens if I click on
"Add". I select the printer from the list and click on "Forward", then I
enter the printer name, a description and a location in the section
"Describe Printer".  However, if I click on "Apply", the following error
message is printed:

> Printer 'EPSON-...' requires the
> '/gnu/store/...-cups-2.3.3/lib/cups/filter/epson-escpr-wrapper',
> program but it is not currently installed. Please install it before
> using this printer.

The printer is added but trying to print a test page yields: ‘CUPS
server error.  There was an error during the CUPS operation: ’No such
file or directory’.’ According to the Guix manual, the epson-escpr
filter should be installed by default when using the cups-service-type.
Nevertheless, I also made it explicit in my system configuration:

--8<---cut here---start->8---
(service cups-service-type
 (cups-configuration
  (extensions
   (list cups-filters
 epson-inkjet-printer-escpr
--8<---cut here---end--->8---

Looking in the system profile I cannot find it: ‘find
/run/current-system/profile -name "epson-escpr-wrapper"’ shows no
results.  There is also no cups directory under
/run/current-system/profile/lib.  Am I missing something?

Since I am running Gnome, I also tried to configure the printer using
gnome-control-center.  However, here the error message is not so
detailed.  It just says: ‘Failed to add new printer’.

I think this is an issue specific to Guix because the printer works with
other Linux distros.

Best
Daniel



Re: Printer configuration failed due to missing filters

2021-12-02 Thread Tobias Geerinckx-Rice

Daniel!

Daniel Meißner 写道:

Printer 'EPSON-...' requires the
'/gnu/store/...-cups-2.3.3/lib/cups/filter/epson-escpr-wrapper',
program but it is not currently installed. Please install it 
before

using this printer.


Interesting here is that it's looking in …-cups-2.3.3 where I 
believe it should look in …-cups-server-bin instead.  The former 
is merely the upstream CUPS package, whilst the latter is a union 
of CUPS with its extensions (drivers).


Can you confirm that the file printed by

 $ ps auxwww | grep -o '/gnu/store/[^ ]*cups-files.conf'

contains

 DataDir /gnu/store/…-cups-server-bin/share/cups
 ServerBin /gnu/store/…-cups-server-bin/lib/cups

?

You should find lib/cups/filter/epson-escpr-wrapper under this 
ServerBin.



Looking in the system profile I cannot find it: ‘find
/run/current-system/profile -name "epson-escpr-wrapper"’ shows 
no

results.  There is also no cups directory under
/run/current-system/profile/lib.  Am I missing something?


Just that there's no reason for epson-escpr-wrapper to be anywhere 
in /run/current-system in the first place.  It should be in the 
union directory I mentioned above, and CUPS should find it there.


I don't currently have access to an Epson printer, but I'll try to 
add one anyway.


See if you can divine any useful chunks from the puddle of vomit 
that CUPS produces when configured with:


 (cups-configuration
   …
   (log-level 'debug2)
   …)

There's also (access-log-level 'all) but it's probably not 
relevant here.


Kind regards,

T G-R


signature.asc
Description: PGP signature


Re: Printer configuration failed due to missing filters

2021-12-02 Thread Tobias Geerinckx-Rice

Tobias Geerinckx-Rice 写道:
Interesting here is that it's looking in …-cups-2.3.3 where I 
believe

it should look in …-cups-server-bin instead.


Specifically through the standard $PATH mechanism:

 …
 envp[10]="PATH=/gnu/store/…-cups-server-bin/lib/cups/filter:…"
 …

(from /var/log/cups/error_log).

Kind regards,

T G-R


signature.asc
Description: PGP signature


Re: Printer configuration failed due to missing filters

2021-12-02 Thread Daniel Meißner
Hi Tobias!

Thank you for responding promptly.

> Can you confirm that the file printed by
>
>   $ ps auxwww | grep -o '/gnu/store/[^ ]*cups-files.conf'
>
> contains
>
>   DataDir /gnu/store/…-cups-server-bin/share/cups
>   ServerBin /gnu/store/…-cups-server-bin/lib/cups
>
> ?

Affirmative, this file contains those two lines.

> You should find lib/cups/filter/epson-escpr-wrapper under this 
> ServerBin.

Aha! Yes, it is there, indeed.

>> Looking in the system profile I cannot find it: ‘find
>> /run/current-system/profile -name "epson-escpr-wrapper"’ shows no
>> results.  There is also no cups directory under
>> /run/current-system/profile/lib.  Am I missing something?
>
> Just that there's no reason for epson-escpr-wrapper to be anywhere 
> in /run/current-system in the first place.  It should be in the 
> union directory I mentioned above, and CUPS should find it there.

I see, I am very new to Guix, so I don't know the internals of Guix
really.  I naively assumed that I should find it in the system profile.

> I don't currently have access to an Epson printer, but I'll try to 
> add one anyway.

That'd be awesome, thank you.

> See if you can divine any useful chunks from the puddle of vomit 
> that CUPS produces when configured with:
>
>   (cups-configuration
> …
> (log-level 'debug2)
> …)
>
> There's also (access-log-level 'all) but it's probably not 
> relevant here.

Thanks for the hints, I will try to destill something from the logs.

Best
Daniel



Re: Printer configuration failed due to missing filters

2021-12-02 Thread Tobias Geerinckx-Rice

Daniel,

Daniel Meißner 写道:
I am currently trying to configure my Epson printer on Guix 
system using

system-config-printer.  The printer is connected via USB and is
automatically detected in the dialog window that opens if I 
click on
"Add". I select the printer from the list and click on 
"Forward", then I
enter the printer name, a description and a location in the 
section
"Describe Printer".  However, if I click on "Apply", the 
following error

message is printed:


I was unable to reproduce this at all, albeit without an Epson USB 
printer connected, of course.


My steps through the CUPS Web interface:
- Administration
- Add Printer
- Internet Printing Protocol (ipp)
 Continue
- Connection: "ipp://fake.printer/print/Print"
 Continue
- Description, Location: "test"
 Share This Printer unticked
 Continue
- Make: Epson
 Continue
- Model: EPSON ET-2600 Series , Epson Inkjet Printer Driver
(ESC/P-R) for Linux (…)
- Then accept all default options.

Result attached.  At no point do I get an error.

Interestingly, my CUPS only ever looks in the right location for 
epson-escpr-wrapper:


--8<---cut here---start->8---
λ grep escpr-wrapper -a /var/log/cups/error_log 
d [03/Dec/2021:00:17:28 +0100] 
add_printer_filter(p=0x64654c639bd0(test), 
filtertype=0x64654c5b7ca0(printer/test), 
filter="application/vnd.cups-raster 0 epson-escpr-wrapper")
d [03/Dec/2021:00:17:28 +0100] test: File 
\"/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrapper\" 
permissions OK (040555/uid=0/gid=0).
d [03/Dec/2021:00:17:28 +0100] add_printer_filter: test: adding 
filter application/vnd.cups-raster printer/test 0 
epson-escpr-wrapper
d [03/Dec/2021:00:17:33 +0100] 
add_printer_filter(p=0x64654c639bd0(test), 
filtertype=0x64654c5b7ca0(printer/test), 
filter="application/vnd.cups-raster 0 epson-escpr-wrapper")
d [03/Dec/2021:00:17:33 +0100] test: File 
\"/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrapper\" 
permissions OK (040555/uid=0/gid=0).
d [03/Dec/2021:00:17:33 +0100] add_printer_filter: test: adding 
filter application/vnd.cups-raster printer/test 0 
epson-escpr-wrapper

--8<---cut here---end--->8---

I can even print a test page (from the Maintenance drop-down).  Of 
course it fails to connect to the printer, but still the filter 
seems to run perfectly:


--8<---cut here---start->8---
λ grep escpr-wrapper -a /var/log/cups/error_log 
D [03/Dec/2021:00:28:45 +0100] [Job 46] epson-escpr-wrapper 
(application/vnd.cups-raster to printer/test, cost 0)
d [03/Dec/2021:00:28:45 +0100] test: File 
\"/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrapper\" 
permissions OK (040555/uid=0/gid=0).
d [03/Dec/2021:00:28:45 +0100] cupsdStartProcess: Preparing to 
start 
"/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrapper", 
arguments:
d [03/Dec/2021:00:28:45 +0100] cupsdStartProcess: argv[8] = 
"/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrapper"
d [03/Dec/2021:00:28:45 +0100] 
cupsdStartProcess(command="/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrapper", 
argv=0x7fffc0e0f148, envp=0x7fffc0e0fad8, infd=25, outfd=28, 
errfd=20, backfd=21, sidefd=23, root=0, profile=(nil), 
job=0x64654c5bf1b0(46), pid=0x64654c5bf2d0) = 32624
I [03/Dec/2021:00:28:45 +0100] [Job 46] Started filter 
/gnu/store/bmb3hz0a4k5a51bb5w7lxlc766d1hcv3-cups-server-bin/lib/cups/filter/epson-escpr-wrappe 
(PID 32624)
D [03/Dec/2021:00:28:45 +0100] [Job 46] pdftopdf: Last filter 
determined by the PPD: epson-escpr-wrapper; FINAL_CONTENT_TYPE: 
application/vnd.cups-raster => pdftopdf will not log pages in 
page_log.

--8<---cut here---end--->8---

So we'll need more info.  Especially your printer model (I chose 
one at random :-) and similar debug log.


Kind regards,

T G-R



signature.asc
Description: PGP signature


Re: Printer configuration failed due to missing filters

2021-12-04 Thread Daniel Meißner
Hi Tobias,

> Daniel Meißner 写道:
>> I am currently trying to configure my Epson printer on Guix system
>> using system-config-printer.  The printer is connected via USB and is
>> automatically detected in the dialog window that opens if I click on
>> "Add". I select the printer from the list and click on "Forward",
>> then I enter the printer name, a description and a location in the
>> section "Describe Printer".  However, if I click on "Apply", the
>> following error message is printed:
>
> I was unable to reproduce this at all, albeit without an Epson USB
> printer connected, of course.

Using the web-interface of CUPS I could add my printer seamlessly and
even print a test page.  So thanks!  However, as mentioned in [1], the
web interface responded super slowly which was the reason to use
system-config-printer and gnome-control-center in the first place.
After the fix the web-interface now runs smoothly.

However, gnome-control-center still `Failed to add new printer' and
system-config-printer still prints the error message I mentioned before.
As before it adds the printer but refuses to print a test page saying
‘There was an error during the CUPS operation: 'No such file or
directory'’.

Nevertheless, I found that it is possible to print a PDF document from
evince on the very same printer that I added using
system-config-printer.  So the problem seems to lie within
system-config-printer (and not CUPS) searching the right PATH for the
Epson filter.  Additionally, gnome-control-center does not seem to work
at all in that regard because I did not manage to add the printer with
it.

I am happy now since I am able to print but maybe it is worthwhile
investigating this issue with gnome-control-center within the
core-updates-frozen branch.  Because this would be the first place to
try to add printers for new Guix users that use Gnome.  I would be happy
to help although I can probably only try to reproduce this issue on
core-updates-frozen.

Best
Daniel


1: https://lists.gnu.org/archive/html/help-guix/2021-12/msg00010.html