# Compilation error with LuaLaTeX (luaotfload- database.lua)

This file does not compile after updating TeXLive 2013 :

 \RequirePackage{ifluatex}
\documentclass[12pt]{standalone}
\ifluatex
\usepackage[no-math]{fontspec}
\usepackage[urw-garamond,uppercase=upright,greeklowercase=upright]{mathdesign}
\usepackage{garamondx}
\usepackage[frenchb]{babel}
\else
\usepackage[urw-garamond,uppercase=upright,greeklowercase=upright]{mathdesign}
\usepackage{garamondx}
\usepackage{mathrsfs}
\fi

\usepackage{auto-pst-pdf}
\begin{document}
\psset{xunit=1cm,yunit=1cm,algebraic=true,arrowscale=1.2}
\begin{pspicture}(-2,-3)(5,3)
\psaxes[linewidth=1pt,Dx=1,Dy=1,labels=none,ticksize=-0pt 0pt]{->}(0,0)(-2,-3)(5,3)
\psdots[dotstyle=*](-1,0)
\psdots[dotstyle=*](3,0)

\begin{psclip}
{\psframe[linestyle=none](-2,-3)(5,3)}
{\psplot[linewidth=1pt,plotpoints=2000]{-2}{4}{(1/2)*(x+1)*(x-3)}}%
\end{psclip}
\uput[dl](-1,0){$x_1$}
\uput[dr](3,0){$x_2$}
\uput[d](4.8,0){$x$}
\uput[l](0,2.8){$y$}
\uput[dl](0,0){$0$}
\uput[ur](-1.8,2){$\mathscr{P}$}
\end{pspicture}
\end{document}

attempt to call upvalue 'utf8length' (a nil value).
<to be read again>
relax
l.100 \fontencoding\encodingdefault\selectfont

• I have submitted a bug report github.com/lualatex/luaotfload/issues/164 Restoring the previous version solves the issue (temporarily). – egreg Jan 3 '14 at 11:18
• @egreg Delete the font cache and call luaotfload -u on the command line to rebuild it manually. Then it should work again. See also here github.com/lualatex/luaotfload/issues/156 – Ulrike Fischer Jan 3 '14 at 11:33
• @UlrikeFischer Sorry, but this is by no means an acceptable way of doing things. Users should not be required to do mysterious and undocumented maneuvers. What cache should I remove? Getting an unusable system after an update is not nice, is it? Your situation was different, as you seemed to be testing a beta version. – egreg Jan 3 '14 at 11:37
• @egreg: Run luaotfload-tool --help and you will get the pathes of the font caches. Delete the files there manually. You could also try luaotfload-tool --cache=purge oder --cache=erase. – Ulrike Fischer Jan 3 '14 at 11:41
• @JuriRobl: Yes I meant all the font cache related files. Imho the important files to delete are the files in \texlive\2013\texmf-var\luatex-cache\generic\names, but it is probably a good idea to remove font related files too. Also I just tested the update: After removing the files in \names and running luaotfload-tool --update everything worked fine again. – Ulrike Fischer Jan 3 '14 at 12:07

You mention you use TeXLive. Until a bugfix to the luaotfload package is pushed to the CTAN, you may want to issue the command
sudo tlmgr restore luaotfload 31286

• A new version of luaotfload has been pushed a few minutes ago. – egreg Jan 5 '14 at 0:58