# LuaTeX font database cannot be created in MiKTeX 2.9 [closed]

Quite in a hurry I am trying to setup MiKTeX 2.9 on the computer of a friend of mine. We started with the portable version but the problem is the same in the normal install.

Before the compilation of the .tex-file LuaLaTeX needs the font name database and the creation fails with this error message:

C:\miktex>mkluatexfontdb -vvv

luaotfload | Updating the font names database:
This can take several minutes; please be patient.
luaotfload | Updating the font names database:
[...]
luaotfload | blacklisted file: /System/Library/Fonts/STHeiti Light.ttc
luaotfload | Scanning TEXMF and OS fonts...mkluatexfontdb: Windows API error 67:
The network name cannot be found.
mkluatexfontdb: Data: \\MiKTeX\]MPM[\fonts\opentype


The issue seems similar to this question, which unfortunately received no answers. Any help would be greatly appreciated.

What I can deduce so far from the error message is that mkluatexfontdb wants to access the network server \\MiKTeX which does not exist, and which I have never given as an option to search for. This happens with the current (25.03.12) portable version of MiKTeX 2.9 on Windows 7 64 but I could also reproduce it with the normal version.

In the documentation to luaotfload it is mentioned that %WINDIR%\Fonts will be searched but not any network server and there seems no way to disable this.

Edit: The only vaguely related environment variables are:

HOME=C:\\Users\user
HOMEDRIVE=C:
HOMEPATH=\Users\user
LOCALAPPDATA=C:\Users\user\AppData\Local
LOGONSERVER=\\WIN7
MIKTEX_BINDIR=C:\miktex\miktex\bin
MIKTEX_COMMONSTARTUPFILE=C:\miktex\miktex\config\miktexstartup.ini
MIKTEX_GS_LIB=C:\miktex\ghostscript\base;C:\miktex\fonts
MIKTEX_USERSTARTUPFILE=C:\miktex\miktex\config\miktexstartup.ini
Path=C:\miktex\miktex/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbe
m;C:\Windows\System32\WindowsPowerShell\v1.0    SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\miktex\miktex\temp    TEMPDIR=C:\miktex\miktex\temp    TMP=C:\miktex\miktex\temp    TMPDIR=C:\miktex\miktex\temp    USERDOMAIN=win7
USERPROFILE=C:\Users\user
windir=C:\Windows


2nd edit: The path to the fonts can also not be accessed (MWE):

\documentclass[11pt]{article}

\begin{document}
Example text.
\directlua{tex.print(-2,kpse.expand_path("$OPENTYPEFONTS"))} \end{document}  leads to the following output of lualatex: This is LuaTeX, Version beta-0.70.1-2011080216 (rev 4277) (C:/temp/test1.tex LaTeX2e <2011/06/27> LuaTeX adaptation of babel <v3.8l-luatex-1.4> and hyphenation patterns for engl ish, loaded. (C:/miktex/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (C:/miktex/tex/latex/base/size11.clo)) No file test1.aux. lualatex: Windows API error 67: The network name cannot be found. lualatex: Data: \\MiKTeX\]MPM[\fonts\opentype  This is the output of kpsewhich in the directory of the .tex file: C:\temp>kpsewhich --expand-path=$OPENTYPEFONTS
kpsewhich: Windows API error 67: The network name cannot be found.
kpsewhich: Data: \\MiKTeX\]MPM[\fonts\opentype

• luaoftload searches also the texmf trees and uses some environment variable. So check them (I haven't the time now to investigate.) – Ulrike Fischer Mar 26 '12 at 16:49
• @UlrikeFischer: This is a fresh miktex portable installation. As far as I know there is no other texmf besides the installation directory. – Alexander Mar 26 '12 at 22:27
• What do you get if you run in a document (with fontspec if possible, but without is also ok) \directlua{tex.print(-2,kpse.expand_path("\$OPENTYPEFONTS"))}? – Ulrike Fischer Mar 27 '12 at 7:02
• @UlrikeFischer: Thank you for looking into this, I added the output of the command you proposed. Additionally I tried with the fontspec package but received the same error message. – Alexander Mar 27 '12 at 11:55
• Hm. You are saying the document (without fontspec!) above leads to the same error? Then it can't be directly related to mkluatexfontdb. Does it disappear if you use e.g. \directlua{tex.print(-2,"abc")}? – Ulrike Fischer Mar 27 '12 at 12:03