Testing and QA

 
 
Picture of Fritz Richter
Install Moodle 2.0 "Could not find a top-level course!"
 
Installing Moodle 2.0 Preview I get the following error:

"Could not find a top-level course!"

Does anyone know, what's going wrong? Thanks for any support!

Fritz
 
Average of ratings: -
Picture of Helen Foster
Re: Install Moodle 2.0 "Could not find a top-level course!"
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Hi Fritz,

Could you try installing Moodle 2.0 preview 2 and see whether you still obtain the error message.

Just moving this discussion to the testing and QA forum...
 
Average of ratings: -
Picture of Marco P
Odp: Re: Install Moodle 2.0 "Could not find a top-level course!"
 
in 2.0 RC still the same, Could not find a top-level course!
 
Average of ratings: -
Picture of Helen Foster
Re: Odp: Re: Install Moodle 2.0 "Could not find a top-level course!"
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Please could you provide more details of exactly where you see the error message, as in order to fix problems, developers first need to be able to reliably reproduce them. You could also try enabling developer debugging on your site (see the documentation Debugging for details).
 
Average of ratings: -
Picture of Marco P
Odp: Re: Odp: Re: Install Moodle 2.0 "Could not find a top-level course!"
 
after the installation step where you have to type in the MySQL details (and no, everything is correct, moodle 1.9.8 works fine)/

server configuration can be checked here http://monstrual.zxy.me/check.php

now the problem changed into " Config table does not contain version, cannot continue, sorry".

to reproduce it just visit http://monstrual.zxy.me/moodle2/
 
Average of ratings: -
Picture of Steve Montano
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hi all.  I saw the same "could not find a top level course" error upon installing the latest moodle 2.0 (as of Dec 15th 2010).  Any suggested solutions?

Thank you,

Steve

 
Average of ratings: -
Picture of Rod G
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hi, I got the same error after the server checkings, I was trying to install moodle 2.0.1 on a localhost server.

I tried several times from scratch, same error shows up: could not find a top-level course ??

I'll try with an older version (1.9.10), because I'm stucked now.

 
Average of ratings: -
Picture of Rod G
Re: Install Moodle 2.0 "Could not find a top-level course!"
 
The installation ran smoothly with version 1.9.10
 
Average of ratings: -
Picture of Eric Smith
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

This problem stems from PHP caching. Clear out any PHP cache you're running before you attempt the install or upgrade. (Restarting Apache will do it if you're unfamiliar)

 
Average of ratings: -
Picture of brian davis
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

pardon the ignorance, i haver googled but could not find an solution. but how do you "Clear out any PHP cache you're running" ??

i have server 03, IIS 6, php 5.3  (restarting IIS does not seem to matter)

i have a phpinfo page but i dont know what i am supposed to look for on it, its huge.

 
Average of ratings: -
Picture of Nancy Hoorn
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

If I have just installed Moodle on a localhost for the first time (not yet run), there should not be any php caching, should there?

just fyi (I haven't seen this yet), I right clicked the moodle start icon and selected run as...  I did not have to change the user, but did uncheck the "protect my computer..." box.  So far, that seems to have worked.

 
Average of ratings: -
Picture of Trinath Mallavarapu
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

The same problem was faced by me. But after doing these steps i Get out of this Problm Guys.

1) Deleted the Old Database and All old Moodle Files from Hosting.

2) Again Extracted the Moodle to the Hosting.

3) Created the Database and user.

4) Finally used the New Database details for Installation.

5) Yhis time i didn't get the ERROR.

 

Installation Completed Sucessfully Guys.

 
Average of ratings: -
Ricardo Botti.
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Did all that a gazillion times. No good.

Up to now, February 2012 - no  answer about this problem which either means...nobody knows the solution or everyone already solved it.

I'm seriously thinking about another Learning Management. Any suggestions?

 
Average of ratings: -
Picture of Helen Foster
Re: Install Moodle 2.0 "Could not find a top-level course!"
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Ricardo,

What version of Moodle are you using? I can confirm that the problem has been fixed in Moodle 2.1 onwards.

 
Average of ratings: -
Picture of Stephen D'Agostino
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hi

I've just installed 2.2.1+ on  windows, php 5.3.6 / MySQL 5.5.

info

 
Average of ratings: -
Picture of Stephen D'Agostino
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Tracked down the source of the error but none the wiser...

ln 354 in lib/datalib.php

if ($course = $DB->get_record('course', array('category'=>0))) {
        return $course;
    } else {
        echo('Assignment in condition');
        // course table exists, but the site is not there,
        // unfortunately there is no automatic way to recover
        throw new moodle_exception('nosite', 'error');
    }

 
Average of ratings: -
Picture of Stephen D'Agostino
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

"solved" my problem by installing on a linux box - would sill like a solution though if anyone can help? smile

 
Average of ratings: -
Miguel
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

