Serious Error! Could not set up the site!

Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Number of replies: 32
When installing Moodle on my server, everthing works fine. The tables are created, the configuration page is displayed.
What seems to me the last (and very least) step  is the site description and site title.
When inserting the data (mysite....) and trying to save, I receive the following message:
"Serious Error! Could not set up the site!"

This topic has already been discussed in Aug 2004 - to no avail.
Maybe there is a helping brain out there in cyberspace?

Joachim
Average of ratings: -
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Not exactly a good start working with moodle. Tried another build for installation, received an error message.

Still waiting for successfull installation.
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Bill Burgos -
Hi Joachim,

Could you give us some information on how you set up your installation?

Server, database and versions?

Are you using Cpanel? Fantastico? Upload and unzip? CVS?

This will give us a bit to work on.

Bill
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Sorry, forgotten that part:

Tried a installation on localhost (WIN XP Home), with Apache 2.0.54 and PHP 5.0.4 and MySQL 5.0.

Installed with the installer.php. Downloaded the

Moodle 1.5.2 +
MOODLE_15_STABLE
daily build (yesterday, 6th Oct and today again).

Opened a bug report (Bug #4159) and located the error within the site.php script:. $newid seems to be empty (for whatever resons):


if ($newid = insert_record('course', $form)) {
// Site created, add blocks for it
$page = page_create_object(PAGE_COURSE_VIEW, $newid);
blocks_repopulate_page($page); // Return value not checked because you can always edit later
$cat->name = get_string('miscellaneous');

if (insert_record('course_categories', $cat)) {
     redirect("$CFG->wwwroot/$CFG->admin/index.php", get_string("changessaved"), 1);
   } else {
  error("Serious Error! Could not set up a default course category!");
                    }
  } else {
  error("Serious Error! Could not set up the site!");
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Bill Burgos -
Hi,

As mentioned in the August 2004 thread, I suspect that the database is not setting up properly. I would work on isolating the problem by eliminating the components.

I would start by checking that the database is working properly and then move on to using IIS instead of Apache before going into coding issues.

Bill
In reply to Bill Burgos

Re: Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Thanks for your answer. Afraid there isn't the slightes chance for me to switch to IIS, not even for Moodle. And I prefer to use Open-Source, if possible.

Most ISP use Apache over here and I'm trying to have a local Moodle running before going online.

Concerning the database, I think there is no reason to believe that the database is corrupted. I have installed the database new for moodle, all other applications are running very smooth and even Moodle could create all tables und insert all records - apart from the last one.
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Seems as if there isn't solution available. Bad luck.
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Bill Burgos -
Hi Joachim,

I am at a loss for this also. I have only seen this error message on the thread you pointed out before, it seems to be rare.

Are you able to access the database logs and see if there are any errors while setting up the installation? Web logs?

You might also try installing another version (1.4.x or 1.6) to see if the problem is reproducable in those versions.

In reply to Bill Burgos

Re: Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Hi Bill,

agree to your explanation concerning the IIS - I'll try it with the IIS instead of Apache (I can switch back later).

I have tried Version 1.4 but received many error messages, therefor I decided to go for the newest version.

I'll switch to IIS now and try to reinstall Moodle. After that I'll come back to you with my error log etc.


In reply to Bill Burgos

Re: Serious Error! Could not set up the site!

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> move on to using IIS instead of Apache before going into coding issues.

Could you please elaborate on how moving from Apache to IIS help the coding issues?
In reply to Visvanath Ratnaweera

Re: Serious Error! Could not set up the site!

by Bill Burgos -
Hi Visvanath,

My intent was not to express that Apache would help coding issues. I apologize if that was misunderstood. My intent was to express that to follow a process of eliminating some of the elements of the situation might isolate the problem.

If one is using IIS, then using Apache might show some discrepancies and visa-versa.

As this error message is rare (only one other thread on this site as I see), I would assume that a coding bug might be less probable than other elements (server settings, etc.) of the system.

In reply to Bill Burgos

Re: Serious Error! Could not set up the site!

by Nanda Firdausi -
Hi all,

I've the same problem here... And also my colleague at university.

My and his configuration is Windows XP, Mysql 5 RC1, PHP 5.0.5, Apache 2


In reply to Nanda Firdausi

Re: Serious Error! Could not set up the site!

by Joachim Korte-Bernard -
Seems to be a moodle problem. Don't know how to solve it. IIS isn't working with XP Home, I installed it on a different PC with WIN 2K and EasyPHP - but EasyPHP is using older PHP and MySQL version. Never had any probs with my installation before. 
In reply to Nanda Firdausi

Re: Serious Error! Could not set up the site!

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
I recall experiencing some difficulties with MySQL 5 - I would recommend dropping back to the stable 4.1 series of MySQL and see how things work.

I have had no problems setting up 1.5.2+ and 1.6 on XP using PHP 5.0.3 (I suspect 5.0.5 would not be a problem) and Apache 2.0.54.
In reply to Anthony Borrow

Re: Serious Error! Could not set up the site!

by Nanda Firdausi -
Everything works well after I downgrade mysql to 4.1.

Thx
In reply to Nanda Firdausi

Re: Serious Error! Could not set up the site!

by Ross Scott-Weekly -
This appears to be a problem with STRICT mode which was introduced with MySQL 5.0x. If you turn strict mode on the mysql server off, the problem fixes itself. More precisely, some of the insert_record statements appear to be failing, due to some fields in some tables being set with no default, and not null, which mysql on strict mode doesn't like.
In reply to Ross Scott-Weekly

Re: Serious Error! Could not set up the site!

by ic3000 ic3000 -
Hi all,

I´m not new in moodle but i´m new in the foruns!

I have no problems with moodle on linux that i´ve been using for a almost a year now.

My school is now building a web server for hosting is own moodle instalation and it will be on a windows machine with 2003 server.

I´ve no problems setting the database and the necessary software but when configuring the site i´ve the same problem described here.

I´ve MySQL 5.0.15 instaled and the problem remains the same...

I´m not an expert in MySQL admin and i really dont know how to disable the STRICT mode.

My Question is : How can i disable this mode in MySQL?

What are the right commands to give for disabling this mode?

Once again thank´s for the really nice software and the great support!

Hugo Batel
In reply to ic3000 ic3000

Re: Serious Error! Could not set up the site!

by Patrick Patrick -

I had that problem to, you have to comment this line out:

#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

then it should work

In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Rashan Anushka -
Yes I had this problem too after I upgrade mysql to version 5. I overcome this problem by disabling sql strict mode. Try this and hope u will solve ur problemsmile!
In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Jerome Ciesiolka -

Joachim,

I noticed something yesterday when working with php 5.0.5 and mysql 5.0.15.

See if this helps any.

Create a file called php.test and use the following:

<? php
phpinfoegg;
?>

View this file in your web browser (e.g. http://www.isp.com/moodle/test.php) and view the report. When you get down to MySQL -- assuming everything is setup correctly -- you will find the client to be version 4.0.12.

I mention this because, when I dropped MySQL back to version 4.0.12 everything worked fine. Until then, I couldn't get version 5.0.15 of MySQL to work with the program either.

Maybe this helps, maybe not.

In reply to Jerome Ciesiolka

Re: Serious Error! Could not set up the site!

by David Wilkinson -

HI,

I have been researching how to disable STRICT mode for MySql Tables. There appears to be no way to 'disable' it, or turn it 'off' in a direct way. However, this might work. You might be able to run MySql 5 in '4.0' mode, and this might "disable" strict mode.

See this documentation:

http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html

Basically what this means is that, If you are able to control how MySql is started you can try to use the "MySql40" mode as a command line parameter like this to "turn off" strict mode for your inserts:

mysqld --sql-mode="MYSQL40"

I believe the caps are significant.

HTH,
David

In reply to David Wilkinson

Re: Serious Error! Could not set up the site!

by ic3000 ic3000 -
Thanks David,

I will try this as soon as i can...(not with access to the server right now) and i will keep post what i found!

Anyone knows if the moodle development team is preparing a MySQL 5.0 compatible version?

If so is there a time table?

Thanks in advance!
In reply to ic3000 ic3000

Re: Serious Error! Could not set up the site!

by Genner Cerna -
To solve this problem, make sure that your my.cnf in MySQL is set  to "default-storage-engine=MyISAM" that will fix the said problem...

cool
In reply to Genner Cerna

Re: Serious Error! Could not set up the site!

by Andrew Smit -
I have just installed Moodle and I have been having the same problem. I'm almost certain it is a problem with MySQL 5. When I loaded MySQL 4 I had no problems.

thanks,
Andrew.
www.vancouverconsulting.ca
In reply to Andrew Smit

Re: Serious Error! Could not set up the site!

by Santiago Galindo -

Hello my friends: I, am Sorry. I speak Spanish

Logré solucionar el mismo problema en una instalación de moodle con IIS y MySQL 5.0.5 comentando la línea  #sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
en el archivo MY (opciones de configuracion) de my SQL y reiniciando el sistema.

Atentamente:

Santiago

In reply to Andrew Smit

Re: Serious Error! Could not set up the site! (solution)

by Rahmad Dawood -
I encounter the same problem with my installation. My system configuration is:
- Windows XP
- Apache2 
- MySQL 5

After looking into the PHP code, the cause for the failure was:
1. The install script attempted to insert a record into the mdl_course table.
2. The mdl_course table had a field modinfo of type longtext and not null without a default value.
3. The install script tries to insert the record but without specifying a value for this field, resulting in the failure of the insert command.

Solution:
- Change all fields of type longtext or text to be nullable (basically removing the not null clause)
- You can do this manually directly on the database or by changing the install script. The file to change is lib\db\mysql.sql (just remove the NOT NULL clause on all longtext or text collumn type)
- If you do it manually you can continue the installation process from where it stop
- If you change the script I suggest restarting the install process from the beginning (dropping and recreating the database as well as deleting the file config.php)

Question:
This is my first time using moodle and not familiar with the code. I just trace the problem by reading the PHP code in question and not aware of any possible issues from other part of the appliation. Up to now the application is working find without any problem. I might be wrong since I am a newbie.

Can anybody (specifically the development team) review this solution for any possible issues?

Regards,

Rahmad D.
In reply to Rahmad Dawood

Re: Serious Error! Could not set up the site! (solution)

by Georgios Kasselakis -
I have been having the same problem with PostgreSQL.
Strange as it sounds I could only solve this problem after doing both of the following:
  • setting global encoding on apache to 8859-1 [the default english]
  • setting PHP mem limit to 16 or greater [perhaps a little less could suffice]

Perhaps the encoding affects somehow the database key naming  ? Also I can certify that insert_record() fails most of the time.
In reply to Georgios Kasselakis

Re: Serious Error! Could not set up the site! (solution)

by Paco Blanco -
I had the same problem. The solution provided by Patrick Patrick and Santiago Galindo worked just fine for me as well:

1. Locate the file my.ini in your MySQL installation folder
2. Uncomment the line:

 #sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

3. Restart the mysql service (or the computer)


In reply to Paco Blanco

Re: Serious Error! Could not set up the site! (solution)

by Rahmad Dawood -
Yes that will also work but that will relax MySQL rules and effect the whole database not just Moodle. I am against it especially if the server will be use in a production system.
In reply to Rahmad Dawood

Re: Serious Error! Could not set up the site! (solution)

by Guy Thomas -
Picture of Core developers Picture of Plugin developers

With the win32 version of mysql 5 you can also re-run the configuration routine (its part of the mysql program group) and disable strict mode from there.

In reply to Guy Thomas

Re: Serious Error! Could not set up the site! (solution)

by Nairn Kennedy -

Thanks, folks, for the help. I had this problem with mySQL 5x on Windows with Apache.

It is indeed the strict mode option in mySQl that causes the problem, and if you have mySQLAdministrator you can fix it as follows:

Run mySQLAdministrator and go to the Startup Variables menu (left sidebar).

Pick the Advanced tab and scroll down to the section headed "Various"

In the box labelled SQL mode, edit out any variable beginning with STRICT_

Apply the changes, and restart the mySQL system just in case from the Service Control icon.

That's it.

In reply to Joachim Korte-Bernard

Re: Serious Error! Could not set up the site!

by Steve Henderson -

Joachim

I can only suggest that you try to set up the site again from scratch.  This may prove an easier solution.  With windows systems it is always best to set up everything manually rather than using any installers.  I suggest a manual configuration of PHP version 4.3.11 with MySQL 5.0.19 and Moodle 1.53 stable.  If it would be of any assistance, the following may help in this regard:

http://s7.quicksharing.com/v/4329398/cms.zip.html

This is a training package for full manual install under IIS or Apache.  I recommend Apache version 2.0.55 win 32 no ssl

Steve Henderson