WeBWorK Main Forum

Problems with "images" Display Mode/Hardcopy Problems

Problems with "images" Display Mode/Hardcopy Problems

by Steven Xiao -
Number of replies: 3
Recently, we got two strange problems:

1) When we tried to browse the Library with "images" display mode, some of the problems may not show up in images mode. Instead, it show up with the raw TeX, something like:
\displaystyle{ \int_{1}^{5} \left(2 x^{-2} - 3\right) \, dx} =

At the bottom part of the page, there are some warning messages:

*******************************************************************************************

WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

Warning messages

  • cd /opt/webwork/webwork2/tmp/ImageGenerator.gctVDL8k && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.gctVDL8k/equation1.png /opt/webwork/webwork2/htdocs/tmp/equations/49/5a96f400987fb7f948cc298dc49f6c1.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 403.
  • cd /opt/webwork/webwork2/tmp/ImageGenerator.aqx2sQ42 && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.aqx2sQ42/equation1.png /opt/webwork/webwork2/htdocs/tmp/equations/bc/8da2b0b73c8d926077f130e25481ed1.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 403.
  • cd /opt/webwork/webwork2/tmp/ImageGenerator.zkk7tWXN && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.zkk7tWXN/equation1.png /opt/webwork/webwork2/htdocs/tmp/equations/db/60f1fb09335135526ebc886a0158911.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 403.
  • cd /opt/webwork/webwork2/tmp/ImageGenerator.b3sIqokr && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.b3sIqokr/equation1.png /opt/webwork/webwork2/htdocs/tmp/equations/63/92e93f5c26c1cbbd388ce6b88828111.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 403.
  • cd /opt/webwork/webwork2/tmp/ImageGenerator.TUoIDxHg && /bin/mv /opt/webwork/webwork2/tmp/ImageGenerator.TUoIDxHg/equation1.png /opt/webwork/webwork2/htdocs/tmp/equations/c4/3669d431f212872752ce456ccbf1361.png returned non-zero status 256: Bad file descriptor at /opt/webwork/pg/lib/WeBWorK/PG/ImageGenerator.pm line 403.

Request information

Time Tue Jan 25 11:05:50 2011
Method POST
URI /webwork2/math132spring2011/instructor/setmaker/
 

Page generated at 01/25/2011 at 11:05am CST

**********************************************************************************************

What could be the problem? How can we fix it?


2) We also have a problem with the hardcopy download:

When we tried to download a hardcopy of a homework set, we will get the following error message:

*******************************************************************************************



1 error occured while generating hardcopy:

  • [edit] Errors encountered while processing snippet 'defaultHeader' for set 'test2' and user 'admin'. This snippet has been omitted from the hardcopy. Error text:
    Failed to read the problem source file.

A hardcopy file was generated, but it may not be complete or correct. Please check that no problems are missing and that they are all legible. If not, please inform your instructor.
Download Hardcopy

You can also examine the following temporary files: hardcopy.log, hardcopy.aux, pdflatex.stderr, hardcopy.tex, pdflatex.stdout

********************************************************************************************

But, if we go to "Hmwk Sets Editor", -> "Edit Problems" and change the "Use Default Header File" for "Hardcopy Header" to setHeader.pg, then the Hardcopy download will work fine.

So it seems like the defaultHeader link somehow is broken. How can we fix it? Can someone help?

Thanks,

Steven Xiao


The following is the environment:

Operating System: RedHat Enterprise Linux 6.0

Output of uname -a:

Linux webwork1.wustl.edu 2.6.32-71.14.1.el6.x86_64 #1 SMP Wed Jan 5 17:01:01 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

README file in /opt/webwork/webwork2 directory:

WeBWorK
Online Homework Delivery System
Version 2.4.9+
Branch: system/trunk/webwork2

http://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.4.9
Copyright 2000-2010, The WeBWorK Project
http://webwork.maa.org
All rights reserved.

README file in /opt/webwork/pg:

WeBWorK
Program Generation Language
Version 2.4.9+
Branch: system/trunk/pg


http://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.4.9

Copyright 2000-2010, The WeBWorK Project
http://webwork.maa.org
All rights reserved.

Output of the command httpd -V:

Server version: Apache/2.2.16 (Unix)
Server built: Jan 5 2011 19:25:37
Server's Module Magic Number: 20051115:24
Server loaded: APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/apache2"
-D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Output of the command perl -V:

Summary of my perl5 (revision 5 version 12 subversion 2) configuration:

Platform:
osname=linux, osvers=2.6.32-71.7.1.el6.x86_64, archname=x86_64-linux
uname='linux webwork1.wustl.edu 2.6.32-71.7.1.el6.x86_64 #1 smp wed oct 27 03:44:59 edt 2010 x86_64 x86_64 x86_64 gnulinux '
config_args='-de -Dprefix=/usr/local -Accflags=-fPIC'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.4.4 20100726 (Red Hat 4.4.4-13)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.12'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
USE_PERL_ATOF
Built under linux
Compiled at Jan 5 2011 16:23:09
@INC:
/usr/local/lib/perl5/site_perl/5.12.2/x86_64-linux
/usr/local/lib/perl5/site_perl/5.12.2
/usr/local/lib/perl5/5.12.2/x86_64-linux
/usr/local/lib/perl5/5.12.2
.

In reply to Steven Xiao

Re: Problems with "images" Display Mode/Hardcopy Problems

by Michael Gage -
I'd check the permissions on

/opt/webwork/webwork2/tmp

it looks like the webserver can't write into that directory.

I believe the defaultHeader issue is a bug -- I remember seeing it also.
I don't know the status of it at the moment -- it might have been
fixed in the current trunk. It is easy to work around but it needs to
be fixed.

Also -- try choosing a different setHeader and then going back
and choosing defaultHeader and saving the result -- does hardcopy
work for you then? In fact even just saving the homework set from the
homework set editor might update the link to the defaultHeader.

-- Mike

In reply to Michael Gage

Re: Problems with "images" Display Mode/Hardcopy Problems

by Steven Xiao -
Thanks for the quick reply, Mike.

1) The permission of the directory /opt/webwork/webwork2/tmp is
drwxrwsr-x. 3 root wwadmin 4096 Jan 25 11:05 tmp
while the webserver is running as
User apache
Group wwadmin

It looks ok to me. I also have an old backup system running an older version 2.4.7 with the same permission which runs ok. Or anything changed with this version 2.4.9+ ? Where else should I check?

For the hardcopy problem, I will try it to see if it works.

Thanks again.

Steven Xiao





In reply to Steven Xiao

Re: Problems with "images" Display Mode/Hardcopy Problems

by Michael Gage -
You can turn the mechanism that automatically deletes temporary files off using the instructions at

http://webwork.maa.org/wiki/Troubleshooting_Hardcopy

-- this will allow you to inspect to whether the equation .png is not being created.

The most likely command that is failing is mv -- so either it can't find the equation .png file and perhaps it has not been created or else it isn't able to copy the file into its htdocs/tmp/equation destination (check that for permissions as well).

With the temp files not being deleted you can try to mv things around using the command line tools which might give you more information -- just remember that your personal permissions might be different from the webservers -- you can fix this by issuing:

sudo su apache

now you are acting as the webserver and should have the same permissions -- that might give you more clues. (type exit to get out)

If the .png file is not being created -- then I'm less sure what to check next.
Try running bin/check_modules.pl -- that might pick up a missing module or a bad path to an application.

hope this helps.
Take care,

Mike