Author Topic: How to set up CUPS  (Read 1026 times)

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
How to set up CUPS
« on: August 13, 2017, 01:32:28 am »
I have a new installation of ArcaOS 5.01, which installed CUPS.  I have a CUPS-supported printer, an HP OfficeJet Pro 6230, connected by ethernet.  The CUPS administration web page recognizes the printer, but will not even print a test page to it.  Documents printed from OpenOffice 4.13 simply disappear.  They are not in the printer objects nor in the queue shown on the administration page.  However, If I print a document from OpenOffice to a .pdf and then send the .pdf to the printer from the command line with lpr -P OJP_Letter e:\test.pdf, it prints right away and correctly.

There seems to be precious little documentation of how to set up the printer objects to print various sizes of documents, like letter, #10 envelope, or 4x6 card, in OS/2.  Maybe it's so simple that none was thought to be required, but I can't figure it out.  Can anyone point me to something helpful?



Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 27
  • Posts: 569
    • View Profile
Re: How to set up CUPS
« Reply #1 on: August 13, 2017, 02:18:58 am »
Hi Mike

I have yet to get the ArcaOS and later rpm packaged cups to work with my printer but in your position the 1st thing to do is run the cups web admin and turn on debugging on the admin page and click Change settings. You should now get a more detailed log which should help in identifying the problem.

I'm not sure where exactly the log will be but search below the \var directory for filename error_log - you should be able to read this in the cups web admin but I seem to recall that demanded an unknown user:password to gain access to the log. So, you will need to "kill" cupsd.exe - which may take several goes - before you can open error_log with a text editor.

Then it is a case of reading through the log to see what happened to the print job which is simply identified as [Job x] where x is a numerical value.


Regards

Pete

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #2 on: August 14, 2017, 05:02:55 pm »
Thanks to Pete, I was able to get debugging turned on and make a log.  The location is easy.  It's in bootdrive:\var\logs\cups, and called "error_log.  Interpreting the log is another matter.  As before, I attempted a test page, which failed.  The error shown on the CUPS admin page is "State stopped  "Filter failed".  When I send a simple .pdf to the same CUPS printer from the command line, it prints.  The log of both is rather extensive even though it represents only a few seconds of real time.  I've zipped the log that shows the two events in case anyone wants to look at it and tell me what's wrong here.

David McKenna

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 7
  • Posts: 170
    • View Profile
Re: How to set up CUPS
« Reply #3 on: August 14, 2017, 08:17:05 pm »
 Michael,

  According to your log, the filter that failed is 'gstoraster'. It might be worth re-installing ghostscript using ANPM and see if that helps. What's strange is that later in the log gstoraster worked on a different job. Here is the failing snippet:

