WeBWorK Main Forum

mysql error in library browser

mysql error in library browser

by Hal Sadofsky -
Number of replies: 5

I'm getting a peculiar error trying to use the library browser.  

If I go to "Advanced Search" and select a textbook, then I get the following error:

DBD::mysql::db selectall_arrayref failed: Incorrect table name '' at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 381.

I've only tried three textbooks, but I get this error with all three of them, so I suspect with any choice of text.  If I just choose "Subject", "Chapter" and "Section" without specifying a textbook, I don't get this error.

This is with WeBWorK 2.5.1.1 and having run OPL-update on Friday.  This is a new installation - we haven't taught from it yet, though plan on doing so in January.

(I'm getting another set of issues, that appear unrelated and I posted about them on the Problems and Problem Librares Forum.  But just in case it is related, here is the link:
http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2846 )

thanks for any help,

Hal


The call stack is:

in WeBWorK::Utils::ListingDB::getDBListings called at line 399 of /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pmin WeBWorK::Utils::ListingDB::countDBListings called at line 614 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pmin WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel2adv called at line 431 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pmin WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel called at line 799 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pmin WeBWorK::ContentGenerator::Instructor::SetMaker::make_top_row called at line 1374 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pmin WeBWorK::ContentGenerator::Instructor::SetMaker::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pmin WeBWorK::Template::template called at line 496 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pmin WeBWorK::ContentGenerator::content called at line 200 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pmin WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm
In reply to Hal Sadofsky

Re: mysql error in library browser

by Hal Sadofsky -

I just thought I'd post an update.  I haven't solved this problem, but I do see
(I missed this on my first pass) that this same error message has come up before.

http://webwork.maa.org/moodle/mod/forum/discuss.php?d=2767

I'm using a very recent download of the problem library, and I checked to make
sure that I had the version of OPL-update from github.

But I still get this "incorrect table name ' ' " error when I do an advanced search on a textbook.  I have solved the other problem I mentioned parenthetically in the post above - I think just by updating the OpenProblemLibrary.

Hal

In reply to Hal Sadofsky

Re: mysql error in library browser

by Jason Aubrey -
Hi Hal,

Can you try the following experiment?: Uncomment line 381 (which says 'warn $query') and let us know what $query is? I'm setting up a new webwork over the next couple of days, so I'll get to do this too today or tomororw.

Thanks,
Jason
In reply to Jason Aubrey

Re: mysql error in library browser

by Hal Sadofsky -

Hi Jason,

I uncommented the 'warn $query' line.  (emacs tells me this is line 380, not 381 - don't know if that matters somehow).

I left commented the line above it, which edits $query (that line is:

#$query =~ s/\n/ /g;   ).

The warning message associated with the "warn $query" doesn't show up on my web browser when I repeat the actions that give the error message.

I don't actually know where STDERR is.  I looked at /opt/webwork/webwork2/logs/debug.log which has a lot in it, but doesn't seem to have this warning in it.

I do see an entry in /var/log/httpd/error_log each time I produce this error which says:

Use of uninitialized value $string in substitution (s///) at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 321.

But that still doesn't identify $query.

Hal

In reply to Hal Sadofsky

Re: mysql error in library browser

by Hal Sadofsky -

Oh, I see.  I didn't realize I had to restart apache for changes to the webwork code to get used.

Here is the error, with the warning message obtained by uncommenting the 'warn $query' line as Jason suggested.



WeBWorK error

An error occured while processing your request. For help, please send mail to this site's webmaster (bhirr@uoregon.edu), including all of the following information as well as what what you were doing when the error occured.

Fri Dec 21 14:39:08 2012

Warning messages

  • SELECT COUNT(DISTINCT pgf.pgfile_id) from `OPL_pgfile` pgf, <br /> `` dbsc, `OPL_DBchapter` dbc, `OPL_DBsubject` dbsj,<br /> `OPL_pgfile_problem` pgp, `OPL_problem` prob, `OPL_textbook` tbk ,<br /> `OPL_chapter` tc, `OPL_section` ts <br /> WHERE dbsj.DBsubject_id = dbc.DBsubject_id AND<br /> dbc.DBchapter_id = dbsc.DBchapter_id AND<br /> dbsc.DBsection_id = pgf.DBsection_id AND<br /> pgf.pgfile_id = pgp.pgfile_id AND<br /> pgp.problem_id = prob.problem_id AND<br /> tc.textbook_id = tbk.textbook_id AND<br /> ts.chapter_id = tc.chapter_id AND<br /> prob.section_id = ts.section_id <br /> AND dbsj.name=&quot;Calculus&quot; AND dbc.name=&quot;Applications of Differentiation&quot; AND dbsc.name=&quot;Antiderivatives&quot; <br /> AND tbk.textbook_id=&quot;38&quot; <br /> at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 380.<br />

Error messages

DBD::mysql::db selectall_arrayref failed: Incorrect table name '' at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 381.

Call stack

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

  • in WeBWorK::Utils::ListingDB::getDBListings called at line 399 of /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm
  • in WeBWorK::Utils::ListingDB::countDBListings called at line 614 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel2adv called at line 431 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel called at line 799 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::make_top_row called at line 1374 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 496 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 200 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm

Request information

In reply to Hal Sadofsky

Re: mysql error in library browser

by Hal Sadofsky -

Just to close this out in case anyone else has this problem and stumbles across this thread.  There was a typo in one of the WeBWorK source files:

The file ListingDB.pm on line 366 had DBsection where it should have had dbsection.  I edited that line, restarted apache, and all was well.  I believe the source on github has been patched too, so this error is unlikely to affect others.


Hal