## WeBWorK Main Forum

### PGgraphmacros problem

by Richard Bayne -
Number of replies: 13
Hello Mike,
I have run the script NPL-update as Jason suggested, but this does not seem to have any effect on the possibility of displaying the troublesome problems. Here again is a description of the trouble. When using the Library Browser to build a problem set, certain problems disallow the displaying of any problems in the set. If the trouble problems are at the beginning of the list of problems, none will display; if they happen to be farther along in the list, initial problems can be viewed, but trying "next page" fails if the trouble problems are on those subsequent pages.
From my analysis, the problems that cause the trouble are those making a call to PGgraphmacros.pl, While testing, I have renamed these problems so they would appear later in the list and been able to view the other problems.
Here are a couple of examples of trouble problems:
NationalProblemLibrary/Rochester/setDerivatives1/nsc2s10p1_mo.pg
NationalProblemLibrary/Rochester/setAlgebra27Conics/ur_geo_3_10.pg

Thanks, Richard

### Re: PGgraphmacros problem

by Richard Bayne -
Dear Mike and all,
Here is an update on PGgraphmacros trouble. I recently did a source download and installation of Safe.pm 2.19 since it was suggested that might be the problem. There was no change in results. I did reset the machine.
As indicated, the problems that do not display and those that cannot be assigned appear to be any that include a call to PGgraphmmacros.pl. My usual test is to look at any of the sections under Algebra/Conic Sections in the National Problem Library.
Thanks, Richard

### Re: PGgraphmacros problem

by Arnold Pizer -
Hi Richard,

This is almost certainly a problem with your server since I can view the graphics in problems in the Algebra/Conic Sections of the NPL.