D [14/Aug/2017:10:41:46 +0500] [Job 27] Operand stack:
D [14/Aug/2017:10:41:46 +0500] [Job 27] (j:\\\\var\\\\temp\\\\gsKiES1S)   --nostringval--   --dict:10/10(L)--   false   --dict:5/6(L)--   setpagedevice   --dict:30/32(L)--   true
D [14/Aug/2017:10:41:46 +0500] [Job 27] Execution stack:
D [14/Aug/2017:10:41:46 +0500] [Job 27] %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1922   1   3   %oparray_pop   1921   1   3   %oparray_pop   1905   1   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   2   1   2   --nostringval--   %for_pos_int_continue   --nostringval--   1884   4   7   %oparray_pop   --nostringval--   --nostringval--
D [14/Aug/2017:10:41:46 +0500] [Job 27] Dictionary stack:
D [14/Aug/2017:10:41:46 +0500] [Job 27] --dict:1198/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:114/127(ro)(G)--   --dict:280/300(ro)(G)--   --dict:26/32(L)--
D [14/Aug/2017:10:41:46 +0500] [Job 27] Current allocation mode is local
D [14/Aug/2017:10:41:46 +0500] [Job 27] Last OS error: Not enough memory
D [14/Aug/2017:10:41:46 +0500] [Job 27] GNU Ghostscript 0.09.14: Unrecoverable error, exit code 1
I [14/Aug/2017:10:41:46 +0500] [Job 27] Rendering completed
D [14/Aug/2017:10:41:46 +0500] cupsdMarkDirty(---J-)
D [14/Aug/2017:10:41:46 +0500] cupsdSetBusyState: newbusy="Dirty files", busy="Dirty files"
D [14/Aug/2017:10:41:46 +0500] [Job 27] Set job-printer-state-message to "Rendering completed", current level=INFO
D [14/Aug/2017:10:41:46 +0500] Discarding unused job-progress event...
D [14/Aug/2017:10:41:46 +0500] Discarding unused printer-state-changed event...
D [14/Aug/2017:10:41:46 +0500] [Job 27] prnt/hpcups/HPCupsFilter.cpp 575: cupsRasterOpen failed, fd = 0
W [14/Aug/2017:10:41:46 +0500] cupsdDoSelect: select() returned -1... pause and retry select()
D [14/Aug/2017:10:41:47 +0500] [Job 27] PID 286 (/@unixroot/usr/lib/cups/filter/gstoraster.exe) stopped with status 256 (Unknown error 156)
D [14/Aug/2017:10:41:47 +0500] [Job 27] PID 289 (/@unixroot/usr/lib/cups/filter/hpcups.exe) stopped with status 1.

  There is a reference to 'not enough memory' and an unrecoverable error in Ghostscript 0.9.14 - do you have more than one ghostscript installation or old ghostscript files on your path?

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #4 on: August 14, 2017, 10:10:29 pm »
The instance where ghostscript failed was the test page from the cups admin web page.  It succeeded when I sent the .pdf file from the command line.

