0

I have just installed MiKTex 2.9 in Windows 7. I had this problem and fixed it by deleting the .fndb files.

The first time I try to compile a "hello world" .tex file , a window pops up titled Package Installation telling me that a file is missing and I need to install the package cmap.

I click Install and it shows, after downloading the package, Unfortunately, the package cmap could not be installed.Please check the log file: C:/Users/Matt/AppData/Local/MiKTeX/2.9/miktex/log/pdflatex.log.

The log file contains:

2015-09-08 23:55:22,798+1200 INFO  pdflatex - installing package cmap triggered by tex\latex\cmap\cmap.sty
2015-09-08 23:55:25,488+1200 INFO  pdflatex - mpm: starting package maintenance...
2015-09-08 23:55:25,488+1200 INFO  pdflatex - mpm: installation directory: "F:\Prog\MiKTeX 2.9"
2015-09-08 23:55:25,488+1200 INFO  pdflatex - mpm: package repository: http://mirror.aut.ac.nz/CTAN/systems/win32/miktex/tm/packages/
2015-09-08 23:55:25,728+1200 INFO  pdflatex - mpm: lightweight database digest: fd7a40a42ed2f1e70be3b6bdb1baccf2
2015-09-08 23:55:25,738+1200 INFO  pdflatex - mpm: going to download 7251 bytes
2015-09-08 23:55:25,738+1200 INFO  pdflatex - mpm: going to install 14 file(s) (1 package(s))
2015-09-08 23:55:25,738+1200 INFO  pdflatex - mpm: downloading http://mirror.aut.ac.nz/CTAN/systems/win32/miktex/tm/packages/cmap.tar.lzma...
2015-09-08 23:55:25,908+1200 INFO  pdflatex - mpm: 7251 bytes, 41.65 KB/Sec
2015-09-08 23:55:25,918+1200 INFO  pdflatex - mpm: extracting files from cmap.tar.lzma...
2015-09-08 23:55:25,938+1200 FATAL pdflatex - Windows API error 87: The parameter is incorrect.

I have found that if I close TeXworks and open the MiKTex Package Manager, I can enter cmap and install the package successfully. But then when I reopen TeXworks and build my file again, the exact same thing happens but with babel-english instead of cmap. I have no idea how many packages it is going to need and this could be very time-consuming...

Is there a way to fix the auto package download?

I tried installing package ms as suggested here but that did not fix the problem.


Update: I discovered that if I run the Package Manager while TexWorks is still open, then the package installation for babel-english fails with the same Windows API error 87: The parameter is incorrect. but it gives extra information:

Data: C:\ProgramData\MiKTeX\2.9\miktex/data/le\0830eb7b3437d95b9288750893206d6f.fndb

So I wonder if this problem is related to or in fact the exact same problem as the first one.

M.M
  • 101
  • 2
  • As a workaround, I have found that if I use a command prompt and run pdflatex myfile.tex then the package autoinstallation works correctly – M.M Sep 08 '15 at 12:09
  • 1
    There is currently a bug in TeXworks, it seems to block MikTeX's administrative/installing processes from working by blocking the C:\ProgramData\MiKTeX\2.9\miktex/data/le files. You can only install packages when TeXworks is closed. The issue is being worked on (see bug report #2394). In the meantime compile from the command line if you need on-the-fly install or use another editor. – moewe Sep 08 '15 at 12:10
  • 4
    I'm pretty sure your problem is an exact duplicate of the other question. If you don't insist on keeping your question open, I would like to close this one hare as a duplicate. You might want to consider adding your workarounds as a answer in the other questions, so people can benefit from it. (If you feel that is appropriate.) – moewe Sep 08 '15 at 12:40
  • @moewe well - it is the same cause, although this question had very different symptoms to what was reported in the other question (which did not mention "error 87" at all). So hopefully my question still shows up when people search for "error 87" or "The parameter is incorrect". – M.M Sep 08 '15 at 22:38
  • Your question will still show up, as far as I know; and I was a bit concerned about the fact that the very prominent "Error 87" was not mentioned in the other question as well. I think though that the bug at the heart of this problem can have many different symptoms, and leaving open and answering questions for all the symptoms doesn't seem very helpful to me, it is easier if all of these symptoms are bundled into one question. It might be OK though to edit the question to add additional information or ad another answer, if you feel that can help others with the same problem. – moewe Sep 09 '15 at 05:40
  • @moewe OK. I'd guess that the problem is that a previous system call fails, the code doesn't check return value, and then passes a failure code to a later system call that expects a file handle or something. – M.M Sep 09 '15 at 06:34
  • 1
    You will be happy to know that the issue seems to be resolved with the 2015-09-08 update of MikTeX. After an update (with TeXworks clsoed, of course), on-the-fly installation works again with TeXworks open. – moewe Sep 09 '15 at 07:28

0 Answers0