WeBWorK Main Forum

Perl and MySQL miscommunication issue - WeBWorK courses not accessible

Perl and MySQL miscommunication issue - WeBWorK courses not accessible

by Bernd Sing -
Number of replies: 5

While trying to improve the performance of our WeBWork server (ww- and pg-version 2.15 on Ubunutu 20.04.2) and its (opaque as well as wwlink) communication with our Moodle server, it seems I have updated(?) a perl module or a linux file I shouldn't have.
While the webwork2-frontpage looks normal, trying to access the admin-course shows the following error message:

Warning messages

  • It looks like the database is missing a column. You may need to upgrade your course tables. If this is the admin course then you will need to upgrade the admin tables using the upgrade_admin_db.pl script. at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 834.

Error messages

DBD::mysql::st execute failed: Unknown column 'ARRAY(0x5629027da4c0)' in 'field list' at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 837.

Call stack

The information below can help locate the source of the problem.

  • in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 418 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
  • in WeBWorK::DB::Schema::NewSQL::Std::_get_fields_where_prepex called at line 386 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
  • in WeBWorK::DB::Schema::NewSQL::Std::get_fields_where called at line 484 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
  • in WeBWorK::DB::listUsers called at line 279 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Login.pm
  • in WeBWorK::ContentGenerator::Login::body called at line 155 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 610 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 233 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 386 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

MethodGET
URI/webwork2/admin/

Running the upgrade_admin_db.pl script does not resolve the issue and, in fact, states:
Harmless: admin_set has extra column 'published' for older course.
Harmless: admin_set_user has extra column 'published' for older course.
Admin Course Up to Date

Trying to access any other course leads to the same warning and almost the same error message (except the hex code inside ARRAY, which is changing anyway, and in the first case 'field list' replaced by 'where clause'), and either of two call stacks depending on the course:

    in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 364 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
    in WeBWorK::DB::Schema::NewSQL::Std::count_where called at line 374 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
    in WeBWorK::DB::Schema::NewSQL::Std::exists_where called at line 850 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
    in WeBWorK::DB::settingExists called at line 1230 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
    in WeBWorK::ContentGenerator::title called at line 64 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Login.pm
    in WeBWorK::ContentGenerator::Login::title called at line 155 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
    in WeBWorK::Template::template called at line 610 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
    in WeBWorK::ContentGenerator::content called at line 233 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
    in WeBWorK::ContentGenerator::go called at line 386 of /opt/webwork/webwork2/lib/WeBWorK.pm

or

    in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 418 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
    in WeBWorK::DB::Schema::NewSQL::Std::_get_fields_where_prepex called at line 386 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
    in WeBWorK::DB::Schema::NewSQL::Std::get_fields_where called at line 446 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
    in WeBWorK::DB::Schema::NewSQL::Std::get_records_where called at line 746 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
    in WeBWorK::DB::Schema::NewSQL::Std::gets called at line 502 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
    in WeBWorK::DB::getUsers called at line 497 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
    in WeBWorK::DB::getUser called at line 466 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
    in WeBWorK::Authen::check_user called at line 302 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
    in WeBWorK::Authen::do_verify called at line 216 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
    in WeBWorK::Authen::verify called at line 321 of /opt/webwork/webwork2/lib/WeBWorK.pm

So, it seems that for some reason perl now uses the reference to the arrays and variables instead of the dereferenced versions. E.g., having debugged /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm,the variable $stmt in line 415 now reads "SELECT `ARRAY(0x5629027da4c0)` FROM `admin_user` " which then triggers the above error message.

Unfortunately, with my very limited knowledge of perl, that's all I found out so far.

Has anyone experienced anything like this before? Or any suggestions what to do to fix it? I am grateful for any hint -- thanks.

In reply to Bernd Sing

Re: Perl and MySQL miscommunication issue - WeBWorK courses not accessible

by Danny Glin -

There is an issue between WeBWorK and recent versions of the SQL::Abstract perl package.  WeBWorK is known to work with versions up to 1.87, but anything newer than that could lead to these errors.  Try rolling back to an older version of SQL::Abstract and see if these errors go away.

In reply to Danny Glin

Re: Perl and MySQL miscommunication issue - WeBWorK courses not accessible

by Bernd Sing -
Thank you so much, reverting back to version 1.87 of SQL::Abstract indeed resolved the issue. Great!
In reply to Bernd Sing

Re: Perl and MySQL miscommunication issue - WeBWorK courses not accessible

by papi matotong -

Hi Berd,


How did you revert back to SQL::Abstract? may you kindly assist, i am having the same issue.


Thanks

In reply to papi matotong

Re: Perl and MySQL miscommunication issue - WeBWorK courses not accessible

by Glenn Rice -

Rather than reverting to SQL::Abstract, just install SQL::Abstract::Classic.  If both are installed and the version of SQL::Abstract is too new (i.e., it is version 1.87 or newer), then SQL::Abstract::Classic will be used.

In reply to Glenn Rice

Re: Perl and MySQL miscommunication issue - WeBWorK courses not accessible

by Bernd Sing -
Hi Papi,

you can specify the version using '@' when installing perl packages, e.g., you could use cpanm SQL::Abstract@1.87 in this case.

However, as Glenn suggests, I have now also installed SQL::Abstract::Classic since, not least because inadvertedly I will (or already have) update SQL::Abstract at some point anyway having forgotten all about this issue, lol.