Issue Details (XML | Word | Printable)

Key: MDL-10575
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Eloy Lafuente (stronk7)
Reporter: D P
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

(ORA) errors with database upgrading from 1.7(.1) to 1.8(.2)

Created: 23/Jul/07 06:51 PM   Updated: 11/Sep/07 01:37 AM
Return to search
Component/s: Database activity module, Database SQL/XMLDB
Affects Version/s: 1.7.1, 1.8.2
Fix Version/s: 1.8.3

Environment:
Solaris 10,
Oracle 10,
Firefox 2.0.0.2,
Developer messages on
Issue Links:
Dependency
 
Relates
 

Database: Oracle
Participants: D P and Eloy Lafuente (stronk7)
Security Level: None
Resolved date: 11/Sep/07
Affected Branches: MOODLE_17_STABLE, MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE


 Description  « Hide
Hey Eloy,
are you back to normal business? :)

I would like to upgrade our moodle site from 1.7.1 to 1.8.2 and did a first quick test ;)
I encountered some issues with the upgrading of the database structures.
Right on the first upgrade step seems to be a problem with some "context creations".
There were many more errors like that, but with different levels and instances...

Snippet no. 1:
Processing context relations (125/127)
Error: Invalid context creation request for level "80", instance "3".

    * line 3877 of lib/accesslib.php: call to debugging()
    * line 3918 of lib/accesslib.php: call to insert_context_rel()
    * line 527 of lib/db/upgrade.php: call to build_context_rel()
    * line 322 of admin/index.php: call to xmldb_main_upgrade()


Error: Invalid context creation request for level "80", instance "4".

    * line 3877 of lib/accesslib.php: call to debugging()
    * line 3918 of lib/accesslib.php: call to insert_context_rel()
    * line 527 of lib/db/upgrade.php: call to build_context_rel()
    * line 322 of admin/index.php: call to xmldb_main_upgrade()

----------------------------------------------------------------------------------------------------------------------------------------------

Then at a later step, I did get some ORA errors (ORA-01400: cannot insert NULL into...) apparently coming from some of our group stuff:


Snippet No.2
upgrading database
group


(oci8po): SELECT * FROM m_groups_members_temp

stdClass Object
(
    [courseid] => 2
    [name] => Gruppe A
    [description] =>
    [password] =>
    [lang] => de
    [theme] =>
    [picture] => 0
    [hidepicture] => 0
    [timecreated] => 1133178615
    [timemodified] => 1134986852
    [id] => 1
)

(oci8po): INSERT INTO m_groups (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified) VALUES ('1','Gruppe A','', '','de', '','0','0', '1133178615','1134986852')
Warning: ociexecute() [function.ociexecute]: ORA-01400: Einfügen von NULL in ("BOCHUM"."M_GROUPS"."ENROLMENTKEY") nicht möglich in /moodle/apache/2.2.4/htdocs/moodle182/lib/adodb/drivers/adodb-oci8.inc.php on line 1017
1400: ORA-01400: Einfügen von NULL in ("BOCHUM"."M_GROUPS"."ENROLMENTKEY") nicht möglich

               ADOConnection._Execute(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ..., false) % line 769, file: adodb-oci8.inc.php
            ADODB_oci8.Execute(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ...) % line 89, file: dmllib.php
         execute_sql(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ...) % line 331, file: dbbasicgrouplib.php
      groups_db_upgrade_group(2, Object:stdClass) % line 155, file: upgrade.php
   groups_transfer_db() % line 39, file: upgrade.php

ErrorScroll to next warning

stdClass Object
(
    [courseid] => 2
    [name] => Gruppe E
    [description] =>
    [password] =>
    [lang] => de
    [theme] =>
    [picture] => 0
    [hidepicture] => 0
    [timecreated] => 1133718608
    [timemodified] => 1136324634
    [id] => 2
)

