Forum archive 2000-2006

Jason Farmer - Yet Another Latex Problem

by Arnold Pizer -
Number of replies: 0
 Yet Another Latex Problem topic started 4/15/2004; 3:20:08 PMlast post 4/27/2004; 12:15:13 PM
 Jason Farmer - Yet Another Latex Problem  4/15/2004; 3:20:08 PM (reads: 3442, responses: 18) Hello again all! For some reason last week, without being "touched" our TeX installation decided to take a nose dive. I have traced our problem through our error logs to the following line: I can't find the format file latex.fmt'! After doing some reasearch I found that many people solved this by doing the texhash, command, but that did not solve the problem. Then I saw elsewhere to make sure that your definitions in the texmf.cnf file are correct, did that as well, and everything seems fine, as I say, it all worked before and nothing has changed. Finally I saw someone re-run the post-install scripts for teTeX, such as: So I also tried these, and still nothing. Any suggestions from "the pros" out there? :)<| Post or View Comments |>

 John Jones - Re: Yet Another Latex Problem  4/15/2004; 4:04:56 PM (reads: 3654, responses: 0) Does latex work from the command line for you as a user? If so, what if you login as the username the web server runs under.  Does it work from the command line for the web server's username? John<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/15/2004; 4:21:17 PM (reads: 3655, responses: 0) Apache right now is running as root. It did not used to be this way. And yes latex works fine from the command line. It only has problems when invoked via Webwork.<| Post or View Comments |>

 John Jones - Re: Yet Another Latex Problem  4/15/2004; 6:26:30 PM (reads: 3660, responses: 0) It sounds like environment variables may be an issue - they certainly influence where tex will look for files. When you say that the web server runs as root (which sounds dangerous) but that it hasn't always been that way, did it change around the time latex stopped working? So, if you login as root, then latex runs fine, right?  Then, while still logged in as root, see how environment variables are set.  Under csh, the command printenv should do it.  Under bash, just set will list them.  To select things which might be related to TeX, I would use (under bash), set | grep -i tex . The next step might be to see what this looks like from the web server.  I would insert a system command to do the same, but pipe its output to a file (e.g., system('set | grep -i tex >> /tmp/WW-envir')) somewhere in webwork, trigger it, and then look at the result (and then take the extra statement out).  There are probably smoother ways to check this. John<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/18/2004; 7:42:10 PM (reads: 3618, responses: 0) I'm checking into this now. I do recall Apache originally running as our webwork account, and I do not have root access, therefore it would have to of been started by an administrator here. So I am looking into how we may be able start Apache once again as webwork. A question I thought of however, even though we have absolute path's defined for all of webwork's and teTeX's settings, would it still use environment variables for things like that? Thanks again for the quick response.<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/25/2004; 12:03:49 PM (reads: 3622, responses: 0) So here is what I have found out after consulting our system admin. We are running Apache correclty (initial process is started as root to bind to port 80, but all threads are being produced as our webwork user) After doing some further investigation, we discovered a style file that was causing problems (aparently missing). So we replaced that file, and Latex will run smoothly when invoked again by the command prompt. In the welcomeAction.pl script we added some output that output the exact line from which Latex is invoked, and when copied to our shell, runs perfectly. So it still seems like some configuration has changed which prevents Latex when running within Apache to get to the same path configurations as our shell. But our system admin consistantly says Apache is running correctly. Any ideas?<| Post or View Comments |>

 John Jones - Re: Yet Another Latex Problem  4/26/2004; 1:09:08 AM (reads: 3619, responses: 0) Since these happen differently for the web server, you should try to get a closer look at what's happening there.  In lib/Global.pm, you can set imageDebugMode to 1.  Then have webwork generate a pdf (or whatever is failing), and look in the error log.  Webwork may also leave the .aux file for you.  Either of these should have information about what is going wrong. John<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/26/2004; 9:46:01 AM (reads: 3601, responses: 0) I'm not sure if this problem is related, but when the logPrint() function gets called in welcome action, it also gives an error saying that it cannot find the logfile: path= /home/webwork2/webwork/system/courses/Math121-Spring04-ESorensen2/html/tmp/Temp_downloadAllSets_admin.log No such file or directory I think that this is just because latex never created the log file when it was run. Basically it didn't get that far in the process. Here is the output I can get from latex: This is TeX, Version 3.14159 (Web2C 7.3.1) (/home/webwork2/webwork/system/courses/Math121-Spring04-ESorensen2/html/tmp/Tem p_downloadAllSets_admin.tex LaTeX2e <1999/12/01> patch level 1 Babel and hyphenation patterns for american, french, german, ngerman, n ohyphenation, loaded. And that's all I get. Normally it ends with "(1 pages of output)" or something like that. But nothing, no errors, no missing files. Is there some type of debug mode in latex?<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/26/2004; 9:52:04 AM (reads: 3597, responses: 0) I take that back. That output I found was from the command line only. There is no output from the webwork invoked latex command (where it does the >>error_log after the latex command). Also the "(1 pages of output)" is from dvipng :) I am thinking about going in and adding some other redirection or turning on what I think is debug mode for latex WITHIN WEBWORK. In other words adding -kpathsea-debug=NUMBER   set path searching debugging flags according to                           the bits of NUMBER to my DVI command line. Think this might give some relevant data?<| Post or View Comments |>

 John Jones - Re: Yet Another Latex Problem  4/26/2004; 12:43:38 PM (reads: 3576, responses: 0) Latex does not usually say anything about the existence of its log file.  Maybe it is a permissions problem and latex is really complaining that it cannot create its log (and other output files). Second, you might comment out lines which unlink the files webwork/latex creates. Does latex work on the .tex file created by webwork?  If you prevent webwork from cleaning up the files, are there really no .aux, .dvi, and .log files? John<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/26/2004; 2:26:57 PM (reads: 3609, responses: 0) Well I checked all the permissions on everything once again (this was one of the first things I did) and they all look correct. I also uncommented out the unlink line, and the files exist from previous debugging sessions, and when I try to download them through webwork using the "Get Hard Copy", it gives me a different error page, without all of the *.tex output, but still the same "Software Error" message. If I remove the files from a previous (working) session I get the original error message including the fact that it cannot find the log file. The only thing that sits in the directory is the *.tex file from the process no .aux, .dvi, or .log files. Again, I can run the command which Webwork invokes in welcomeAction.pl: /home/webwork2/local/teTeX/bin/latex /home/webwork2/webwork/system/courses/Math103-Spring04-ESorensen2/html/tmp/Temp_downloadAllSets_admin.tex >>/home/webwork2/webwork/system//logs/error_log 2>>/home/webwork2/webwork/system//logs/error_log And everything works perfectly. I really appreciate your help John. I hope we can get this resolved. :)<| Post or View Comments |>

 John Jones - Re: Yet Another Latex Problem  4/26/2004; 5:36:37 PM (reads: 3594, responses: 0) I am being a little slow on the uptake here.  Webwork is complaining that it can't find the log file, which seems to be because it was not created. I would do all of the following:clear away all old files from the html/tmp directoryset imageDebugMode to 1comment out all lines which clean up .log fileschmod -R 777 /home/webwork2/webwork/system/courses/MAT103-Spring04-Esorensen2/html/tmp.in the templates directory, edit texSetPreamble.tex and change batchmode to nonstopmode Now you try to download a pdf file.  We expectthis will faila .tex file is created, but nothing elsethe .tex file works when you run it through latex by hand Then let us know what gets put into the system log file.  The change to nonstopmode should make it more informative. John<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/26/2004; 7:47:00 PM (reads: 3610, responses: 0) Ahh great, now we have some output. Following all the steps, yes the creation did fail. A tex file now exists, but nothing else. And when I manually invoke the latex command it works perfectly. However in webwork's error log I get the following: This is TeX, Version 3.14159 (Web2C 7.3.1) I can't find the format file latex.fmt'! This is dvips(k) 5.86 Copyright 1999 Radical Eye Software (www.radicaleye.com) /home/webwork2/local/teTeX/bin/dvips: ! Couldn't find header file tex.pro What is strange however is that the tex log is still not being created (even with the permissions to the directory set to 777) and latex still works from the command line.<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/27/2004; 10:12:32 AM (reads: 3573, responses: 0) A note on this the file exists, as it is supposed to :) Just wanted to add that.<| Post or View Comments |>

 John Jones - Re: Yet Another Latex Problem  4/27/2004; 11:25:15 AM (reads: 3556, responses: 0) Can you login under the username the web server uses?  It sounds like that user is the one with problems.  If you can login as that user and latex does not work, then at least you can test things interactively. You could check the permissions on the latex.fmt file and the directory it is in (.../texmf/web2c) to be sure they are world readable (and the directory is world executable).  If you are the user who has trouble, you could look at kpsetool -p fmt to see where it points for format files.  In lib/Global.pm, it might help to have the extended path include the directory with your latex executable. John<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/27/2004; 11:43:51 AM (reads: 3545, responses: 0) The user that we use for Apache is the same user (webwork2) which created/owns all of these files. Permissions on latex.fmt are as follows: -rw-r--r--   1 webwork2 special   653491 Jun 20  2002 ./share/texmf/web2c/latex.fmt The webwork2 user (which is who is supposed to be running Apache) can run latex without a hitch. It might be a good idea to invlude the extended path of where to search for these format files. I will try that and see if it provides any better results. I want to thank you again for your persistance. :)<| Post or View Comments |>

 Arnold K. Pizer - Re: Yet Another Latex Problem  4/27/2004; 11:58:11 AM (reads: 3535, responses: 0) Hi, You have probably done this, but I'll mention it just to be sure (and I'm not really that knowledgable about this, John is much more an expert than I). When you su to webwork2 to check how it runs latex, did you use a switch so that you are using the full webwork2 enviorment and not your own enviorment? In FreeBDS I believe the command is su -l webwork2   Arnie <| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/27/2004; 12:03:26 PM (reads: 3571, responses: 0) Hi Arnie, webwork2 is the user I actually log into our server with, such as ssh -l webwork2 Is what I normall do. I just tried specifying a format file with latex such as: latex -fmt=latex And it still does not work with webwork running it, but again it works perfectly (and much faster then previously without the -fmt flag) under the shell. I am beginning to have a feeling that since Root is spawning the original Apache thread, that it might be using it's environment variables and not webwork2's. Is there somewhere within settings of either tex or webwork where you distinctively specify a path for a format file? Rather than just using the -fmt flag which only expects a format name?<| Post or View Comments |>

 Jason Farmer - Re: Yet Another Latex Problem  4/27/2004; 12:15:13 PM (reads: 3573, responses: 0) I found this line in texmf.cnf under the web2c directory of Tex TEXFORMATS = .;$TEXMF/web2c Which specifies where the default format files live, however, we also had this line specified TEXMF = {!!$TEXMFMAIN} Aparently you only need the !! points when you are adding additional paths to the variable? I changed this to look like TEXMF = {\$TEXMFMAIN} and everything appears to be working smoothly. YAY! Thank you so much everyone for your help. I knew it had to be something simple. Thank you again!<| Post or View Comments |>