Try the following. First edit
/opt/webwork/webwork2/lib/WeBWorK/Constants.pm
setting
$WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles = 1; and then restart Apache. Then use the Library Browser (with Display Mode: set to None) to create a set with some of the offending problems. Then look at the set and download a hard copy. Actually since there should be an error, the log files, etc should be displayed even without the change to Constants.pm. Hopefully something in these files will point to the problem. When you are done, remember to change Constants.pm back and restart Apache so that that change takes place. Arnie In reply to Arnold Pizer ### Re: PGgraphmacros problem by Richard Bayne - Hello Arnie, I had no doubt the problem was on this server. Here are the results of the steps you suggested. When I go to download the set I first get a warning message on the hardcopy generator page as follows: Activity 'download_hardcopy_view_errors' not found in %permissionLevels -- assuming no permission. at /opt/webwork/webwork2/lib/WeBWorK/Authz.pm line 219. When I go ahead and ask fro the hardcopy, I get the following: Safari can’t open the page “http://butcher.math.howard.edu/webwork2/Test-Course/hardcopy/” because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again. This is the same sort of message that is obtained when trying to look at the problem in the Library Browser or when including the problem in an actual problem set. By the way, if I use Firefox, I just get a blank page w/o any message. Where are the log files that might have some info concerning the errors or troubles the browser is having? Thanks, Richard In reply to Richard Bayne ### Re: PGgraphmacros problem by Arnold Pizer - Hi Richard, Look at your global.conf file. You should have: ##### Behavior of the Hardcopy Processor ##### download_hardcopy_multiuser => "ta", download_hardcopy_multiset => "ta", download_hardcopy_view_errors =>"professor", download_hardcopy_format_pdf => "guest", download_hardcopy_format_tex => "ta", Arnie In reply to Arnold Pizer ### Re: PGgraphmacros problem by Richard Bayne - Arnie, Thank you. Our global.conf file did not have the entry for professor. After putting that line in, I no longer get the warning before trying to download the printed copy. However, the end result is the same, that is, I get either a blank screen from Firefox or the aforementioned message from Safari. I do not know if this is pertinent, but if I add a blank problem using the homework editor and copy in the code from one of these problems using PGgraphmacros, the same kind of result is obtained, that is, a blank screen or error message suggesting the server has dropped the connection, which of course, it has not. Still in wonderment. Richard In reply to Richard Bayne ### Re: PGgraphmacros problem by Arnold Pizer - Hi Richard, Take a look at the log files, etc that have been saved. You will find them in one of two places depending on how WeBWorK is set up . If you do not have a wwtmp directory (often /var/www/wwtmp, then look in /opt/webwork/courses/course_name/html/tmp/hardcopy/ If you do have a wwtmp directory, then look in /var/www/wwtmp/course_name/hardcopy/ In the hardcopy directory, you will see work... directories where all the files are saved. Hope this helps, Arnie In reply to Richard Bayne ### Re: PGgraphmacros problem by Danny Glin - I have two thoughts that may or may not help: What version of PGgraphmacros are you running? There was a problem with one version of the file where it was very slow to load, sometimes causing browsers (or the system) to timeout before the graphs were generated. (see http://webwork.maa.org/moodle/mod/forum/discuss.php?d=375 ) What version of apache are you runnning? In webwork2/conf/webwork.apache2-config there is a section that needs to be uncommented for earlier versions of apache 2.2 in order for files to show up in the right place. Hopefully one of these things helps. Danny In reply to Danny Glin ### Re: PGgraphmacros problem by Richard Bayne - Danny, Arnie- Here is my report: 1. there is no file /var/www/wwtmp; the only thing in /opt/webwork/courses/course_name/html/tmp/hardcopy/ is the tex file hardcopy.tex (actually several instances generated at various times). This file seems to be a kind of wrapper. 2. I have looked at log files in several other places, but can find none that indicate that they have anything to do with this problem. 3. I am using Apache 2.2.0 and my PGgraphmacros version is 1.6.6.1.2.3 4. The only lines in webwork2/conf/webwork.apache2-config that I can see that are commented out are those that allow for following symlinks. If these are commented out, apachectl complains of syntax error and will not restart. Still groping. Richard In reply to Richard Bayne ### Re: PGgraphmacros problem by Sam Hathaway - Try looking at the Apache error log. See if anything's logged there. Most systems keep it in /var/log/apache, /var/log/apache2, or /var/log/httpd. Search your Apache config for "ErrorLog" if you can't find it. In reply to Sam Hathaway ### Re: PGgraphmacros problem by Jason Aubrey - Also Richard - you can set apache to give more information that usual in the error log by adjusting the LogLevel directive. By default it is set to LogLevel warn But if you set it to "notice", "info" or "debug" you'll get more information from Apache. This may or may not be helpful information, but it can't hurt for this investigation. This is set in your httpd.conf (aka apache2.conf). See http://httpd.apache.org/docs/current/mod/core.html#loglevel for more info. Hope this helps, Jason In reply to Sam Hathaway ### Re: PGgraphmacros problem by Richard Bayne - Sam et al, Thank you for the suggestions. One of the things I see in /var/log/httpd/error_log is this: [Wed Oct 13 15:37:18 2010] [warn] [client 138.238.202.146] [/webwork2/Test-Course/instructor/setmaker/] failed to open /opt/webwork/webwork2/logs/timing.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 702., referer: http://butcher.math.howard.edu/webwork2/Test-Course/instructor/setmaker/ /usr/sbin/httpd: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/GD/GD.so: undefined symbol: Perl_sv_2iv_flags I assume the stuff referring to the timing log is not significant, since it is part of almost every error listed in the log, but I would think that the part about the symbol lookup error might be significant since it is unique to the operation I tried. Of course, it is not helpful to me, so I hope it can provide a clue to someone else. Thanks. /usr/sbin/httpd: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/GD/GD.so: undefined symbol: Perl_sv_2iv_flags Richard In reply to Richard Bayne ### Re: PGgraphmacros problem by Sam Hathaway - Looks like a problem with your GD module, which is responsible for drawing graphs. You could try recompiling it or installing it from a OS package. Other people have experienced this same problem. Good luck! In reply to Richard Bayne ### Re: PGgraphmacros problem by Arnold Pizer - Hi Richard, To have log files saved in /opt/webwork/courses/course_name/html/tmp/hardcopy/... you need to Try the following. First edit /opt/webwork/webwork2/lib/WeBWorK/Constants.pm setting$WeBWorK::ContentGenerator::Hardcopy::PreserveTempFiles = 1;
and then restart Apache.

Did you do this?

Arnie