(oci8po): INSERT INTO m_groups (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified) VALUES ('2','Gruppe E','', '','de', '','0','0', '1133718608','1136324634')
Warning: ociexecute() [function.ociexecute]: ORA-01400: Einfügen von NULL in ("BOCHUM"."M_GROUPS"."ENROLMENTKEY") nicht möglich in /moodle/apache/2.2.4/htdocs/moodle182/lib/adodb/drivers/adodb-oci8.inc.php on line 1017
1400: ORA-01400: Einfügen von NULL in ("BOCHUM"."M_GROUPS"."ENROLMENTKEY") nicht möglich

               ADOConnection._Execute(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ..., false) % line 769, file: adodb-oci8.inc.php
            ADODB_oci8.Execute(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ...) % line 89, file: dmllib.php
         execute_sql(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ...) % line 331, file: dbbasicgrouplib.php
      groups_db_upgrade_group(2, Object:stdClass) % line 155, file: upgrade.php
   groups_transfer_db() % line 39, file: upgrade.php

Scroll to previous warningErrorScroll to next warning

stdClass Object
(
    [courseid] => 2
    [name] => Gruppe B
    [description] =>
    [password] =>
    [lang] => de
    [theme] =>
    [picture] => 0
    [hidepicture] => 0
    [timecreated] => 1133718615
    [timemodified] => 1134564997
    [id] => 3
)

(oci8po): INSERT INTO m_groups (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified) VALUES ('3','Gruppe B','', '','de', '','0','0', '1133718615','1134564997')
Warning: ociexecute() [function.ociexecute]: ORA-01400: Einfügen von NULL in ("BOCHUM"."M_GROUPS"."ENROLMENTKEY") nicht möglich in /moodle/apache/2.2.4/htdocs/moodle182/lib/adodb/drivers/adodb-oci8.inc.php on line 1017
1400: ORA-01400: Einfügen von NULL in ("BOCHUM"."M_GROUPS"."ENROLMENTKEY") nicht möglich

               ADOConnection._Execute(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ..., false) % line 769, file: adodb-oci8.inc.php
            ADODB_oci8.Execute(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ...) % line 89, file: dmllib.php
         execute_sql(INSERT INTO m_groups
        (id,name,description, enrolmentkey,lang,theme,picture,hidepicture, timecreated,timemodified)
      ...) % line 331, file: dbbasicgrouplib.php
      groups_db_upgrade_group(2, Object:stdClass) % line 155, file: upgrade.php
   groups_transfer_db() % line 39, file: upgrade.php

Scroll to previous warningErrorScroll to next warning

stdClass Object
(
    [courseid] => 2
    [name] => Gruppe C
    [description] =>
    [password] =>
    [lang] => de
    [theme] =>
    [picture] => 0
    [hidepicture] => 0
    [timecreated] => 1133718622
    [timemodified] => 1135953543
    [id] => 4
)



I will test the upgrading a bit more in the coming weeks with a bigger database :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
D P added a comment - 25/Jul/07 07:42 PM
I did a second update with our bigger database!

Strangely there was no problem with "processing context creations" (admin/index.php?confirmupgrade=1&confirmrelease=1)...a bit weird, huh?!
First click on "next"...
Then I have to log in and deal with some new variables.
Second click on "next"
The second problem with the groups remain:
"Upgrade of group system failed!"
Third click on "next", other errors:

(oci8po): CREATE TABLE m_groups ( id NUMBER(10) NOT NULL , name VARCHAR2(254) DEFAULT ' ' NOT NULL, description CLOB, enrolmentkey VARCHAR2(50) DEFAULT ' ' NOT NULL, lang VARCHAR2(30) DEFAULT 'en' NOT NULL, theme VARCHAR2(50) DEFAULT ' ' NOT NULL, picture NUMBER(10) DEFAULT 0 NOT NULL, hidepicture NUMBER(1) DEFAULT 0 NOT NULL, timecreated NUMBER(10) DEFAULT 0 NOT NULL, timemodified NUMBER(10) DEFAULT 0 NOT NULL, CONSTRAINT m_grou_id3_pk PRIMARY KEY (id) )

955: ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