There are no other versions of ghostscript on my path or libpath.  In fact, ANPM will not let me install any version of ghostscript because it reports that they conflict with the existing installation.  It might be a memory problem.  I've had that issue with Firefox, too.  I'm changing motherboards in a few days to add more memory, so I'll try it again then.  If not, I'll search for another Postscript printer. :-(  Thanks.

Doug Bissett

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 37
  • Posts: 962
    • View Profile
Re: How to set up CUPS
« Reply #5 on: August 14, 2017, 10:35:33 pm »
[quote}There are no other versions of ghostscript on my path or libpath. [/quote]

PATH ot LIBPATH, has nothing to do with it. If you have an old CUPS version present, it can interfere with the version that is installed by ArcaOS. ZIP up the old directory structure, and delete it.

Quote
ANPM will not let me install any version of ghostscript because it reports that they conflict with the existing installation.

It is only a warning. Simply ignore it, and install the supported version, then delete the unsupported installation, using whatever method you used to install it (or delete, then install). Your old version is not supported by YUM, so it warns you that installing with YUM will change the rules, and it probably won't cooperate.

Pete

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 27
  • Posts: 569
    • View Profile
Re: How to set up CUPS
« Reply #6 on: August 15, 2017, 05:57:47 am »
Hi Michael

I have not seen a cups error_log with "Last OS error: Not enough memory" before. It does prompt the question of how much ram is installed? - and how much is free?

That could be the reason for the " GNU Ghostscript 0.09.14: Unrecoverable error, exit code 1" immediately after in the log. The ghostscript failure is why gstoraster fails.

My attempts to print using any of the rpm packaged cups releases always results in a gstoraster/ghostscript failure - but without the "Last OS error: Not enough memory" log entry indicating problems with ghostscript on some systems.

There is an alternative release of cups which can be a bit tricky to setup - but it works here. See http://trac.netlabs.org/ecups/wiki/CupsPort which also has a link to a "Howto".

Setting paper size and other print options is usually done within the app that you are printing from eg select Print and then select Properties/Print Settings or similar which displays the printer job properties.


Regards

Pete

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #7 on: August 15, 2017, 02:22:06 pm »
My system has only 2 Gb of RAM and cannot be expanded.  Firefox produces similar errors due to lack of memory, so I'm getting a new board with more RAM.

I've set the paper sizes and types, etc. in the apps, but with errors that I don't understand, it's hard to tell whether CUPS is not printing the jobs because of incorrect settings or some other reason.  I know that sending the wrong paper size and type to OS/2 printer objects often causes them not to print because of a "form mismatch" error.  I don't know whether CUPS does that.

I have had the alternative CUPS version installed on a different partition and working.  It's the version that comes with ArcaOS 5.01 that is giving me trouble.  I'll try it with more RAM.  Postscript printers seem to be easier to set up.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 98
  • Posts: 1168
    • View Profile
Re: How to set up CUPS
« Reply #8 on: August 15, 2017, 04:35:52 pm »
2GB's of ram is plenty. The problem is the design of OS/2, which originally only gave a process 512MBs minus whatever shared DLL's take up, closer to 300MB's. We can also use high memory above 1GB but it is not the most efficient as not all the API can use it.
One thing you can try is enlarging the VIRTUALADDRESSLIMIT in config.sys to 3072 or 2816 if 3072 is unstable. This will enlarge your address space making more memory available for things like Firefox that will use the high memory.

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #9 on: August 17, 2017, 01:29:54 pm »
Thanks, Dave.  I changed it to 3072 and rebooted.  I still get nothing out of the printer.  I'm considering deleting CUPS and starting over with the one on netlabs.  ArcaOS seems to have installed CUPS files in several different places.  Is deleting and reinstalling a viable option when I don't know where all of it is?

Alex Taylor

  • Full Member
  • ***
  • Thank You
  • -Given: 10
  • -Receive: 16
  • Posts: 218
    • View Profile
Re: How to set up CUPS
« Reply #10 on: August 17, 2017, 01:45:42 pm »
It's all in the RPM database, so you can use ANPM to uninstall cups*, guten*, hplip* and possibly (gnu-)ghostscript* if you want to be thorough.

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #11 on: August 17, 2017, 11:24:03 pm »
Thanks, Alex.  Given my problems with this, do you think that reinstalling might help, or should I try something else first.  If a reinstall is a good idea, can I do that with ANPM to after I uninstall?  There's clearly something wrong, but printing envelopes from the command line works, so CUPS is not completely broken.

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #12 on: August 18, 2017, 01:06:37 pm »
After having read Doug's post a few times, I'm concerned that he may have identified a problem.  On the same computer, I have two bootable installations of OS/2.  Both have separate licenses.  One is eCS 2.1, which has the cups from the netlabs warpin packages.  All of the pieces of cups are installed on the boot drive.  No directory of that drive is referred to by the path or libpath statements of the ArcaOS installation.

Then I have the ArcaOS installation.  All of the pieces of the cups installation on that partition are installed on the boot drive, where the installer put them.

Neither of the cups installations works as it should, in that they will not print from OpenOffice to a printer that is supported by hplip.  They will print some things from the command line.  I've not done extensive testing of this because ink is expensive and I really just wanted to print envelopes and 4x6 recipe cards from the cups printer anyway.

I don't understand how these two installations could interfere with each other.  If they can, is there any way to keep two bootable partitions and have them both have functioning cups installations?

Some of these pitfalls might need to be explained on the ArcaOS install docs.

Michael Snyder

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: How to set up CUPS
« Reply #13 on: August 18, 2017, 06:56:10 pm »
This problem has been solved, at least for the short term.  I cannot explain why this worked, and doubted that it would help, but tried it anyway.  Doug's suggestion that a cups installation on one boot drive might interfere with a cups installation on another drive is correct.  I booted to the original drive and uninstalled cups with warpin.  When I booted to the ArcaOS drive, I was able to print from OpenOffice to the cups printer.

I don't see how this could be true and consider this a design defect of cups, but it apparently is true that you can have only one installation on a computer at a time.

Thanks to all who helped.

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 6
  • -Receive: 15
  • Posts: 288
    • View Profile
    • Blonde Guy
Re: How to set up CUPS
« Reply #14 on: August 18, 2017, 11:31:00 pm »
I can't print from ArcaOS to an hplip printer, either. I entered a bug report, and I expect it will be fixed eventually. I'm in no rush, because eCS has no problem printing, and I'll migrate to ArcaOS soon after printing works.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com