Moodle

Incorrect content of hash pool file

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Backup, Files API, SCORM
  • Environment:
    Linux Centos 4, MySQL, PHP 5.2.10, Moodle 2.0 Build: 20101214
  • Database:
    MySQL
  • Difficulty:
    Moderate
  • Affected Branches:
    MOODLE_20_STABLE

Description

I was trying to add a new scorm activity, using the same file with a different name (current.zip and current_new.zip, for example), from a repository I have, but moodle doesn't allow me deploy the package (see attached screenshot)

I checked the "files" table and both files have the same contenthash, what I suspect may be the problem.

This issue was also reported here http://moodle.org/mod/forum/discuss.php?d=164323 but with a different approach (backup)

Activity

Hide
Luis de Vasconcelos added a comment -

I'm experiencing the same problem upgrading a 1.9.10+ (Build: 20110112) site to version 2.0.3+ (Build: 20110511).

I traced it down to a file called D:\MoodleData\filedir\91\b7\91b75477f04e8186413828618bd9e09e2c2203ca which is a 81,068 KB file! I don't know what it is!

My PHP PHPErrors.log file has this info:

[16-May-2011 08:56:22] Default exception handler: Incorrect pool file content 91b75477f04e8186413828618bd9e09e2c2203ca. Debug:

  • line 1062 of \lib\filestorage\file_storage.php: file_pool_content_exception thrown
  • line 810 of \lib\filestorage\file_storage.php: call to file_storage->add_file_to_pool()
  • line 337 of \lib\db\upgradelib.php: call to file_storage->create_file_from_pathname()
  • line 360 of \lib\db\upgradelib.php: call to upgrade_migrate_files_course()
  • line 98 of \lib\db\upgradelib.php: call to upgrade_migrate_files_course()
  • line 593 of \lib\db\upgrade.php: call to upgrade_migrate_files_courses()
  • line 1382 of \lib\upgradelib.php: call to xmldb_main_upgrade()
  • line 273 of \admin\index.php: call to upgrade_core()

I don't have any scorm content in any of my courses.

These related 'Using Moodle' forum discussions don't have any workable solutions: http://moodle.org/mod/forum/discuss.php?d=172909
http://moodle.org/mod/forum/discuss.php?d=163074

Show
Luis de Vasconcelos added a comment - I'm experiencing the same problem upgrading a 1.9.10+ (Build: 20110112) site to version 2.0.3+ (Build: 20110511). I traced it down to a file called D:\MoodleData\filedir\91\b7\91b75477f04e8186413828618bd9e09e2c2203ca which is a 81,068 KB file! I don't know what it is! My PHP PHPErrors.log file has this info: [16-May-2011 08:56:22] Default exception handler: Incorrect pool file content 91b75477f04e8186413828618bd9e09e2c2203ca. Debug:
  • line 1062 of \lib\filestorage\file_storage.php: file_pool_content_exception thrown
  • line 810 of \lib\filestorage\file_storage.php: call to file_storage->add_file_to_pool()
  • line 337 of \lib\db\upgradelib.php: call to file_storage->create_file_from_pathname()
  • line 360 of \lib\db\upgradelib.php: call to upgrade_migrate_files_course()
  • line 98 of \lib\db\upgradelib.php: call to upgrade_migrate_files_course()
  • line 593 of \lib\db\upgrade.php: call to upgrade_migrate_files_courses()
  • line 1382 of \lib\upgradelib.php: call to xmldb_main_upgrade()
  • line 273 of \admin\index.php: call to upgrade_core()
I don't have any scorm content in any of my courses. These related 'Using Moodle' forum discussions don't have any workable solutions: http://moodle.org/mod/forum/discuss.php?d=172909 http://moodle.org/mod/forum/discuss.php?d=163074
Hide
Luis de Vasconcelos added a comment -

Running this query does not return any results:
SELECT * FROM mdl_files WHERE contenthash = '91b75477f04e8186413828618bd9e09e2c2203ca';

My site is running on this platform:

Windows Server 2003 Standard Edition (Build 3790: Service Pack 2)
Intel Xeon CPU 5120 @ 1.86GHz 512MB RAM
IIS 6.0.3790.4735
Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) Standard Edition
PHP 5.3.3 NTS VC9
PHP date.timezone = "Africa/Johannesburg"
Microsoft FastCGI Handler x86 6.1.36.1
Microsoft SQL Server Driver for PHP 2.0.1802.200
Microsoft Windows Cache Extension for PHP 1.1.630.0

Moodle config:
$CFG->dbtype = 'sqlsrv';
$CFG->dblibrary = 'native';

