Overleaf: Lualatex & fontspec error: "fix your writable cache path"

Created on 25 Jul 2016  路  4Comments  路  Source: overleaf/overleaf

I use the current docker container of sharelatex.
When I am trying to compile a document with lualatex, compilation always fails when loading the fontspec package with the message "fix your writable cache path"

I can reproduce the error with the example document by simply adding "\usepackage{fontspec}" and setting the compiler to lualatex.

Strangely enough, when I enter the container on the command line ("docker exec -it bash") and run lualatex on the project files, it works.

Most helpful comment

@bonanza123 I just dropped into an interactive shell in the container, created the directory .texlive2016 in /var/www and used chown to give it to the user www-data. Then everything worked. However, like the OP, I'm using LuaLaTeX and fontspec. If I remember correctly, I didn't have to do this for XeLaTeX and fontspec, so it's possible your issue may lie elsewhere.

Also I imagine the dockerfile could be edited to add this directory automatically when the container is initialised (or do something cleaner), but I don't really know too much about Docker.

All 4 comments

Ran into this issue as well, but I have a solution/workaround.

So the problem seems to be that www-data (the user that compiles your docs) doesn't have a writable ~/.texlive2016/texmf-var/luatex-cache/... directory. I managed to fix this issue by creating those dirs in /var/www/ and chowning them to www-data.

@dmyates That's interesting. I guess I had a similar issue with XeLatex and fontspec. Can you give me some details how you fixed that? Thanks in advance.

@bonanza123 I just dropped into an interactive shell in the container, created the directory .texlive2016 in /var/www and used chown to give it to the user www-data. Then everything worked. However, like the OP, I'm using LuaLaTeX and fontspec. If I remember correctly, I didn't have to do this for XeLaTeX and fontspec, so it's possible your issue may lie elsewhere.

Also I imagine the dockerfile could be edited to add this directory automatically when the container is initialised (or do something cleaner), but I don't really know too much about Docker.

For server pro users this is fixed with https://github.com/sharelatex/sharelatex-docker-image/commit/912141a7a84802c1964583382104feb5bbdc7b67

Will close this issue as the answers will work for most people

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ranomier picture ranomier  路  4Comments

adrianvb picture adrianvb  路  5Comments

luspi picture luspi  路  4Comments

vitorbaptista picture vitorbaptista  路  8Comments

ShellCode33 picture ShellCode33  路  4Comments