Can't print: ghostscript fails with "Unable to determine number of pages"

I can’t print anymore from my Librem15rev2 with PureOS. In the /var/log/cups/error_log I find the message

D [08/May/2019:09:45:26 +0200] [Job 488] GPL Ghostscript 9.27: Unrecoverable error, exit code 1
D [08/May/2019:09:45:26 +0200] [Job 488] Process is dying with "Unable to determine number of pages, page count: -1

Apparently this is due to a bug in ghostscript and/or cups-filters. A newer version of the packages apparently fixes this:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926576

Another option would be to downgrade to ghostscript 9.26, but this carried a lot of dependencies, so I decided that this would be too complicated.

Is there an estimate how long it will take until the upgraded packages make it into the PureOS distribution?

Here is further information about my system and the two packages:

uname -a:
Linux librem 4.19.0-4-amd64 #1 SMP Debian 4.19.28-2 (2019-03-15) x86_64 GNU/Linux

user@librem:~$ aptitude versions ghostscript
p 9.26a~dfsg-0+deb9u2 stable 500
i 9.27~dfsg-1 green 700
user@librem:~$ aptitude versions cups-filters
p 1.11.6-3 stable 500
i 1.20.3-1pureos2 green 700

On my system, dpkg is telling me I updated Ghostscript in late April;

/var/log/dpkg.log.1:2019-04-22 13:02:33 upgrade ghostscript-x:amd64 9.26a~dfsg-2 9.27~dfsg-1

Have you updated and upgraded recently?
What does apt update and apt list --upgradable say?

Yes, I update/upgrade daily.

sudo apt update
All packages are up to date

sudo apt list --upgradable
Listing… Done

sudo apt upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So that looks ok.

I tried to downgrade ghostscript (in late April), but then reverted

/var/log/dpkg.log.1:2019-04-23 11:34:39 status installed ghostscript-x:amd64 9.27~dfsg-1

But maybe the real problem is in cups-filters, there i have version 1.20.3-1pureos2 and the bugfix claims the problem is cured in cups-filters 1.22.5.

I use apt-cache policy to get version info on my system, it’s output is a little complex but it gives some solid info;
apt-cache policy cups-filters:
Installed: 1.20.4-1
Candidate: 1.20.4-1
Version table:
*** 1.20.4-1 100
100 /var/lib/dpkg/status
1.20.3-1pureos2 500
500 https://repo.puri.sm/pureos green/main amd64 Packages

So it looks like that package has not yet been updated. That may be an error that requires a report in our tracker: https://metadata.ftp-master.debian.org/changelogs//main/c/cups-filters/cups-filters_1.21.6-5_changelog

I’ll follow up.

Anything new on this? Still can’t print…

I have version 1.21.6-5 here which is in the PureOS repos. I can print from my Librem 13 v3. Have you updated your system?

OK,
in fact in the meantime I can print again, it looks like the problem is solved (but version is still cups-filters 1.21.6-5). Don’t know what has changed.