I had uploaded many resources, and had created many activities for a particular module, and it never give me any problem, not till...
I uploaded a resource, and encounter the following problem:
Error finding or creating section structures for this course
Help! I do not want all my efforts to be wasted! How can the above problem be resoloved? Do I need to wipe out everything and start everything afresh???
Cheers
Re: Error finding or creating section structures for this course
Looking at the codes course/view.php, here's where it trigger the error message:
if (! $sections = get_all_sections($course->id) ) {
error("Error finding or creating section structures for this course");
}
By printing courseid, error($section->course), it had provided me with the associated course id.
Looking at course/lib.php:
function get_all_sections($courseid) {
return get_records("course_sections", "course", "$courseid", "section",
"section, id, course, summary, sequence");
}
Where the function get_records were being defined?
I have not make any changes to database or codes, the only actions I took are just add and uploading resources...., and right now each time I clicked on the course name, all give rise to the same error messages, even if I have just recently added a new course (after the error arises).
By masking the if condition in view.php:
if (! $sections = get_all_sections($course->id) ) {
error("Error finding or creating section structures for this course");
}
I am able to get into my course page, I still can see my uploaded files via Administration:Files, however I have lost all my Actvity:Resources, Quizzes, Assignments, Forums!!!! (By clicking on the resources link, it says no resources find), however I am able to see those resouces still in my mysql database (example my quiz in mdl_quiz_question)
I believe just inputs, linklist in the database had gone wrong, by identifying that I need not have to key in everything again. Frankly I really have not edit or manually add records into the database.
Can someone point me the lights? My experience illustrate the importance of backup your data, database!!!
Anyway despite the above, I have to admit that this is a really good application! I believe I just have to re keyin all my earlier information once again, if no help is round the corner.
Cheers!
Re: Error finding or creating section structures for this course
Can't open file: 'mdl_course_sections.MYI'. (errno: 145)
Error
SQL-query :
SHOW KEYS FROM `mdl_course_sections`
MySQL said:
Can't open file: 'mdl_course_sections.MYI'. (errno: 145)
Back
Re: Error finding or creating section structures for this course
http://www.gossamer-threads.com/forum/Gossamer_Forum_C7/Products_C7/Discussion_F22/cant_find_file_gforum_Session.MYD_P212208/
Re: Error finding or creating section structures for this course
(no need to keep posting new messages, you can edit existing ones )
I've never seen this problem happen before - what version are you using? Have you upgraded recently? If you upgraded, did you make sure to visit the admin page after the upgrade?
Since you seem comfortable with editing code, two useful debugging tricks are:
$db->debug = true; // shows SQL commands and errors
print_object($variable); // prints any variable nicely
Re: Error finding or creating section structures for this course
Here's the information:
Moodle 1.0.8.1 (2003011200)
Apache: 1.3.27 (unix)
Mysql: 4.0.12
Php: 4.3.1
Linux Kernal: 2.4.18-14smp
I have not done any upgrade, this is a fresh install. THe application has been working fine despite all the resources I had created, till I add a resource (add an uploaded file), infact I have been adding resources (including adding uploaded files) the whole day.
So it seems that this problem just pop up, database overload???
I have yet to repair the table, hope it works.
cheers!
Re: Error finding or creating section structures for this course
Re: Error finding or creating section structures for this course
Yes it seems that this problem persists if 'something' happened to your mysql while you update your tables.
So it again strengthened my faith on Moodle.
Re: Error finding or creating section structures for this course
Using Moodle 1.21
I've seen this error 2x on our first course. The time it happened today I know exactly what I was doing and have a hunch as to what not to do now.
We ran a chat this morning with ~10 people and all seemed well except my connection was really slow at times so It's a local ISP issue. Few others in the chat had any problems except us on the US west coast so I figure one of the big pipes or possibly the latest sassy worm is taking its toll.
So, after the chat I am adding on new resources while other students are logged in doing work and reading. I get impatient because my computer seems to time out while waiting for a resource to add (an uplaoded file that I had already uploaded via FTP) so I click on Save again and it's the 2nd instance that locked the table. Instead of MYISAM, Myphpadmin list s the table as in use and noone can view the site because of the afforementioned error message.
A simple REPAIR TABLE mdl_course_sections fixed the problem and another backup ensures nothing lost.
Hope this helps someone in the future.
Eric