Show
Luis de Vasconcelos added a comment - Running this query does not return any results: SELECT * FROM mdl_files WHERE contenthash = '91b75477f04e8186413828618bd9e09e2c2203ca'; My site is running on this platform: Windows Server 2003 Standard Edition (Build 3790: Service Pack 2) Intel Xeon CPU 5120 @ 1.86GHz 512MB RAM IIS 6.0.3790.4735 Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) Standard Edition PHP 5.3.3 NTS VC9 PHP date.timezone = "Africa/Johannesburg" Microsoft FastCGI Handler x86 6.1.36.1 Microsoft SQL Server Driver for PHP 2.0.1802.200 Microsoft Windows Cache Extension for PHP 1.1.630.0 Moodle config: $CFG->dbtype = 'sqlsrv'; $CFG->dblibrary = 'native';
Hide
Luis de Vasconcelos added a comment -

I tried upgrading the 1.9.10+ (Build: 20110112) site to version 2.0.2+ (Build: 20110427) and I get the same "Incorrect pool file content" error.

So I guess there's a "bad file" somewhere in one of my courses.

How do I identify what that D:\MoodleData\filedir\91\b7\91b75477f04e8186413828618bd9e09e2c2203ca file is?

Show
Luis de Vasconcelos added a comment - I tried upgrading the 1.9.10+ (Build: 20110112) site to version 2.0.2+ (Build: 20110427) and I get the same "Incorrect pool file content" error. So I guess there's a "bad file" somewhere in one of my courses. How do I identify what that D:\MoodleData\filedir\91\b7\91b75477f04e8186413828618bd9e09e2c2203ca file is?
Hide
Walter Draffin, Jr added a comment -

If you look at the bottom of this thread at my post, you will see some more details on the backup/restore issue.

http://moodle.org/mod/forum/discuss.php?d=163074

Show
Walter Draffin, Jr added a comment - If you look at the bottom of this thread at my post, you will see some more details on the backup/restore issue. http://moodle.org/mod/forum/discuss.php?d=163074
Hide
Nick Freeman added a comment -

We experienced a similar problem when upgrading from 1.9.12 to 2.1 in a windows environment. All system checks were OK, but then, after about 30 seconds (without going to the upgrade page with the % bars), we got the message "Site is being upgraded, please retry later".

The upgrade did appear to have worked fine in terms of code (definitely lookedlike 2.1 code!) and database (300 tables in the schema) but nothing had happened with the files.

We had previously managed a successful upgrade on a staging server, with the same windows environment setup. However, afterwards, we realised that we had done this with an empty moodledata folder; hence the reasoning that it was a file migration error.

However, as we had a recent copy of the 1.9.12 site on a linux machine, we tried the upgrade there and it worked fine.

The windows environment was:

  • PHP5.3.6
  • mysql 5.0.8
  • IIS 7

The linux environment was:

  • PHP 5.3.2-1ubuntu4.9
  • mysql 5.1.41, for debian-linux-gnu (i486)
  • Apache/2.2.14 (Ubuntu)

Hope that helps

Show
Nick Freeman added a comment - We experienced a similar problem when upgrading from 1.9.12 to 2.1 in a windows environment. All system checks were OK, but then, after about 30 seconds (without going to the upgrade page with the % bars), we got the message "Site is being upgraded, please retry later". The upgrade did appear to have worked fine in terms of code (definitely lookedlike 2.1 code!) and database (300 tables in the schema) but nothing had happened with the files. We had previously managed a successful upgrade on a staging server, with the same windows environment setup. However, afterwards, we realised that we had done this with an empty moodledata folder; hence the reasoning that it was a file migration error. However, as we had a recent copy of the 1.9.12 site on a linux machine, we tried the upgrade there and it worked fine. The windows environment was:
  • PHP5.3.6
  • mysql 5.0.8
  • IIS 7
The linux environment was:
  • PHP 5.3.2-1ubuntu4.9
  • mysql 5.1.41, for debian-linux-gnu (i486)
  • Apache/2.2.14 (Ubuntu)
Hope that helps
Hide
Walter Draffin, Jr added a comment -

We just tried doing an import and received the same error as mentioned in my post here http://moodle.org/mod/forum/discuss.php?d=163074

Show
Walter Draffin, Jr added a comment - We just tried doing an import and received the same error as mentioned in my post here http://moodle.org/mod/forum/discuss.php?d=163074
Hide
Richard Lang added a comment -

I think this issue needs urgent attention. We are having problems adding a SCORM activity to a course. We can select the SCORM file, but as soon as we click 'Save and return to course', we get the error 'Incorrect pool file content'. The long string of characters in the error is traceable back to a specific file created in moodledata/filedir.

