-
Notifications
You must be signed in to change notification settings - Fork 150
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
Cannot build PDFs: notoserif-regular-subset.ttf not found in GEM_FONTS_DIR (v1.8.0 and later) #214
Comments
Hello @p- , thanks for reporting! Could you provide a reproduction case please? The reason I'm asking is because the test harness has a PDF generation step that succeeded for the 1.8.0 (or the deploy would never have been done):
The goal would be to add the failing case to the test harness or improve the current test to underline the bug you are reporting, so we could fix it with confidence |
I cannot reproduce with the current test case: $ docker run -ti --rm -v $(pwd):/$(pwd) -w $(pwd) --entrypoint=bash asciidoctor/docker-asciidoctor:1.8.0
Unable to find image 'asciidoctor/docker-asciidoctor:1.8.0' locally
1.8.0: Pulling from asciidoctor/docker-asciidoctor
5843afab3874: Already exists
28814869329d: Pull complete
8b2a934ca54a: Pull complete
d65b6e48ce97: Pull complete
34b04e24c8a5: Pull complete
4c3f5e13c98b: Pull complete
76a3c5edf6fa: Pull complete
389fbb2d561c: Pull complete
Digest: sha256:2b88303c2f10f3d7a4823dfab5b34d990d91145e9440a37166f0c5549fab8c65
Status: Downloaded newer image for asciidoctor/docker-asciidoctor:1.8.0
bash-5.1# asciidoctor-pdf --version
Asciidoctor PDF 1.6.0 using Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux-musl]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
bash-5.1# asciidoctor-pdf -r asciidoctor-mathematical -D $(pwd) ./tests/fixtures/basic-example.adoc
bash-5.1# ls -ltr *.pdf
-rw-r--r-- 1 root root 54833 Jul 20 09:04 basic-example.pdf I assume there is a directive in your adoc file that triggers the error: if you can share the reproduction, we could add the directive(s) to the test case |
Hi @dduportal I'll have a look at our Adocs and report back, what might be the problem. |
Hi @dduportal Unfortunately, I have no very good repro at the moment. For some reasons, I seem to get the error with an empty This should be the command that seems to lead to the error: (I have to verify that this is the right command, since it's concated.) With
|
Ah I can reproduce the error like this:
Then create an empty file inside the docker container (it's the same for files with content):
Writes following:
|
I'm not able to reproduce this problem in my own testing. I am curious why you're using |
It's possible that in your environment, the file isn't readable for some reason. You could try to put a debug statement at the line in question inside the container and see if there is a reason it cannot find the file. |
That is weird, I cannot reproduce it at all. I suspect there is something related to the default user / UID of the shared volume. I'll need the following element from you:
|
Actually, there is something even more fishy about this. You should never be seeing an error message that says "not found in GEM_FONTS_DIR". That value should be resolved to a concrete location. There has to be a reason it is not getting recognized. Specifically, this line is not getting hit properly in your environment: dir == 'GEM_FONTS_DIR' || dir.empty? ? ThemeLoader::FontsDir : dir |
Good news! (Sort of) I updated my local Docker before I saw @dduportal's new comment. My local Docker Engine/Server version is now 20.10.7. (Previously a recent Docker Engine 19.03.xy was in use.) => No issues with a recent Docker version. Revert to Docker Desktop Community 2.5.0.1 (Docker Engine 19.03.13)=> Now the issue occurs again. So on another macOS-system I reverted back to following Docker version: Docker Desktop Community 2.5.0.1 (released on 2020-11-10) @dduportal: here are the result for the non-working Docker-version:
@mojavelinux Yeah, that was a copy and paste oversight. (The reference to asciidoctor-mathematical is also not necessary) => So it seems to have a connection to the Docker version (it seems not to work with Docker Engine 19.03.xy) 🤔 |
Thanks for the additional informations. I was able to reproduce on a stock Docker 19.03 by using "Docker in Docker": $ docker run --privileged --detach --name dind docker:19.03-dind
# ...
$ docker exec -ti dind sh
/ # docker run --rm --entrypoint=bash asciidoctor/docker-asciidoctor:1.8.0 -c "touch index.a
doc && asciidoctor-pdf ./index.adoc"
Unable to find image 'asciidoctor/docker-asciidoctor:1.8.0' locally
1.8.0: Pulling from asciidoctor/docker-asciidoctor
5843afab3874: Pull complete
28814869329d: Pull complete
8b2a934ca54a: Pull complete
d65b6e48ce97: Pull complete
34b04e24c8a5: Pull complete
4c3f5e13c98b: Pull complete
76a3c5edf6fa: Pull complete
389fbb2d561c: Pull complete
Digest: sha256:2b88303c2f10f3d7a4823dfab5b34d990d91145e9440a37166f0c5549fab8c65
Status: Downloaded newer image for asciidoctor/docker-asciidoctor:1.8.0
No such file or directory - notoserif-regular-subset.ttf not found in GEM_FONTS_DIR
Use --trace for backtrace Gotta check what is wrong to see if we could have a fix, but I would prefer adding a documentation note. |
Hi @dduportal My colleague thinks, that it might be connected to this runc issue: So this issue seems to stem from the Alpine Linux 3.14.0 Update:
|
Would you be able to check the line I referenced above and figure out why it is not being called? The program is clearly running, but for some reason it isn't executing that line. And I'm really curious to know why. |
@mojavelinux it looks like that the issue is related to the use of Alpine. Let me try on Debian and with the older version of Alpine (3.13) as well |
@dduportal As per my comment #214 (comment), we are pretty sure that it's connected to an improvement in Alpine Linux 3.14.0.
I think the easiest fix for the moment is to downgrade the base image of docker-asciidoctor to Alpine Linux 3.13. until everyone had a chance to update their Docker versions. Alpine Linux 3.13 is supported until 2022-11-01. I want to make clear that the issue does not lay with docker-asciidoctor itself. But I think downgrading the image would lead to less issues for the moment ;) |
@p- thanks for your diagnostic (and your colleague' ;) ). Your proposal sounds really good! Incoming PR :) |
@dduportal Thank you as well! PS: I edited my comment above: every version of Alpine Linux that starts with 3.13. Should be ok. So you should be able to use 3.13.5 for example. |
…sciidoctor#215 Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
The latest image (release / # docker run --rm --entrypoint=bash asciidoctor/docker-asciidoctor:1.9.0 -c "touch index.adoc && asciidoctor-pdf ./index.adoc"
Unable to find image 'asciidoctor/docker-asciidoctor:1.9.0' locally
1.9.0: Pulling from asciidoctor/docker-asciidoctor
540db60ca938: Pull complete
4c307766f4ab: Pull complete
c8d1ef386902: Pull complete
eb6dd1c4c18e: Pull complete
9f303379e54a: Pull complete
50506f7936da: Pull complete
220ca7927074: Pull complete
ef49a045013d: Pull complete
Digest: sha256:781f0d37a2d0d85997577794e298afd8bae588ea8ee07d56713e63a838776249
Status: Downloaded newer image for asciidoctor/docker-asciidoctor:1.9.0
/ # docker run --rm --entrypoint=bash asciidoctor/docker-asciidoctor:1.8.1 -c "touch index.adoc && asciidoctor-pdf ./index.adoc"
Unable to find image 'asciidoctor/docker-asciidoctor:1.8.1' locally
1.8.1: Pulling from asciidoctor/docker-asciidoctor
5843afab3874: Pull complete
fd54b4ee913e: Pull complete
bb037a87f9e3: Pull complete
acdefd8081e6: Pull complete
2ecf1a8f9727: Pull complete
584f378a7f00: Pull complete
62399cd1378c: Pull complete
d9b426198514: Pull complete
Digest: sha256:338fd558d6865f19647109700b6620a7462db99d37687f92d11fa2aa8eb9424f
Status: Downloaded newer image for asciidoctor/docker-asciidoctor:1.8.1
No such file or directory - notoserif-regular-subset.ttf not found in GEM_FONTS_DIR
Use --trace for backtrace Let us know if it is ok for you? |
@dduportal Yeah it seems to work. Thank you very much! |
Hello
Thanks for creating the docker-asciidoctor image!
Since Version 1.8.0 and later, we cannot build PDFs anymore because of this error:
Do you have an idea what could be the cause?
The text was updated successfully, but these errors were encountered: