error_opening_file WHILE TRYING TO COPY COURSE

error_opening_file WHILE TRYING TO COPY COURSE

Venky S發表於
Number of replies: 4
 I am running Moodle 4.2+ with php 8.0 and MariaDB.
I am trying to copy course to reuse it again. However from wherever I try to reuse the course, I keep getting errors.
While trying to create copy from the Manage Courses and Categories, I get this error:
error/error_opening_file
On switching to debugging mode, the stack trace is as follows:
File:
 ...ggers/file_logger.class.php
Line:
 71
Stack trace:
Error code: error_opening_file
$a contents: /home1/chemtopp/moodledata310/temp/backup//2b4d40bd153bac2f9f5c37cefd48bb2e.log
* line 71 of /backup/util/loggers/file_logger.class.php: base_logger_exception thrown
* line ? of unknownfile: call to file_logger->__wakeup()
* line 97 of /backup/util/dbops/restore_controller_dbops.class.php: call to unserialize()
* line 502 of /backup/controller/restore_controller.class.php: call to restore_controller_dbops::load_controller()
* line 244 of /backup/util/helper/copy_helper.class.php: call to restore_controller::load_controller()
* line ? of unknownfile: call to copy_helper::{closure}()
* line 247 of /backup/util/helper/copy_helper.class.php: call to array_map()
* line 143 of /backup/util/helper/copy_helper.class.php: call to copy_helper::map_backupids_to_restore_controller()
* line 75 of /backup/util/ui/classes/output/copy_form.php: call to copy_helper::get_copies()
* line 214 of /lib/formslib.php: call to core_backup\output\copy_form->definition()
* line 5033 of /course/lib.php: call to moodleform->__construct()
* line 8064 of /lib/moodlelib.php: call to course_output_fragment_new_base_form()
* line 415 of /lib/external/externallib.php: call to component_callback()
* line ? of unknownfile: call to core_external::get_fragment()
* line 251 of /lib/external/classes/external_api.php: call to call_user_func_array()
* line 83 of /lib/ajax/service.php: call to core_external\external_api::call_external_function()

Error code: error_opening_file
$a contents: /home1/chemtopp/moodledata310/temp/backup//2b4d40bd153bac2f9f5c37cefd48bb2e.log
* line 71 of /backup/util/loggers/file_logger.class.php: base_logger_exception thrown
* line ? of unknownfile: call to file_logger->__wakeup()
* line 97 of /backup/util/dbops/restore_controller_dbops.class.php: call to unserialize()
* line 502 of /backup/controller/restore_controller.class.php: call to restore_controller_dbops::load_controller()
* line 244 of /backup/util/helper/copy_helper.class.php: call to restore_controller::load_controller()
* line ? of unknownfile: call to copy_helper::{closure}()
* line 247 of /backup/util/helper/copy_helper.class.php: call to array_map()
* line 143 of /backup/util/helper/copy_helper.class.php: call to copy_helper::map_backupids_to_restore_controller()
* line 75 of /backup/util/ui/classes/output/copy_form.php: call to copy_helper::get_copies()
* line 214 of /lib/formslib.php: call to core_backup\output\copy_form->definition()
* line 5033 of /course/lib.php: call to moodleform->__construct()
* line 8064 of /lib/moodlelib.php: call to course_output_fragment_new_base_form()
* line 415 of /lib/external/externallib.php: call to component_callback()
* line ? of unknownfile: call to core_external::get_fragment()
* line 251 of /lib/external/classes/external_api.php: call to call_user_func_array()
* line 83 of /lib/ajax/service.php: call to core_external\external_api::call_external_function()

Any help in resolving the issue is appreciated.
Thanks


評比平均分數: -
In reply to Venky S

Re: error_opening_file WHILE TRYING TO COPY COURSE

Ken Task發表於
Particularly helpful Moodlers的相片
Under 'any help' ... a suggestion ..
Am thinking: when you copy a course moodle makes a backup of that course then restores it.

Debug line show 
$a contents: /home1/chemtopp/moodledata310/temp/backup//2b4d40bd153bac2f9f5c37cefd48bb2e.log

$a contents might be the .mbz (the backup) file in
/home1/chemtopp/moodledata310/temp/backup/
But note the log name ...
Is there a directory in moodledata310/temp/backup/
with same name as log file: 2b4d40bd153bac2f9f5c37cefd48bb2e
for that matter any long directory name? If so, go inspect the directory with anything you have to browse files.
What's in there?

Also .... does the GUI interface show a progress bar and allow you to go onto other things while this is running by a button?
If so, don't click that .. don't go onto other things - wait right there so you can see it finish.

Work around might be so have backups to a desitnated directory that is outside of moodledata. One that you create. The backup file
will then be humanly recognizable. If you have command line, there is a restore script in code/admin/cli/ called
"restore_backup.php" ... have used that in fashion briefy described above. That does work.

'SoS', Ken

In reply to Ken Task

Re: error_opening_file WHILE TRYING TO COPY COURSE

Venky S發表於
Thanks Ken for your prompt reply.
I checked in the moodledata/temp/backup dir and there was no folder in there.
So probably the process does not get launched.
However taking on the cue that it would create a backup first and then restore it, I started backups from the Manage Courses and Categories. But the same would get stuck at exactly 92.3 % everytime and a temp file and folder would be created in the moodledata/temp/backup dir.
This got me thinking that there is some part of the backup that is getting stuck. So I removed items one by one from the selection for backup and found that if I removed the question bank, the backup was completed and I was also able to restore it as a new course.
The only issue being that I will have to manually create the quizzes again.
It is strongly suggested that in the process of backup, in case it gets stuck due to some reason, a indication be provided so that the particular part may be excluded from the backup.
Thanks again.
In reply to Venky S

Re: error_opening_file WHILE TRYING TO COPY COURSE

Ken Task發表於
Particularly helpful Moodlers的相片
"It is strongly suggested that in the process of backup, in case it gets stuck due to some reason, a indication be provided so that the particular part may be excluded from the backup."

I agree ... but programmers will say that's kinda already done with the plans ... and stages of the plan ... to make the backup.   Were there any log files larger than 0 bytes in moodledata/temp/backup/ ?    Is so, what did they contain?

Could be that your timeouts need to be increases in PHP.   Fact that it gets to the 90's % might mean you were close!

Did you turn on debugging to see what else moodle might be complaining about?

Quizzes are heavy processing ... rather than disabling ALL quizzes, how about say 1/3 of them included.   It might be an issue with just one quiz!

In older versions of Moodle there used to be a health check tool that has now been removed in 4.2! 傷心   That health check used to find issues with Quizzes and provide suggested SQL solutions if it could.

'SoS', Ken

In reply to Ken Task

Re: error_opening_file WHILE TRYING TO COPY COURSE

Séverin TERRIER發表於
Documentation writers的相片 Particularly helpful Moodlers的相片 Testers的相片 Translators的相片
Hi,

The Health check tool is in the plugin database :
https://moodle.org/plugins/tool_health

Officially compatible with Moodle 4.0 (only) at the moment, but should certainly work with more recent versions. Would be helpfull if HQ updated the supported version, so that it's simpler to install.

HTH,
Séverin