We also get the error intimitently when trying to upload other files such as gif files or png's to profile pics. I have also tried creating a very small SCORM activity with only HTML files within it, but it makes not difference.

I have tried on two different shared hosts, one with a custom theme, and one with a fresh install. Not migration or backing up, just installing Moodle 2.1 and trying to upload a file.

This is more than a backup/restore issue... it seems to be a filedir issue in Moodle 2.1

Show
Richard Lang added a comment - I think this issue needs urgent attention. We are having problems adding a SCORM activity to a course. We can select the SCORM file, but as soon as we click 'Save and return to course', we get the error 'Incorrect pool file content'. The long string of characters in the error is traceable back to a specific file created in moodledata/filedir. We also get the error intimitently when trying to upload other files such as gif files or png's to profile pics. I have also tried creating a very small SCORM activity with only HTML files within it, but it makes not difference. I have tried on two different shared hosts, one with a custom theme, and one with a fresh install. Not migration or backing up, just installing Moodle 2.1 and trying to upload a file. This is more than a backup/restore issue... it seems to be a filedir issue in Moodle 2.1
Hide
Xavier Paz added a comment -

I've experienced it again, still related with scorm but in a different situation. I had a SCORM activiy already created, but when I selected the same zip to deploy all again in the same course, Moodle showed the same "incorrect hash pool" message and then, I can't deploy the same zip in other courses along the platform.

I agree with Richard, the issue really needs urgent attention.

Show
Xavier Paz added a comment - I've experienced it again, still related with scorm but in a different situation. I had a SCORM activiy already created, but when I selected the same zip to deploy all again in the same course, Moodle showed the same "incorrect hash pool" message and then, I can't deploy the same zip in other courses along the platform. I agree with Richard, the issue really needs urgent attention.
Hide
Walter Draffin, Jr added a comment -

I fixed our installation. I was using the BigBlueButton plugin and it was causing the problem. I deleted that plugin and removed the folder from the mod folder, and all issues are fixed.

Show
Walter Draffin, Jr added a comment - I fixed our installation. I was using the BigBlueButton plugin and it was causing the problem. I deleted that plugin and removed the folder from the mod folder, and all issues are fixed.
Hide
sschafft added a comment -

I am having a similar issue. I think this might have to do with the SCORM size. The SCORM package I was given to use was 190MB, the file size upload limit is 256MB (set in PHP) . The course uploads fine as a file, however if I add it as a SCORM package it fails and I get a "incorrect hash pool" message. All other SCORM packages work at smaller sizes.

I am running 2.0.6 Build 20111205 on a shared hosting environment that is based on Debian Linux.

Error / Stack Trace:

"Incorrect pool file content b3f9a14348ccbb8d30a176118129358457ae137b."

Stack trace:
line 1149 of /lib/filestorage/file_storage.php: file_pool_content_exception thrown
line 951 of /lib/filestorage/file_storage.php: call to file_storage->add_string_to_pool()
line 353 of /lib/filestorage/zip_packer.php: call to file_storage->create_file_from_string()
line 217 of /lib/filestorage/stored_file.php: call to zip_packer->extract_to_storage()
line 214 of /mod/scorm/locallib.php: call to stored_file->extract_to_storage()
line 118 of /mod/scorm/lib.php: call to scorm_parse()
line 410 of /course/modedit.php: call to scorm_add_instance()

Any ideas would be extremely helpful....

Show
sschafft added a comment - I am having a similar issue. I think this might have to do with the SCORM size. The SCORM package I was given to use was 190MB, the file size upload limit is 256MB (set in PHP) . The course uploads fine as a file, however if I add it as a SCORM package it fails and I get a "incorrect hash pool" message. All other SCORM packages work at smaller sizes. I am running 2.0.6 Build 20111205 on a shared hosting environment that is based on Debian Linux. Error / Stack Trace: "Incorrect pool file content b3f9a14348ccbb8d30a176118129358457ae137b." Stack trace: line 1149 of /lib/filestorage/file_storage.php: file_pool_content_exception thrown line 951 of /lib/filestorage/file_storage.php: call to file_storage->add_string_to_pool() line 353 of /lib/filestorage/zip_packer.php: call to file_storage->create_file_from_string() line 217 of /lib/filestorage/stored_file.php: call to zip_packer->extract_to_storage() line 214 of /mod/scorm/locallib.php: call to stored_file->extract_to_storage() line 118 of /mod/scorm/lib.php: call to scorm_parse() line 410 of /course/modedit.php: call to scorm_add_instance() Any ideas would be extremely helpful....
Hide
Virgil Ashruf added a comment -

