17

I installed a new hard drive on my computer this summer and I'm trying to install MiKTeX on it now. There were no problems when I was using my old hard drive. My OS is Windows 8.1. I'm trying to compile the following very basic file with pdfLaTeX:

\documentclass{article}
\begin{document}  
hi  
\end{document}

Here's the first error I get:

Sorry, but "MiKTeX Configuration Utility" did not succeed.    
The log file hopefully contains the information to get MiKTeX going again:
  C:/Users/Tyler/AppData/Local/MiKTeX/2.9/miktex/log/initexmf.log

You may want to visit the MiKTeX project page (http://miktex.org), if you need help.

With the following errors in the log:

2015-09-03 22:23:51,625-0400 INFO  initexmf - starting: MiKTeX Configuration Utility 2.9.5700 (MiKTeX 2.9 64-bit)   
2015-09-03 22:23:51,631-0400 FATAL initexmf - Windows API error 32: The process cannot access the file because it is being used by another process.
2015-09-03 22:23:51,631-0400 FATAL initexmf - Info: C:\Users\Tyler\AppData\Local\MiKTeX\2.9\miktex/data/le\1e0c0e04cb3be262fbb8e6e7ace14b67.fndb
2015-09-03 22:23:51,631-0400 FATAL initexmf - Source: Libraries\MiKTeX\Core\win\winFile.cpp
2015-09-03 22:23:51,631-0400 FATAL initexmf - Line: 520

The second error:

Sorry, but C:\Program Files\MiKTeX 2.9\miktex\bin\x64\miktex-pdftex.exe did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
  C:/Users/Tyler/AppData/Local/MiKTeX/2.9/miktex/log/miktex-pdftex.log

You may want to visit the MiKTeX project page (http://miktex.org), if you need help.

with the following errors in the log:

2015-09-03 22:16:18,715-0400 INFO  miktex-pdftex - running 'initexmf --quiet --update-fndb' to refresh the file name database
2015-09-03 22:16:18,746-0400 FATAL miktex-pdftex - The operation failed for some reason.
2015-09-03 22:16:18,746-0400 FATAL miktex-pdftex - Info: C:\Program Files\MiKTeX 2.9\miktex\bin\x64\initexmf.exe
2015-09-03 22:16:18,746-0400 FATAL miktex-pdftex - Source: Libraries\MiKTeX\Core\Process.cpp
2015-09-03 22:16:18,746-0400 FATAL miktex-pdftex - Line: 290

Things I've tried:

  • Uninstalling and reinstalling MiKTeX
  • Downloading all packages whose name starts with miktex (which is a solution that worked for someone else in a different thread)
  • Having nothing open but TeXworks when trying to compile
  • Looking for processes that may be related to MiKTeX in the task manager (I didn't find any)

How can I stop these errors? I apologize if my formatting is bad; this is my first stackexchange question. Thank you for your help.

trb123
  • 273
  • 1
  • 2
  • 6
  • 1
    Welcome to TeX.SX! – Heiko Oberdiek Sep 04 '15 at 02:58
  • The report suggests that TeXworks has some file locking actions (it does indeed block those .fndb files), maybe you can close it and compile from the command line in the mean time. – moewe Sep 04 '15 at 07:55
  • Close texworks. Compile your document in some other editor or on the command line so that miktex can do whatever it wants to do. There is a bug report that texworks currently interferes https://sourceforge.net/p/miktex/bugs/2394/ – Ulrike Fischer Sep 04 '15 at 08:42
  • 2
    I had the same problem today, and closing texworks and deleting the .fndb files fixed it – M.M Sep 08 '15 at 11:49
  • Maybe it worth adding that digging deeper into the log files gives an error/info pointing to a .fndb file in C:\ProgramData\MiKTeX\2.9\miktex/data/le. – moewe Sep 08 '15 at 12:43
  • @moewe: But in my case the files aren't updating. How to fix it? –  Sep 10 '15 at 03:34
  • @user170039 Make sure to have TeXworks and all other TeX stuff closed. Then it should be enough to open the MikTeX updater in both the Admin and User version and let the update go through. (Though read How should one maintain and update a MiKTeX installation? - I can't say I have ever had any problems, but just to make sure). It could also be (it becomes increasingly unlikely - very unlikely) that your updater chose an old mirror, in that case just retry. – moewe Sep 10 '15 at 05:53
  • @moewe: The update for Admin version works fine but while repeating the same process to the User version I got error. –  Sep 10 '15 at 13:27
  • @moewe: I am installing miktex again. Once I get the error I will tell you. However, in one of your earlier comment you said, "deleting the temporary .fndb files C:\Users\Moritz\AppData\Local\MiKTeX\2.9\miktex\data\le after an update helped". It means that I have to update first right? –  Sep 10 '15 at 13:40
  • @moewe: The error is Unknown MikTeX exception. –  Sep 10 '15 at 13:46
  • @moewe: I don't know. Is the error message due to this? –  Sep 10 '15 at 13:47
  • Confirmed texworks working after deleting .fndb files (Windows 8.1 x64, MikTeX 2.9) – Umesh .A Bhat Sep 30 '15 at 07:52

1 Answers1

12

Close texworks.

Compile your document in some other editor or on the command line so that miktex can do whatever maintenance tasks it wants to do. There is a bug report that texworks currently interferes with miktex: http://sourceforge.net/p/miktex/bugs/2394/.

This bug shouldn't affect normal compilation later on.

moewe
  • 175,683
Ulrike Fischer
  • 327,261
  • The issue seems to have been addressed with the 2015-09-08 update of MikTeX (the MikTeX database). After an update (for which one will have to close TeXworks) on-the-fly installation of packages works fine again. (It might take another day for the update to propagate to all mirrors, though currently the update has been received by roughly one half of the mirrors listed on the MikTeX page) – moewe Sep 09 '15 at 07:22
  • @moewe : I downloaded MiKTeX today and I had this problem, so apparently the fix is not implemented everywhere yet. – Michael Hardy Sep 11 '15 at 01:28
  • @MichaelHardy Of the 260 repositories that are currently up and running, there are now only 8 that ship an outdated version of the MikTeX repository. – moewe Sep 11 '15 at 06:54
  • @moewe I just downloaded MikTex for the first time on a Windows 7 machine and encountered the same problem as the OP listed as "second error" in the original question. I uninstalled, reinstalled, and got the same result. Based on your 9/11/15 comment, one would think this problem is resolved for new downloads. Was this really fixed? – Brick Sep 23 '15 at 19:12
  • @Brick Even after a new download it can be necessary to run the Updater facilities to get an up-to-date system. Because the version you get will be based on the repositories at the time of packing the installer which might be older. The MikTeX download page says "When you have installed MiKTeX, it is recommended that you run the update wizard in order to get the latest updates." – moewe Sep 24 '15 at 04:49
  • @moewe When I try to install the updates I get the same error message as when typesetting a document. Installing updates as admin doesn't work due to api 87 something. – Erik Vesterlund Sep 24 '15 at 12:08
  • @moewe Thanks! After running the Updater it works for me! – Brick Sep 24 '15 at 13:31
  • @ErikVesterlund When trying to update you will have to have TeXworks and all other TeX related programmes closed. – moewe Sep 25 '15 at 10:20
  • Today I had The second error mentioned by the OP. Compiling on the command line did nothing. After uninstalling MikTex from Control Panel and reinstalling, everything seems to work. – Sander Heinsalu Nov 07 '16 at 05:15
  • 2
    I just installed miktex afresh and this problem is staying no matter what I do; I think there was another update that undid everything good :). – Hari Rau-Murthy Dec 29 '16 at 03:38