Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ocrmypdf v15.1.0+git8.2b0e1498 (snap): GPL Ghostscript 9.55.0: Can't find initialization file gs_init.ps. ghostscript.py:118 #1167

Open
zWhdmB5T opened this issue Oct 12, 2023 · 16 comments · May be fixed by #1300
Assignees
Labels
bug help wanted snapcraft third party issue Problem with a third party dependency

Comments

@zWhdmB5T
Copy link

What were you trying to do?

System

  • OS: openSUSE Leap 15.5 x86_64
  • ocrmypdf v15.1.0+git8.2b0e1498 101 latest/stable shael7aerien -
    snapd 2.60.4 20290 latest/stable canonical✓ snapd

Bug

  • GPL Ghostscript 9.55.0: Can't find initialization file gs_init.ps. ghostscript.py:118

Where are you installing from?

Ubuntu snap

What operating system are you working on?

Linux

Relevant log output

Scanning contents     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 184/184 0:00:00
Start processing 4 pages concurrently                                                                                                                                            _sync.py:265
    1 GPL Ghostscript 9.55.0: Can't find initialization file gs_init.ps.                                                                                                   ghostscript.py:118
                                                                                                                                                                                             
OCR                   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0%   0/184 -:--:--
SubprocessOutputError: Ghostscript rasterizing failed                                                                                                                            _sync.py:450
@jbarlow83
Copy link
Collaborator

Command line?

@jbarlow83 jbarlow83 removed the bug label Oct 13, 2023
@zWhdmB5T
Copy link
Author

zWhdmB5T commented Oct 13, 2023

Sorry…
my regular command line
/snap/bin/ocrmypdf --language deu+eng+grc+lat --output-type pdfa --rotate-pages --deskew --clean Test-PDF.pdf Test-PDF.pdf
but also the same error for
/snap/bin/ocrmypdf Test-PDF.pdf Test-PDF.pdf
or
/snap/bin/ocrmypdf Test-PDF.pdf Test-PDF-out.pdf

@zWhdmB5T
Copy link
Author

zWhdmB5T commented Oct 13, 2023

addition:
OCRmyPDF was working properly and find around one week ago, back then it was version 14.x.y by snap (can't remember specific version).
It was recently updated automatically by snap to the version stated above and now throws the stated error. I haven't changed my system otherwise except for regular updates (but no installs or removes).
I almost always use the command
/snap/bin/ocrmypdf --language deu+eng+grc+lat --output-type pdfa --rotate-pages --deskew --clean Test-PDF.pdf Test-PDF.pdf
I just shortened it for this case to
/snap/bin/ocrmypdf Test-PDF.pdf Test-PDF-out.pdf

@jbarlow83
Copy link
Collaborator

Inside the snap the envvar GS_LIB is:

$ snap run --shell ocrmypdf
$ env
GS_LIB=$SNAP/usr/share/ghostscript/9.55/Resource/Init

whereas the actual installed location is
$SNAP/usr/share/ghostscript/9.55.0/Resource/Init (note the .0)

This inconsistency seems like it has to do with Ubuntu's packaging of ghostscript.

The snap documentation is quite thin. Can't find any description of how to manage runtime environment variables and
override this, or create a symlink within the image so that the two locations are equivalent. Can you offer any input?

@jbarlow83 jbarlow83 added bug third party issue Problem with a third party dependency labels Oct 13, 2023
@zWhdmB5T
Copy link
Author

zWhdmB5T commented Oct 13, 2023

just FYI: I did snap revert to
ocrmypdf v14.2.1+git4.5a82ad63 75 latest/stable shael7aerien -
Now, it works properly and fine again.

@jbarlow83
Copy link
Collaborator

Yes, the old image is based on Ubuntu 20.04 and new one is on 22.04. Ocrmypdf 15 doesn't support the 20.04 dependencies anymore, and the problem is something wrong with how Ghostscript is packaged in 22.04.

@Ccrlll

This comment was marked as off-topic.

@jbarlow83
Copy link
Collaborator

@brlin-tw Any chance you can help with this since you previously helped with the ocrmypdf snap?

@brlin-tw
Copy link
Contributor

Sure I'll check it out, no promises for any ETAs, though.

@loxK
Copy link

loxK commented Nov 2, 2023

I have this exact issue, tried the pip3 version, same issue.

@zWhdmB5T
Copy link
Author

zWhdmB5T commented Nov 10, 2023

There are new Snap Edge releases at Install OCRmyPDF on Linux | Snap Store… Do they work? I am wondering a bit because @jbarlow83 hasn't said yet that the issue is resolved.

@jbarlow83
Copy link
Collaborator

The build script are configured to auto-release new versions of the main code, but I don't know much about snap or how to fix the snap-specific issues that are coming up. Snap is on the chopping block at this point - I tried to fix it, but I can't find answers to basic questions about how snap is supposed to work in its official documentation, so I'm hoping others with domain knowledge will be able to fix it.

@zWhdmB5T
Copy link
Author

OK, understood. Maybe, @brlin-tw can help as you asked him before. Or someone else having knowledge about Snap.

Hopefully, this issue can be resolved, so I can upgrade from v14 to v15 of OCRmyPDF Snap.

@brlin-tw
Copy link
Contributor

OK, understood. Maybe, @brlin-tw can help as you asked him before. Or someone else having knowledge about Snap.

I plan to investigate this issue in the next few days, when there's any progress I'll make sure to let you know.

@zWhdmB5T
Copy link
Author

zWhdmB5T commented Feb 20, 2024

@jbarlow83 @brlin-tw Sorry for this inquiry. Any news on this issue? Or is it unsolvable? (Would like to update my local snap after a while…)

@brlin-tw
Copy link
Contributor

brlin-tw commented Apr 8, 2024

@jbarlow83 @brlin-tw Sorry for this inquiry. Any news on this issue?

Apologies for the ignorance, unfortunately I'm being out-of-capacity recently and got little time looking into it, I'll make sure to let you know if there's any progress(or, in a very unlikely event, not fixable).

@helkaluin helkaluin linked a pull request Apr 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted snapcraft third party issue Problem with a third party dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants