Reputation: 911
I have a GitHub Actions workflow to generate documentation using Sphinx. I use ubuntu-22.04
image for that and I install ghostscript
because it is used somewhere internally to convert a PDF image to a PNG image.
Somehow, it works on my machine (which also runs Ubuntu 22.04 and has the same version of Ghostscript, 9.55.0). However, ti fails on the GitHub actions with an error that I do not quite understand:
Extension error:
convert exited with error:
[stderr]
b"Error: /undefined in https:\nOperand stack:\n (3010)\nExecution stack:\n %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1990 1 3 %oparray_pop 1989 1 3 %oparray_pop 1977 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--\nDictionary stack:\n --dict:771/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--\nCurrent allocation mode is local\nCurrent file position is 14\nGPL Ghostscript 9.55.0: Unrecoverable error, exit code 1\nconvert-im6.q16: no images defined `/home/runner/work/open-interfaces/open-interfaces/docs/build/doctrees/images/ivp_burgers_soln_scipy_ode_dopri5.png' @ error/convert.c/ConvertImageCommand/3229.\n"
[stdout]
The original PDF image is of course in the repository, so I do not understand this "no image defined". Also, I do not quite understand what is /undefined in https:
?
Does anyone know how to resolve this issue? Thanks!
UPDATE: It turned out that the PDF file was just a pointer file (due to Git LFS system), and was not properly checked out.
Upvotes: 1
Views: 60
Reputation: 114947
The actions/checkout by default does a shallow checkout and doesn't restore submodules or download LFS objects. This can cause the repo on the Runner to be different than on your local machine.
In this case images weren't actually present, but just the LFS pointers, causing parsing errors from ghostscript trying to read the "corrupt" files.
Adding:
with:
lfs: true
Will instruct the checkout action to restore LFS objects.
Upvotes: 1