ADOConnection._Execute(CREATE TABLE m_groups (
id NUMBER(10) NOT NULL ,
name VARCHAR2(254) DEFAULT ' ' NOT NULL,
description CLOB,
enro..., false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(CREATE TABLE m_groups (
id NUMBER(10) NOT NULL ,
name VARCHAR2(254) DEFAULT ' ' NOT NULL,
description CLOB,
enro...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE m_groups (
id NUMBER(10) NOT NULL ,
name VARCHAR2(254) DEFAULT ' ' NOT NULL,
description CLOB,
enro..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

FehlerScroll to next warning

(oci8po): CREATE TABLE m_groups_groupings ( id NUMBER(10) NOT NULL , name VARCHAR2(255) DEFAULT ' ' NOT NULL, description CLOB, timecreated NUMBER(10) DEFAULT 0 NOT NULL, viewowngroup NUMBER(1) DEFAULT 1 NOT NULL, viewallgroupsmembers NUMBER(1) DEFAULT 0 NOT NULL, viewallgroupsactivities NUMBER(1) DEFAULT 0 NOT NULL, teachersgroupmark NUMBER(1) DEFAULT 0 NOT NULL, teachersgroupview NUMBER(1) DEFAULT 0 NOT NULL, teachersoverride NUMBER(1) DEFAULT 0 NOT NULL, teacherdeletable NUMBER(1) DEFAULT 0 NOT NULL, CONSTRAINT m_grougrou_id2_pk PRIMARY KEY (id) )

955: ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

ADOConnection._Execute(CREATE TABLE m_groups_groupings (
id NUMBER(10) NOT NULL ,
name VARCHAR2(255) DEFAULT ' ' NOT NULL,
description CLOB..., false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(CREATE TABLE m_groups_groupings (
id NUMBER(10) NOT NULL ,
name VARCHAR2(255) DEFAULT ' ' NOT NULL,
description CLOB...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE m_groups_groupings (
id NUMBER(10) NOT NULL ,
name VARCHAR2(255) DEFAULT ' ' NOT NULL,
description CLOB..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

Scroll to previous warningFehlerScroll to next warning

(oci8po): CREATE TABLE m_groups_members ( id NUMBER(10) NOT NULL , groupid NUMBER(10) DEFAULT 0 NOT NULL, userid NUMBER(10) DEFAULT 0 NOT NULL, timeadded NUMBER(10) DEFAULT 0 NOT NULL, CONSTRAINT m_groumemb_id3_pk PRIMARY KEY (id) ) 955:

ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

ADOConnection._Execute(CREATE TABLE m_groups_members (
id NUMBER(10) NOT NULL ,
groupid NUMBER(10) DEFAULT 0 NOT NULL,
userid NUMBER(10) DE..., false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(CREATE TABLE m_groups_members (
id NUMBER(10) NOT NULL ,
groupid NUMBER(10) DEFAULT 0 NOT NULL,
userid NUMBER(10) DE...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE m_groups_members (
id NUMBER(10) NOT NULL ,
groupid NUMBER(10) DEFAULT 0 NOT NULL,
userid NUMBER(10) DE..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

Scroll to previous warningFehlerScroll to next warning

(oci8po): CREATE TABLE m_groups_courses_groups ( id NUMBER(10) NOT NULL , courseid NUMBER(10) DEFAULT 0 NOT NULL, groupid NUMBER(10) NOT NULL, CONSTRAINT m_groucourgrou_id3_pk PRIMARY KEY (id) )

955: ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

ADOConnection._Execute(CREATE TABLE m_groups_courses_groups (
id NUMBER(10) NOT NULL ,
courseid NUMBER(10) DEFAULT 0 NOT NULL,
groupid NUMB..., false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(CREATE TABLE m_groups_courses_groups (
id NUMBER(10) NOT NULL ,
courseid NUMBER(10) DEFAULT 0 NOT NULL,
groupid NUMB...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE m_groups_courses_groups (
id NUMBER(10) NOT NULL ,
courseid NUMBER(10) DEFAULT 0 NOT NULL,
groupid NUMB..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

Scroll to previous warningFehlerScroll to next warning

(oci8po): CREATE TABLE m_groups_courses_groupings ( id NUMBER(10) NOT NULL , courseid NUMBER(10) DEFAULT 0 NOT NULL, groupingid NUMBER(10) NOT NULL, CONSTRAINT m_groucourgrou_id4_pk PRIMARY KEY (id) )

955: ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

ADOConnection._Execute(CREATE TABLE m_groups_courses_groupings (
id NUMBER(10) NOT NULL ,
courseid NUMBER(10) DEFAULT 0 NOT NULL,
groupingi..., false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(CREATE TABLE m_groups_courses_groupings (
id NUMBER(10) NOT NULL ,
courseid NUMBER(10) DEFAULT 0 NOT NULL,
groupingi...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE m_groups_courses_groupings (
id NUMBER(10) NOT NULL ,
courseid NUMBER(10) DEFAULT 0 NOT NULL,
groupingi..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

Scroll to previous warningFehlerScroll to next warning

(oci8po): CREATE TABLE m_groups_groupings_groups ( id NUMBER(10) NOT NULL , groupingid NUMBER(10) DEFAULT 0 NOT NULL, groupid NUMBER(10) NOT NULL, timeadded NUMBER(10) DEFAULT 0 NOT NULL, CONSTRAINT m_grougrougrou_id2_pk PRIMARY KEY (id) ) 955: ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

ADOConnection._Execute(CREATE TABLE m_groups_groupings_groups (
id NUMBER(10) NOT NULL ,
groupingid NUMBER(10) DEFAULT 0 NOT NULL,
groupid ..., false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(CREATE TABLE m_groups_groupings_groups (
id NUMBER(10) NOT NULL ,
groupingid NUMBER(10) DEFAULT 0 NOT NULL,
groupid ...) % line 89, file: dmllib.php
execute_sql(CREATE TABLE m_groups_groupings_groups (
id NUMBER(10) NOT NULL ,
groupingid NUMBER(10) DEFAULT 0 NOT NULL,
groupid ..., true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

Scroll to previous warningFehlerScroll to next warning

(oci8po): INSERT INTO m_log_display(module, action, mtable, field) VALUES ('group', 'view', 'groups', 'name') 1: ORA-00001: Unique Constraint (MOODLETEST.M_LOGDISP_MODACT_UIX) verletzt

ADOConnection._Execute(INSERT INTO m_log_display(module, action, mtable, field) VALUES ('group', 'view', 'groups', 'name'), false) % line 769, file: adodb-oci8.inc.php
ADODB_oci8.Execute(INSERT INTO m_log_display(module, action, mtable, field) VALUES ('group', 'view', 'groups', 'name')) % line 89, file: dmllib.php
execute_sql(INSERT INTO m_log_display(module, action, mtable, field) VALUES ('group', 'view', 'groups', 'name'), true) % line 1899, file: dmllib.php
execute_sql_arr(Array[25]) % line 548, file: ddllib.php
install_from_xmldb_file(/moodle/apache/2.2.4/htdocs/moodle182/group/db/install.xml) % line 37, file: upgrade.php

Scroll to previous warningFehlerScroll to continue button

Upgrade of group system failed!

4th click on "next":
I can start the same process endlessly... whenever I click on "next"...

Please, I need help...


Eloy Lafuente (stronk7) added a comment - 11/Aug/07 05:01 PM
Hi!

I'll try to take a look to this today. Thanks!


Eloy Lafuente (stronk7) added a comment - 12/Aug/07 06:40 PM
Oki, first execution of migration performed ok here (without groups at all). Just to confirm that structures are properly created in the upgrade.

I've found one un-related (I think) problem with MDL-10822 . Next step, try the migration with some groups and members...


Eloy Lafuente (stronk7) added a comment - 30/Aug/07 07:05 AM
Uhm.... reviewing groups upgrade code... I think I've found some problems that, if I'm not wrong, can cause this problem.

The root-cause bug is MDL-11062... stay tunned.


Eloy Lafuente (stronk7) added a comment - 11/Sep/07 01:37 AM
Hi again,

with MDL-11062 resolved, this should be working. I've upgraded from 1.7 (having groups and members) both to 1.8.2+ and 1.9beta and the upgrade has been executed successfully.

Feel free to reopen if you find more problems.

Ciao