I solved this issue by looking up the "front page" course.  I noticed that the category was set to 1 instead of 0.  I updated the record and the site was accessible again.

Update mdl_course set category = '0' where format = 'site' and id = 1;

Hope this helps the rest of you.

 
Average of ratings:Useful (3)
Picture of Richard Pan
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hi,

I'm also having the same problem. When I finished installing all the prequisites of moodle. Suddenly it dispaly the error that there's no course in the database.

When I tried Miguel's way, I found that my course table is empty. So I can't change anything in it.

I'm using php 5.5, moodle 2.2, apache server and mysql 5.2

Thanx for any of your help

 
Average of ratings: -
Picture of Carly Born
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

I'm having the same trouble as Richard with Moodle 2.2 Build 20120312 on a hosted service (Dreamhost)

 
Average of ratings: -
Picture of Eric Remy
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

I'm also seeing this error: Moodle 2.1.4 on Hostmonster.

The error occurs right after the "does your server meet the requirements" check page. 

It was fixed by the "Update mdl_course set category = '0' where format = 'site' and id = 1;" SQL command, but it seems like there is something odd in the initial config.

 
Average of ratings: -
Picture of Katin Imes
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Thanks, Miguel. That fixed it for me!

 
Average of ratings: -
Picture of Yujie Yuan
回复: Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Thanks Miguel! 

I got the same error after the servers checking when I install moodle 2.2.4 on a localhost server which setup by wampserver2.2 in win7.

 I found that the category was set to 0 while the visible was set to 1 instead of 0, and the site was accessible after the record change.

 
Average of ratings: -
Picture of Priyanka A
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hi Miguel,

Even I am facing the same problem "Could not find a top-level course!".  I am new to moodle. I got this messege once I finished the installation.

I am trying to fix this using the solution mentioned by you but my mdl_course table is empty. Infact I think all my tables are empty.

Can you pleas suggest any solution. Where am I going wroong?

Thank you.

 
Average of ratings: -
Miguel
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hi,

I have not encountered the mdl_course table being empty.  Are you upgrading an existing moodle site, or starting from scratch?  If you are starting from scatch you could create the record via SQL.

insert into mdl_course (id, category, sortorder, fullname, shortname, idnumber, summary, summaryformat, format, showgrades, modinfo, newsitems, startdate, numsections, marker, maxbytes, legacyfiles, showreports, visible, visibleold, hiddensections, groupmode, groupmodeforce, defaultgroupingid, lang, theme, timecreated, timemodified, requested, restrictmodules, enablecompletion, completionstartonenrol, completionnotify)
Value
( 1, 0, 1, 'moodle2', 'moodle2', '', '', 0, 'site', 1, 'a:0:{}', 3, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0);

 
Average of ratings: -
Picture of Erdal Şahin
Ynt: Re: Install Moodle 2.0 "Could not find a top-level course!"
 

Hello. I had same problem. I fixed it.

it is a time out problem. if server time out shortly  appear this problem when installing. You want help your hosting administrator. he must make time out  more long, will not be any problem when installing...

I hope it be help for you.

 
Average of ratings: -
Picture of Steven Woods
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

I also had this issue but it was my own fault. I accidentally restarted ISS while it was provisioning the database.

I decided to drop all of the tables from the database. What I didn't expect, and luckily curiousity got the best of me, was that all I had to do was try to browse to the admin directory and it reprovisioned them automatically.

 
Average of ratings: -
Picture of Allan Johnston
Re: Install Moodle 2.0 "Could not find a top-level course!"
 

I have also been struggling with this issue for ... oh, a long time.  I would first get a FastCGI error (timeout) and then, upon refreshing my browser, get a "Could not find a top-level course!" error message.  FastCGI is set to time-out after only 70 seconds, I think I read somewhere, much, much too short for a giant install like Moodle.  It's normally set to this default to prevent waiting for a CGI foul-up that will never actually resolve on its own.  So ... I deleted all tables in my database using "PHPMyAdmin", available free for download.  I could have just deleted the database itself instead - either one would have done.  I then inserted "ActivityTimeout=600" (10 minutes) into the PHP section (bottom) of fcgiext.ini (without the ";" symbol) (found in the c:- windows- system32- inetsrv- folder).  This, I thought, should prevent a timeout.  Same results, but something new - I saw more database tables were created - many more than before - which suggested that it was actually still installing but got interrupted after 5 minutes.  According to some webs, Moodle 2.something setup should take about 15 minutes on some computers, so my thinking is that 20 minutes ought to do it.  I changed the "ActivityTimeout" setting to 1200 seconds (20 minutes).  I went back to the URL of the Moodle site and began installation again, building the database tables from scratch.  Guess what - SUCCESS.  My database was built, and FastCGI didn't time-out.  I hope this helps.  Good luck to everyone in the wonderful world of DIY websites.

 
Average of ratings: -