Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with sql_mode=only_full_group_by error when searching for problems to assign. #2651

Open
tpegues2 opened this issue Jan 7, 2025 · 20 comments

Comments

@tpegues2
Copy link

tpegues2 commented Jan 7, 2025

Running ww_version: 2.19 in Docker environment.

Getting an error when searching for problems to assign for homework from problem database.

DBD::mysql::db selectall_arrayref failed: Expression #2 of SELECT list is not in GROUP BY clause and
contains nonaggregated column 'webwork.pgf.morelt_id' which is not functionally dependent on columns in
GROUP BY clause; this is incompatible with sql_mode=only_full_group_by at
/opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 339.

334: dbc.DBchapter_id = dbsc.DBchapter_id AND
335: dbsc.DBsection_id = pgf.DBsection_id AND
336: p.path_id = pgf.path_id
337: $extrawhere $kw_where $group_by";
338:
339: $pg_file_ref = $dbh->selectall_arrayref($query, {}, @select_parameters, @keyword_parameters);
340: }
341:
342: return $pg_file_ref->[0][0] if $amcounter;
343:
344: my @results;

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

Please give more details. What do you mean "when searching for problems to assign for homework from problem database"? What are you doing in the user interface to cause the issue?

@tpegues2
Copy link
Author

tpegues2 commented Jan 7, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

It sounds like you need to update your OPL database. You may need to run the OPL-update script.

@tpegues2
Copy link
Author

tpegues2 commented Jan 7, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

You will need to run the OPL-update script as the user that owns the /opt/webwork/libraries/webwork-open-problem-library directory.

@tpegues2
Copy link
Author

tpegues2 commented Jan 7, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

What version of WeBWorK did you upgrade from?

@tpegues2
Copy link
Author

tpegues2 commented Jan 7, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

I don't know how you were able to run the OPL-update script as a user other than the owner of the /opt/webwork/libraries/webwork-open-problem-library before. Even with WeBWorK 2.18 that would have been needed. That was a change by git, not by WeBWorK, and that change was made years ago. Well before Ubuntu 22.04 was released (the version of Ubuntu for the docker build with 2.18). This is what the fatal: detected dubious ownership in repository errors are about.

@tpegues2
Copy link
Author

tpegues2 commented Jan 7, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

Yes, you can still use that. It is OPL-update-legacy.

@tpegues2
Copy link
Author

tpegues2 commented Jan 7, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 7, 2025

The legacy script will take at least 10 minutes to complete. That is with a fast computer. Good luck.

@tpegues2
Copy link
Author

tpegues2 commented Jan 8, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 8, 2025

It seems the problem is your database settings. You have sql_mode=only_full_group_by set for the database. Remove that setting from your configuration.

@drgrice1
Copy link
Member

drgrice1 commented Jan 8, 2025

In the database execute SELECT @@sql_mode. That will show the modes that you have enabled. In your case it will list ONLY_FULL_GROUP_BY. Find your database configuration file (on Ubuntu this is typically /etc/mysql/conf.d/mysql.cnf) and remove that option from the sql_mode setting (or add a sql_mode setting that doesn't have that option if needed) from the [mysqld] section.

@tpegues2
Copy link
Author

tpegues2 commented Jan 8, 2025 via email

@tpegues2
Copy link
Author

tpegues2 commented Jan 8, 2025 via email

@drgrice1
Copy link
Member

drgrice1 commented Jan 8, 2025

Yes, the messages about invalid subjects and chapters are normal. Those are caused by problems that are not correctly tagged in Contrib.

@tpegues2
Copy link
Author

tpegues2 commented Jan 8, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants