Forums | Mahara Community

Support /
Profile page being duplicated lots of time


Simon Lewis's profile picture
Posts: 20

18 July 2018, 21:56

Hello,

We're on 17.04.2 and we have 3 students where there profile is being created again and again in the tables, and this is stopping anyone viewing any of their pages, including submitted pages. Just shows the error 'A nonrecoverable error occurred. This probably means you have encountered a bug in the system'. I can't log in as them or anything.

These are the php logs and in the tables it's creating lots of entries in block_instance table, for the profileinfo block type. Any ideas at all?

[18-Jul-2018 10:43:45 Europe/London] Call stack (most recent first):
[18-Jul-2018 10:43:45 Europe/London] * log_message(string(size 485), integer, true, true) at E:\sites\public_html\lib\errors.php:95
[18-Jul-2018 10:43:45 Europe/London] * log_warn(string(size 485)) at E:\sites\public_html\lib\errors.php:859
[18-Jul-2018 10:43:45 Europe/London] * SQLException->__construct(string(size 485)) at E:\sites\public_html\lib\dml.php:1091
[18-Jul-2018 10:43:45 Europe/London] * insert_record(string(size 13), object(stdClass)) at E:\sites\public_html\blocktype\lib.php:1364
[18-Jul-2018 10:43:45 Europe/London] * BlockInstance->rebuild_artefact_list() at E:\sites\public_html\blocktype\lib.php:1307
[18-Jul-2018 10:43:45 Europe/London] * BlockInstance->commit() at E:\sites\public_html\blocktype\lib.php:1682
[18-Jul-2018 10:43:45 Europe/London] * BlockInstance->copy(object(View), object(View), array(size 0)) at E:\sites\public_html\lib\view.php:5693
[18-Jul-2018 10:43:45 Europe/London] * View->copy_contents(object(View), array(size 0)) at E:\sites\public_html\lib\view.php:454
[18-Jul-2018 10:43:45 Europe/London] * View::create_from_template(array(size 4), string(size 1), string(size 3), false, false, array(size 0)) at E:\sites\public_html\auth\user.php:520
[18-Jul-2018 10:43:45 Europe/London] * User->install_profile_view() at E:\sites\public_html\auth\user.php:583
[18-Jul-2018 10:43:45 Europe/London] * User->install_view(string(size 7)) at E:\sites\public_html\auth\user.php:485
[18-Jul-2018 10:43:45 Europe/London] * User->get_view_by_type(string(size 7)) at E:\sites\public_html\auth\user.php:498
[18-Jul-2018 10:43:45 Europe/London] * User->get_profile_view() at E:\sites\public_html\user\view.php:74
[18-Jul-2018 10:43:45 Europe/London]

[18-Jul-2018 10:43:45 Europe/London] [WAR] 03 (lib\dml.php:1091) Failed to get a recordset: mysqli error: [1452: Cannot add or update a child row: a foreign key constraint fails ("lcmmahara"."view_artefact", CONSTRAINT "view_artefact_ibfk_2" FOREIGN KEY ("block") REFERENCES "block_instance_orig" ("id"))] in EXECUTE("INSERT INTO "view_artefact" ("view", "artefact", "block") VALUES ('10274', '5772', 91018)")Command was: INSERT INTO "view_artefact" ("view", "artefact", "block") VALUES (?, ?, ?) and values was (view:10274,artefact:5772,block:91018)
[18-Jul-2018 10:43:45 Europe/London] Call stack (most recent first):
[18-Jul-2018 10:43:45 Europe/London] * insert_record(string(size 13), object(stdClass)) at E:\sites\public_html\blocktype\lib.php:1364
[18-Jul-2018 10:43:45 Europe/London] * BlockInstance->rebuild_artefact_list() at E:\sites\public_html\blocktype\lib.php:1307
[18-Jul-2018 10:43:45 Europe/London] * BlockInstance->commit() at E:\sites\public_html\blocktype\lib.php:1682
[18-Jul-2018 10:43:45 Europe/London] * BlockInstance->copy(object(View), object(View), array(size 0)) at E:\sites\public_html\lib\view.php:5693
[18-Jul-2018 10:43:45 Europe/London] * View->copy_contents(object(View), array(size 0)) at E:\sites\public_html\lib\view.php:454
[18-Jul-2018 10:43:45 Europe/London] * View::create_from_template(array(size 4), string(size 1), string(size 3), false, false, array(size 0)) at E:\sites\public_html\auth\user.php:520
[18-Jul-2018 10:43:45 Europe/London] * User->install_profile_view() at E:\sites\public_html\auth\user.php:583
[18-Jul-2018 10:43:45 Europe/London] * User->install_view(string(size 7)) at E:\sites\public_html\auth\user.php:485
[18-Jul-2018 10:43:45 Europe/London] * User->get_view_by_type(string(size 7)) at E:\sites\public_html\auth\user.php:498
[18-Jul-2018 10:43:45 Europe/London] * User->get_profile_view() at E:\sites\public_html\user\view.php:74

 

thanks

Robert Lyon's profile picture
Posts: 774

19 July 2018, 8:06

Hi Simon,

Looking at this part of the error log:

[18-Jul-2018 10:43:45 Europe/London] [WAR] 03 (lib\dml.php:1091) Failed to get a recordset: mysqli error: [1452: Cannot add or update a child row: a foreign key constraint fails ("lcmmahara"."view_artefact", CONSTRAINT "view_artefact_ibfk_2" FOREIGN KEY ("block") REFERENCES "block_instance_orig" ("id"))] in EXECUTE("INSERT INTO "view_artefact" ("view", "artefact", "block") VALUES ('10274', '5772', 91018)")Command was: INSERT INTO "view_artefact" ("view", "artefact", "block") VALUES (?, ?, ?) and values was (view:10274,artefact:5772,block:91018)

It is telling me that the "view_artefact" table has a foreign key reference to the "block_instance_orig" table and the value of the block, in this case 91018, does not match a row in the "block_instance_orig" table.

But the bigger question from me is: What is the "block_instance_orig" table?

This is not a table that exists in the core release of Mahara so I am guessing it either from a third-party plugin or from some custom code?

Because the system is doing View->copy_contents() I'd suspect that what is happening is the artefacts/blocks are being copied but no relating row(s) are being added to the "block_instance_orig" table hence the foreign key warning.

If it is due to a third-party plugin can you let me know which one and I can investigate more?

Easiest way to find this out is what files contain the string "block_instance_orig", eg

  grep -r block_instance_orig path/to/your/mahara/htdocs/

Cheers

Robert

Simon Lewis's profile picture
Posts: 20

19 July 2018, 22:00

Thanks that allowed us to fix it.

There's a table in our database 'block_instance_orig' which we must have created as a duplicate when doing something. I had a look at the foreign keys in view_artefact and for some reason id is pointing to that duplicated table. So I changed it to point to  'block_instance' and it now works ok. Not sure how it changed to point to that table, but I'll to be more careful when copying tables in future.

thanks a lot for your help,

Simon

25 October 2018, 4:35

We have got the same problem. Is this a bug in mahara?

Kristina Hoeppner's profile picture
Posts: 4864

28 October 2018, 14:13

Hi Andreas,

Did you get the same error messages as Simon and followed his suggestion?

Cheers

Kristina

 

5 results