This problem also still occurs in one of our 2.2.1 installation (build 20120202)

I copied this from our error_log

When opening a SCORM activity which was already in place:
[Wed Mar 14 09:51:58 2012] [error] [client 83.163.190.138] Default exception handler: Het gevraagde bestand is niet gevonden Debug: \n* line 435 of /lib/setuplib.php: moodle_exception thrown\n* line 1568 of /lib/filelib.php: call to print_error()\n* line 3860 of /lib/filelib.php: call to send_file_not_found()\n* line 37 of /pluginfile.php: call to file_pluginfile()\n, referer: http://our.2.2.1.installation/mod/scorm/loadSCO.php?a=183&scoid=531&currentorg=WIE5_6755399441055843_nl_Content&attempt=1

When trying to add a new SCORM activity
[Wed Mar 14 09:54:58 2012] [error] [client 83.163.190.138] Default exception handler: Foute inhoud pool-bestand 3213c0f4244e63cb1a1ce86e277d74da6160566c. Debug: \n* line 1163 of /lib/filestorage/file_storage.php: file_pool_content_exception thrown\n* line 959 of /lib/filestorage/file_storage.php: call to file_storage->add_string_to_pool()\n* line 353 of /lib/filestorage/zip_packer.php: call to file_storage->create_file_from_string()\n* line 217 of /lib/filestorage/stored_file.php: call to zip_packer->extract_to_storage()\n* line 229 of /mod/scorm/locallib.php: call to stored_file->extract_to_storage()\n* line 126 of /mod/scorm/lib.php: call to scorm_parse()\n* line 443 of /course/modedit.php: call to scorm_add_instance()\n, referer: http://our.2.2.1.installation/course/modedit.php?add=scorm&type=&course=199&section=1&return=0

Show
Virgil Ashruf added a comment - This problem also still occurs in one of our 2.2.1 installation (build 20120202) I copied this from our error_log When opening a SCORM activity which was already in place: [Wed Mar 14 09:51:58 2012] [error] [client 83.163.190.138] Default exception handler: Het gevraagde bestand is niet gevonden Debug: \n* line 435 of /lib/setuplib.php: moodle_exception thrown\n* line 1568 of /lib/filelib.php: call to print_error()\n* line 3860 of /lib/filelib.php: call to send_file_not_found()\n* line 37 of /pluginfile.php: call to file_pluginfile()\n, referer: http://our.2.2.1.installation/mod/scorm/loadSCO.php?a=183&scoid=531&currentorg=WIE5_6755399441055843_nl_Content&attempt=1 When trying to add a new SCORM activity [Wed Mar 14 09:54:58 2012] [error] [client 83.163.190.138] Default exception handler: Foute inhoud pool-bestand 3213c0f4244e63cb1a1ce86e277d74da6160566c. Debug: \n* line 1163 of /lib/filestorage/file_storage.php: file_pool_content_exception thrown\n* line 959 of /lib/filestorage/file_storage.php: call to file_storage->add_string_to_pool()\n* line 353 of /lib/filestorage/zip_packer.php: call to file_storage->create_file_from_string()\n* line 217 of /lib/filestorage/stored_file.php: call to zip_packer->extract_to_storage()\n* line 229 of /mod/scorm/locallib.php: call to stored_file->extract_to_storage()\n* line 126 of /mod/scorm/lib.php: call to scorm_parse()\n* line 443 of /course/modedit.php: call to scorm_add_instance()\n, referer: http://our.2.2.1.installation/course/modedit.php?add=scorm&type=&course=199&section=1&return=0
Hide
Carlos Escobedo Orea added a comment -

In our particular case (Moodle 2.2.1+ (Build: 20120202)) with a scorm file to resolve it we have broken the code in the file /lib/filestorage/filestorage.php in add_file_to_pool function in order to add the following line before throw new file_pool_content_exception($contenthash);

echo $hashfile;
die();
throw new file_pool_content_exception($contenthash);

So we can locate the file (which has 0bytes) in the moodledata/filedir/... and delete it. Is ugly solution but at least, we can continue working.

Show
Carlos Escobedo Orea added a comment - In our particular case (Moodle 2.2.1+ (Build: 20120202)) with a scorm file to resolve it we have broken the code in the file /lib/filestorage/filestorage.php in add_file_to_pool function in order to add the following line before throw new file_pool_content_exception($contenthash); echo $hashfile; die(); throw new file_pool_content_exception($contenthash); So we can locate the file (which has 0bytes) in the moodledata/filedir/... and delete it. Is ugly solution but at least, we can continue working.

Dates

  • Created:
    Updated: