## Forum archive 2000-2006

### Brian Camp - Can't call method "copy" on an undefined value

by Arnold Pizer -
Number of replies: 0
 Can't call method "copy" on an undefined value topic started 12/6/2006; 3:59:57 PMlast post 12/7/2006; 1:13:53 PM
 Brian Camp - Can't call method "copy" on an undefined value  12/6/2006; 3:59:57 PM (reads: 250, responses: 7) Hi, We are currently experiencing an error related to the method "copy" in the subroutine num_cmp. Here are some of the error messages (note it is not related to hardcopy generation but it was a quick way to summarize the problems): 18 errors occured while generating hardcopy: *  Errors encountered while processing problem '1' in set 'math241_ww01' for user 'bcamp'. This problem has been omitted from the hardcopy. Error text: Can't call method "copy" on an undefined value at line 1959 of (eval 133) Died within main::FUNCTION_CMP called at line 1541 of (eval 133) from within main::fun_cmp called at line 47 of [TMPL]/Library/UVA-Stew5e/setUVA-Stew5e-C03S01-DerivPolyExps/3-1-17.pg *  Errors encountered while processing problem '2' in set 'math241_ww01' for user 'bcamp'. This problem has been omitted from the hardcopy. Error text: Can't call method "copy" on an undefined value at line 1070 of (eval 133) Died within main::NUM_CMP called at line 497 of (eval 133) from within main::num_cmp called at line 49 of [TMPL]/Library/UVA-Stew5e/setUVA-Stew5e-C03S01-DerivPolyExps/3-1-12a.pg... *  Errors encountered while processing problem '6' in set 'math241_ww01' for user 'bcamp'. This problem has been omitted from the hardcopy. Error text: Error detected while loading [PG]/macros/extraAnswerEvaluators.pl: Error detected while loading [PG]/macros/Parser.pl: * This problem requires the Parser.pm package, which doesn't * seem to be installed. Please contact your WeBWorK system * administrator and ask him or her to install it first. Died within main::compile_file called at line 270 of (eval 121) from within main::loadMacros called at line 24 of [TMPL]/Library/UVA-Stew5e/setUVA-Stew5e-C03S01-DerivPolyExps/3-1-44.pg... *  Errors encountered while processing problem '17' in set 'math241_ww01' for user 'bcamp'. This problem has been omitted from the hardcopy. Error text: Error detected while loading /opt/webwork/libraries/union_problib/macros/PGunion.pl: Error detected while loading /opt/webwork/libraries/union_problib/macros/unionMessages.pl: Can't call method "flag" on an undefined value at line 10 of /opt/webwork/libraries/union_problib/macros/unionMessages.pl, chunk 1 Died within main::compile_file called at line 270 of (eval 121) from within main::loadMacros called at line 22 of [TMPL]/Library/Union/setDervProductQuotientRule/s2_2_16.pg *  Errors encountered while processing problem '18' in set 'math241_ww01' for user 'bcamp'. This problem has been omitted from the hardcopy. Error text: Can't call method "copy" on an undefined value at line 1070 of (eval 133) Died within main::NUM_CMP called at line 497 of (eval 133) from within main::num_cmp called at line 43 of [TMPL]/Library/ma122DB/set4/s3_2_25.pg The strange thing is that on any of the above problems, sometimes they will display correctly, let you answer the question and then try again. Other times, a particular problem will not display at all but instead give one of the above messages. Or sometimes it may let you submit an answer but then an error page comes up. I am fairly certain that the appropriate packages/files are installed. For example, a few minutes after having above problem when trying to generate a hardcopy of the set, it generated without any problems. Any ideas? Thanks in advance, Brian <| Post or View Comments |>

 Michael Gage - Re: Can't call method  12/6/2006; 6:52:30 PM (reads: 298, responses: 0) The first thing I'd do when getting inconsistent results like this is to stop the apache server and then restart it. That will make sure that each child process is operating with the same data. It would be consistent with your report if the children were operating differently from each other. Restarting the server should either fix things or make the errors consistent. Then we can proceed from there. -- Mike <| Post or View Comments |>

 Brian Camp - Re: Can't call method  12/6/2006; 7:35:54 PM (reads: 286, responses: 0) Mike, We did a restart of apache (since we did not have any idea of what else to do). However we did a graceful restart i.e. apachectl graceful As I understand it this tries to let a process finish up before stopping it. Is the method that you would recommend to restart apache? After that point, I believe that the problem has gotten better (but then I have not really scoured the log files since that point). The error_log was showing some rather interesting things earlier in the day. If I get a chance I will post some of them here later tonight but I have to run just now. Brian <| Post or View Comments |>

 Brian Camp - Re: Can't call method  12/6/2006; 7:37:55 PM (reads: 293, responses: 0) Mike, We did a restart of apache (since we did not have any idea of what else to do). However we did a graceful restart i.e. apachectl graceful As I understand it this tries to let a process finish up before stopping it. Is this the method that you would recommend to restart apache? After that point, I believe that the problem has gotten better (but then I have not really scoured the log files since that point). The error_log was showing some rather interesting things earlier in the day. If I get a chance I will post some of them here later tonight but I have to run just now. Brian <| Post or View Comments |>

 Michael Gage - Re: Can't call method  12/6/2006; 7:45:42 PM (reads: 284, responses: 0) A graceful restart will be usually work, but if there are still mysterious problems I have occasionally had to stop everything, check with top to make sure that there are no httpd processes running (and kill them if they are still running) and then restart. This happens rarely that a process hangs so badly, but I have had it happen. -- Mike <| Post or View Comments |>

 Davide P. Cervone - Re: Can't call method  12/6/2006; 9:41:23 PM (reads: 287, responses: 0) Brian: How long has it been since you updated the pg directories? In particular, do you have pg/lib/Parser/Legacy directory and its contents? If that is in place, make sure that your webwork/conf/global.conf file has  [qw(Parser::Legacy)], at the end of the \${pg}{modules} variable. This has been in the global.conf.dist for a little over a year, but it might be easy to miss it in updates as you try to update your version of global.conf as changes occur. It might be worth doing a diff between the global.conf and global.con.dist files to see that there are no other important differences. Hope one of these helps. Davide <| Post or View Comments |>

 Brian Camp - Re: Can't call method  12/7/2006; 12:27:23 PM (reads: 275, responses: 1) Davide, We installed WeBWorK only just three weeks ago using the rel-2-3-dev branch off of CVS. I checked the global.conf file and it does have the line that you are describing. (by the way, how do you do a "diff" between files? I am somewhat of a linux newbie). It appears that doing the apache restart has solved the problem. So I guess I should ask anyone else out there that is using Apache 2.0.x (we are using 2.0.54), do you periodically have to restart Apache? Is this something that I should just schedule a cron job for? We could use the apachectl graceful command every day (or even every hour) but is this sufficient? As Mike mentioned above, sometimes he has to do a full stop and restart of apache to make sure that all the threads get killed. Any thoughts? Brian <| Post or View Comments |>

 Davide P. Cervone - Re: Can't call method  12/7/2006; 1:13:53 PM (reads: 326, responses: 0) how do you do a "diff" between files? Use the command  diff file1 file2  You can see the man page for diff for the various options that can be applied.:  man diff Davide <| Post or View Comments |>