Unable to search after upgrading to Moodle 3.8.1+

Unable to search after upgrading to Moodle 3.8.1+

Joel R Smith -
回帖数:5

Hi,

Our environment is as follows:

Debian 9.12, Apache 2.4.25; PHP 7.2.21; MariaDB 10.4.12

We were running moodle latest 3.7 (From August 1, 2019), and upgraded to latest moodle 3.8.1+ (from yesterday). The upgrade seems to have completed, but at the very end there was this exception thrown:

Exception - Argument 1 passed to core_admin\local\settings\filesize::parse_bytes() must be of the type integer, string given, called in [dirroot]/admin/classes/local/settings/filesize.php on line 130

The site is functional on the new version, except that whenever we try and do a search, we get that exact error message. The problem seems to have to do with /html/admin/classes/local/settings/filesize.php

Here is what I think is the relevant section in that file:

124     public function get_setting(): ?array {
125         $bytes = $this->config_read($this->name);
126         if (is_null($bytes)) {
127             return null;
128         }
129
130         return self::parse_bytes($bytes);

Any ideas what may be the problem?

TIA!



回复Joel R Smith

Re: Unable to search after upgrading to Moodle 3.8.1+

Matteo Scaramuccia -

Hi Joel,
indeed that feature comes from MDL-46317, new since 3.8.

Guessing an issue here with the data stored into the DB which should be an actual integer.

HTH,
Matteo

回复Matteo Scaramuccia

Re: Unable to search after upgrading to Moodle 3.8.1+

Joel R Smith -
Thanks for that info. So it's the user quota field that may have incorrect data? When I go to Site administration > Administration > Security > Site security settings, I get the same error, so i can't even go there to change the field. Do you know where that would be stored in the database?
回复Matteo Scaramuccia

Re: Unable to search after upgrading to Moodle 3.8.1+

Joel R Smith -
Is this the user quota field? What should the value be set to?

MariaDB [moodle]> SELECT * FROM mdl_config WHERE name = 'userquota';
+-----+-----------+-------+
| id | name | value |
+-----+-----------+-------+
| 453 | userquota | 2048 |
+-----+-----------+-------+
1 row in set (0.000 sec)

MariaDB [moodle]> show columns from mdl_config;
+-------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+----------------+
| id | bigint(10) | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | UNI | | |
| value | longtext | NO | | NULL | |
+-------+--------------+------+-----+---------+----------------+
回复Joel R Smith

Re: Unable to search after upgrading to Moodle 3.8.1+

Ken Task -
Particularly helpful Moodlers的头像

Since you have ssh access ... go to code/admin/cli/ and issue:

php cfg.php |grep userquota

Have a 3.8.1+ and issuing above renders:

userquota    104857600

Quick fix/test via config.php to see if changing that variable would fix your issues:

edit config.php and add a line:

$CFG->userquota='104857600':

Save config.php ... no need to restart any service, just go to Moodle and try whatever was/is producing the error.

BTW, with that line in config.php one can go to the place where it's set, but cannot change that value until line is commented out in config.php.

And since you asked about columns in mdl_config, mine looks just like yours:

mysql> show columns from mdl_config;
+-------+--------------+------+-----+---------+----------------+
| Field | Type         | Null | Key | Default | Extra          |
+-------+--------------+------+-----+---------+----------------+
| id    | bigint(10)   | NO   | PRI | NULL    | auto_increment |
| name  | varchar(255) | NO   | UNI |         |                |
| value | longtext     | NO   |     | NULL    |                |
+-------+--------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

'SoS', Ken