WeBWorK Main Forum

Editing course config: "Can't use string ("nobody") as an ARRAY ref while "strict refs" in use

Editing course config: "Can't use string ("nobody") as an ARRAY ref while "strict refs" in use

by Dave Rosoff -
Number of replies: 3

Today is the first day of the semester and of course I didn't do all my chores while setting up the courses for the term. I went to fix the Course Configuration tab and fiddled with some checkboxes. When I hit Save, I receive the error below about "Can't use string ("nobody") as an ARRAY ref while "strict refs" in use at /opt/webwork/webwork2/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm line 28.".  Thanks in advance for any tips.

WeBWorK error

An error occured while processing your request.

For help, please send mail to this site's webmaster drosoff@collegeofidaho.edu, including all of the following information as well as what what you were doing when the error occured.

Error record identifier

6494b6a9-abb7-53f0-969b-f31274713bfc::6a9e2fae-41d3-11ee-bd9e-a6ac8312fb50

Error messages

Can't use string ("nobody") as an ARRAY ref while "strict refs" in use at /opt/webwork/webwork2/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm line 28.

Context

  • 23: }
  • 24: 
  • 25: # r->param() returns an array, so a custom version of convert_newval_source is needed.
  • 26: sub convert_newval_source ($self, $use_current) {
  • 27: 	if ($use_current) {
  • 28: 		return @{ $self->get_value($self->{c}->ce) };
  • 29: 	} else {
  • 30: 		return $self->{c}->param($self->{name});
  • 31: 	}
  • 32: }
  • 33: 

Call stack

  • in Mojolicious::_die called at line 27 of /opt/webwork/webwork2/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm
  • in WeBWorK::ConfigObject::permission_checkboxlist::convert_newval_source called at line 35 of /opt/webwork/webwork2/lib/WeBWorK/ConfigObject/permission_checkboxlist.pm
  • in WeBWorK::ConfigObject::permission_checkboxlist::save_string called at line 210 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Config.pm
  • in WeBWorK::ContentGenerator::Instructor::Config::pre_header_initialize called at line 126 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in (eval) called at line 107 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 193 of /usr/local/share/perl/5.30.0/Mojolicious.pm
  • in Mojolicious::_action called at line 15 of /usr/local/share/perl/5.30.0/Mojolicious/Plugins.pm
  • in Mojolicious::Plugins::__ANON__ called at line 162 of /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm
  • in (eval) called at line 142 of /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm
  • in Mojolicious::WeBWorK::__ANON__ called at line 15 of /usr/local/share/perl/5.30.0/Mojolicious/Plugins.pm
  • in Mojolicious::Plugins::__ANON__ called at line 18 of /usr/local/share/perl/5.30.0/Mojolicious/Plugins.pm
  • in Mojolicious::Plugins::emit_chain called at line 88 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::_action called at line 161 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::_controller called at line 44 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::continue called at line 46 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::continue called at line 46 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::continue called at line 46 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::continue called at line 52 of /usr/local/share/perl/5.30.0/Mojolicious/Routes.pm
  • in Mojolicious::Routes::dispatch called at line 127 of /usr/local/share/perl/5.30.0/Mojolicious.pm
  • in Mojolicious::dispatch called at line 136 of /usr/local/share/perl/5.30.0/Mojolicious.pm
  • in Mojolicious::__ANON__ called at line 15 of /usr/local/share/perl/5.30.0/Mojolicious/Plugins.pm
  • in Mojolicious::Plugins::__ANON__ called at line 203 of /usr/local/share/perl/5.30.0/Mojolicious.pm
  • in (eval) called at line 203 of /usr/local/share/perl/5.30.0/Mojolicious.pm
  • in Mojolicious::_exception called at line 15 of /usr/local/share/perl/5.30.0/Mojolicious/Plugins.pm
  • in Mojolicious::Plugins::__ANON__ called at line 18 of /usr/local/share/perl/5.30.0/Mojolicious/Plugins.pm
  • in Mojolicious::Plugins::emit_chain called at line 141 of /usr/local/share/perl/5.30.0/Mojolicious.pm
  • in Mojolicious::handler called at line 70 of /usr/local/share/perl/5.30.0/Mojo/Server.pm
  • in Mojo::Server::__ANON__ called at line 15 of /usr/local/share/perl/5.30.0/Mojo/EventEmitter.pm
  • in Mojo::EventEmitter::emit called at line 103 of /usr/local/share/perl/5.30.0/Mojo/Server/Daemon.pm
  • in Mojo::Server::Daemon::__ANON__ called at line 15 of /usr/local/share/perl/5.30.0/Mojo/EventEmitter.pm
  • in Mojo::EventEmitter::emit called at line 60 of /usr/local/share/perl/5.30.0/Mojo/Transaction/HTTP.pm
  • in Mojo::Transaction::HTTP::server_read called at line 224 of /usr/local/share/perl/5.30.0/Mojo/Server/Daemon.pm
  • in Mojo::Server::Daemon::_read called at line 202 of /usr/local/share/perl/5.30.0/Mojo/Server/Daemon.pm
  • in Mojo::Server::Daemon::__ANON__ called at line 15 of /usr/local/share/perl/5.30.0/Mojo/EventEmitter.pm
  • in Mojo::EventEmitter::emit called at line 109 of /usr/local/share/perl/5.30.0/Mojo/IOLoop/Stream.pm
  • in Mojo::IOLoop::Stream::_read called at line 57 of /usr/local/share/perl/5.30.0/Mojo/IOLoop/Stream.pm
  • in Mojo::IOLoop::Stream::__ANON__ called at line 141 of /usr/local/share/perl/5.30.0/Mojo/Reactor/Poll.pm
  • in (eval) called at line 141 of /usr/local/share/perl/5.30.0/Mojo/Reactor/Poll.pm
  • in Mojo::Reactor::Poll::_try called at line 54 of /usr/local/share/perl/5.30.0/Mojo/Reactor/EV.pm
  • in Mojo::Reactor::EV::__ANON__ called at line 32 of /usr/local/share/perl/5.30.0/Mojo/Reactor/EV.pm
  • in (eval) called at line 32 of /usr/local/share/perl/5.30.0/Mojo/Reactor/EV.pm
  • in Mojo::Reactor::EV::start called at line 134 of /usr/local/share/perl/5.30.0/Mojo/IOLoop.pm
  • in Mojo::IOLoop::start called at line 152 of /usr/local/share/perl/5.30.0/Mojo/Server/Prefork.pm
  • in Mojo::Server::Prefork::_spawn called at line 93 of /usr/local/share/perl/5.30.0/Mojo/Server/Prefork.pm
  • in Mojo::Server::Prefork::_manage called at line 78 of /usr/local/share/perl/5.30.0/Mojo/Server/Prefork.pm
  • in Mojo::Server::Prefork::run called at line 74 of /usr/local/share/perl/5.30.0/Mojo/Server/Hypnotoad.pm
  • in Mojo::Server::Hypnotoad::run called at line 14 of /usr/local/bin/hypnotoad

Request information

The HTTP request information is included in the following table.

HTTP request information
Item Data
Method POST
URI https://webwork.collegeofidaho.edu/webwork2/MAT175/instructor/config
HTTP Headers
HTTP request headers
Key Value
Referer https://webwork.collegeofidaho.edu/webwork2/MAT175/instructor/config?effectiveUser=drosoff%40collegeofidaho.edu&section_tab=tab2
X-Forwarded-For 10.15.4.65
Cookie WeBWorKCourseAuthen.MAT101_S23=drosoff%40collegeofidaho.edu%09jFfJvohoCat29LW5YWCjOTXoAxnTZlr0%091692634612; WeBWorKCourseAuthen.admin=drosoff%40collegeofidaho.edu%098s62p3EFSJO92Zu9iwX2nXy3IYz3BWdl%091692635665; WeBWorKCourseAuthen.MAT101_Dates=drosoff%40collegeofidaho.edu%0910wfGT9IqT41OCviJ1LrFzHKAM3HFbxO%091692637965; WeBWorKCourseAuthen.MAT101=drosoff%40collegeofidaho.edu%09Av2gfOBNK6ODptGrheNZstag4PIbky5g%091692655988; WeBWorKCourseAuthen.MAT175=drosoff%40collegeofidaho.edu%09XsdFVLP1FIpSEKarRLriA5Z370ioXshi%091692806169
Host webwork.collegeofidaho.edu
X-Forwarded-Server webwork.collegeofidaho.edu
Content-Type application/x-www-form-urlencoded
Accept-Encoding gzip, deflate, br
Connection Keep-Alive
Sec-Fetch-Dest document
Origin https://webwork.collegeofidaho.edu
Sec-Fetch-Mode navigate
Content-Length 786
Accept-Language en-US,en;q=0.5
Sec-Fetch-Site same-origin
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
X-Forwarded-Proto https
Upgrade-Insecure-Requests 1
Sec-Fetch-User ?1
DNT 1
Accept text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
X-Forwarded-Host webwork.collegeofidaho.edu

Time generated:

Wed Aug 23 10:37:57 2023


In reply to Dave Rosoff

Re: Editing course config: "Can't use string ("nobody") as an ARRAY ref while "strict refs" in use

by Alex Jordan -
Can you check that you have pulled everything for 2.18? This may be something that was fixed a few weeks ago.
In reply to Alex Jordan

Re: Editing course config: "Can't use string ("nobody") as an ARRAY ref while "strict refs" in use

by Dave Rosoff -
Thank you, this did the trick. In case anyone else stumbles onto this, I needed to restart the webwork2 service after updating the git repos.
In reply to Dave Rosoff

Re: Editing course config: "Can't use string ("nobody") as an ARRAY ref while "strict refs" in use

by Glenn Rice -
Yes, anytime that the perl code changes, you need to restart the webwork2 service. This is the equivalent of restarting apache2 for prior versions of webwork. Note that you rarely need to restart apache2 anymore (assuming you are even using apache2 anymore at all).