Forums | Mahara Community

Support /
blog post with attachement


Yaju Mahida's profile picture
Posts: 131

12 January 2010, 2:33

Mahara 1.2.2

A blog post with file attachment is posted and when try to delete this post it gives following error.

A nonrecoverable error occured. This probably means you have encountered a bug in the system. The post turns to draft mode.

MAHARA interface errors: -

[WAR] 6b (lib/errors.php:738) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("maharatst/artefact_parent_cache", CONSTRAINT "arteparecach_par_fk" FOREIGN KEY ("parent") REFERENCES "artefact" ("id"))] in adodb_throw(DELETE FROM "artefact" WHERE id IN (43172), )
Command was: DELETE FROM "artefact" WHERE id IN (43172)
[X]
Call stack (most recent first):

    * log_message("Failed to get a recordset: mysql error: [1451: Can...", 8, true, true) at /var/eport/lib/errors.php:111
    * log_warn("Failed to get a recordset: mysql error: [1451: Can...") at /var/eport/lib/errors.php:738
    * SQLException->__construct("Failed to get a recordset: mysql error: [1451: Can...") at /var/eport/lib/dml.php:960
    * delete_records_sql("DELETE FROM "artefact" WHERE id IN (43172)", null) at /var/eport/lib/dml.php:935
    * delete_records_select("artefact", "id IN (43172)") at /var/eport/artefact/lib.php:612
    * ArtefactType::_delete_dbrecords(array(size 1)) at /var/eport/artefact/lib.php:487
    * ArtefactType->delete() at /var/eport/artefact/blog/lib.php:497
    * ArtefactTypeBlogPost->delete() at /var/eport/artefact/blog/view/delete.json.php:40

[X]
[WAR] 6b (lib/dml.php:960) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("maharatst/artefact_parent_cache", CONSTRAINT "arteparecach_par_fk" FOREIGN KEY ("parent") REFERENCES "artefact" ("id"))] in adodb_throw(DELETE FROM "artefact" WHERE id IN (43172), )
Command was: DELETE FROM "artefact" WHERE id IN (43172)
[X]
Call stack (most recent first):

    * delete_records_sql("DELETE FROM "artefact" WHERE id IN (43172)", null) at /var/eport/lib/dml.php:935
    * delete_records_select("artefact", "id IN (43172)") at /var/eport/artefact/lib.php:612
    * ArtefactType::_delete_dbrecords(array(size 1)) at /var/eport/artefact/lib.php:487
    * ArtefactType->delete() at /var/eport/artefact/blog/lib.php:497
    * ArtefactTypeBlogPost->delete() at /var/eport/artefact/blog/view/delete.json.php:40

 

APACHE Error Logs:-

[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] [WAR] 6b (lib/errors.php:738) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("maharatst/artefact_parent_cache", CONSTRAINT "arteparecach_par_fk" FOREIGN KEY ("parent") REFERENCES "artefact" ("id"))] in adodb_throw(DELETE FROM "artefact" WHERE id IN (43172), ), referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] [WAR] 6b (lib/errors.php:738) Command was: DELETE FROM "artefact" WHERE id IN (43172), referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] Call stack (most recent first):, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * log_message("Failed to get a recordset: mysql error: [1451: Can...", 8, true, true) at /var/eport/lib/errors.php:111, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * log_warn("Failed to get a recordset: mysql error: [1451: Can...") at /var/eport/lib/errors.php:738, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * SQLException->__construct("Failed to get a recordset: mysql error: [1451: Can...") at /var/eport/lib/dml.php:960, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * delete_records_sql("DELETE FROM "artefact" WHERE id IN (43172)", null) at /var/eport/lib/dml.php:935, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * delete_records_select("artefact", "id IN (43172)") at /var/eport/artefact/lib.php:612, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * ArtefactType::_delete_dbrecords(array(size 1)) at /var/eport/artefact/lib.php:487, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * ArtefactType->delete() at /var/eport/artefact/blog/lib.php:497, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * ArtefactTypeBlogPost->delete() at /var/eport/artefact/blog/view/delete.json.php:40, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] , referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] [WAR] 6b (lib/dml.php:960) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("maharatst/artefact_parent_cache", CONSTRAINT "arteparecach_par_fk" FOREIGN KEY ("parent") REFERENCES "artefact" ("id"))] in adodb_throw(DELETE FROM "artefact" WHERE id IN (43172), ), referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] [WAR] 6b (lib/dml.php:960) Command was: DELETE FROM "artefact" WHERE id IN (43172), referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X] Call stack (most recent first):, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * delete_records_sql("DELETE FROM "artefact" WHERE id IN (43172)", null) at /var/eport/lib/dml.php:935, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * delete_records_select("artefact", "id IN (43172)") at /var/eport/artefact/lib.php:612, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * ArtefactType::_delete_dbrecords(array(size 1)) at /var/eport/artefact/lib.php:487, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * ArtefactType->delete() at /var/eport/artefact/blog/lib.php:497, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167
[Tue Jan 12 14:25:18 2010] [error] [client X.X.X.X]   * ArtefactTypeBlogPost->delete() at /var/eport/artefact/blog/view/delete.json.php:40, referer: https://eport-tst.XXX.edu/artefact/blog/view/?id=43167

 Another try to delete this and got the followin error in error log

[Tue Jan 12 16:24:13 2010] [error] [client X.X.X.X] script '/var/eport/artefact/blog/delete.json.php' not found or unable to stat, referer: http://eport-dev.XXX.edu/artefact/blog/

I have checked database entry which still exists and tried to run the query DELETE FROM "artefact" WHERE id IN (43172). ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails  Looks like while deleting enry not checking relationships.

When tried to delete that blog (under which above post exists)it gives following error

Not Found
The page you are looking for could not be found

You are trying to access a blog post that does not exist
 

 

 

anonymous profile picture
Account deleted
Posts: 18

12 January 2010, 5:31

Hi,

just to say that we have the same problem. I have upgraded to 1.2.2. yesterday.

Upgrade was from 1.1.6.

Yaju Mahida's profile picture
Posts: 131

12 January 2010, 21:01

We upgraded from 1.1.7. I have checked this at http://demo.mahara.org and same thing is happening. That means this is a confirmed bug.
anonymous profile picture
Account deleted
Posts: 808
anonymous profile picture
Account deleted
Posts: 18

13 January 2010, 10:45

Hi,
I have taken the latest version from git and the problem is still there (in a way).
After I have transfered new files to the server, upgrade procedure was started. After upgrade I could delete all the blog posts that were created with attachments and that is OK.

But now if I create new blog with posts with attachments problem reapers.  

My guess is that you clean everithing up on new upgrade procedure, as I see from your last commit:
Richard Mansfield
2010-01-13 05:15:35
Revision ID: git-v1:aaed78563bb3e4cd0b673b9264fc8cdc98c76031
Rebuild parent cache before blogpost cleanup upgrade

But it seems that the problem is not in upgrade procedure alone? …or am I missing something?

Thanx for the reply in advance :)

anonymous profile picture
Account deleted
Posts: 808

13 January 2010, 16:35

Hm, did you take the entire tree or just apply that last patch?

The patch that is intended to fix the underlying problem is this one:

http://gitorious.org/mahara/mahara/commit/6278d6c8fa369a11520f4531107b169b7719130b

It does work for me.  If it's still not working for you, can you let me know if the messages in your log are still the same as before, or are you seeing something different?

Yaju Mahida's profile picture
Posts: 131

13 January 2010, 19:22

Hi I applied the patch code to my existing installation and now the delete blog post with attachment works fine.

But now when one tries to delete the whole blog it gives the non-recoverable error. Error log is as below - 

[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] [WAR] dd (lib/errors.php:738) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] [WAR] dd (lib/errors.php:738) Command was: DELETE FROM "artefact" WHERE id IN (43178), referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] Call stack (most recent first):, referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * log_message("Failed to get a recordset: mysql error: [1451: Can...", 8, true, true) at /var/www/mahara/lib/errors.php:111, referer: htt$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * log_warn("Failed to get a recordset: mysql error: [1451: Can...") at /var/www/mahara/lib/errors.php:738, referer: http://yaju-desktop/m$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * SQLException->__construct("Failed to get a recordset: mysql error: [1451: Can...") at /var/www/mahara/lib/dml.php:960, referer: http://$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * delete_records_sql("DELETE FROM "artefact" WHERE id IN (43178)", null) at /var/www/mahara/lib/dml.php:935, referer: http://yaju-desktop$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * delete_records_select("artefact", "id IN (43178)") at /var/www/mahara/artefact/lib.php:612, referer: http://yaju-desktop/mahara/artefac$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * ArtefactType::_delete_dbrecords(array(size 1)) at /var/www/mahara/artefact/lib.php:487, referer: http://yaju-desktop/mahara/artefact/bl$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * ArtefactType->delete() at /var/www/mahara/artefact/blog/lib.php:175, referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * ArtefactTypeBlog->delete() at /var/www/mahara/artefact/blog/index.php:40, referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] , referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] [WAR] dd (lib/dml.php:960) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fa$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] [WAR] dd (lib/dml.php:960) Command was: DELETE FROM "artefact" WHERE id IN (43178), referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] Call stack (most recent first):, referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * delete_records_sql("DELETE FROM "artefact" WHERE id IN (43178)", null) at /var/www/mahara/lib/dml.php:935, referer: http://yaju-desktop$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * delete_records_select("artefact", "id IN (43178)") at /var/www/mahara/artefact/lib.php:612, referer: http://yaju-desktop/mahara/artefac$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * ArtefactType::_delete_dbrecords(array(size 1)) at /var/www/mahara/artefact/lib.php:487, referer: http://yaju-desktop/mahara/artefact/bl$
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * ArtefactType->delete() at /var/www/mahara/artefact/blog/lib.php:175, referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1]   * ArtefactTypeBlog->delete() at /var/www/mahara/artefact/blog/index.php:40, referer: http://yaju-desktop/mahara/artefact/blog/
[Thu Jan 14 09:00:03 2010] [error] [client 192.168.23.1] , referer: http://yaju-desktop/mahara/artefact/blog/
 

 

[WAR] dd (lib/errors.php:738) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("maharaprd"."artefact_parent_cache", CONSTRAINT "arteparecach_par_fk" FOREIGN KEY ("parent") REFERENCES "artefact" ("id"))] in adodb_throw(DELETE FROM "artefact" WHERE id IN (43178), )
Command was: DELETE FROM "artefact" WHERE id IN (43178)
[X]
Call stack (most recent first):
  • log_message("Failed to get a recordset: mysql error: [1451: Can...", 8, true, true) at /var/www/mahara/lib/errors.php:111
  • log_warn("Failed to get a recordset: mysql error: [1451: Can...") at /var/www/mahara/lib/errors.php:738
  • SQLException->__construct("Failed to get a recordset: mysql error: [1451: Can...") at /var/www/mahara/lib/dml.php:960
  • delete_records_sql("DELETE FROM "artefact" WHERE id IN (43178)", null) at /var/www/mahara/lib/dml.php:935
  • delete_records_select("artefact", "id IN (43178)") at /var/www/mahara/artefact/lib.php:612
  • ArtefactType::_delete_dbrecords(array(size 1)) at /var/www/mahara/artefact/lib.php:487
  • ArtefactType->delete() at /var/www/mahara/artefact/blog/lib.php:175
  • ArtefactTypeBlog->delete() at /var/www/mahara/artefact/blog/index.php:40
[X]
[WAR] dd (lib/dml.php:960) Failed to get a recordset: mysql error: [1451: Cannot delete or update a parent row: a foreign key constraint fails ("maharaprd"."artefact_parent_cache", CONSTRAINT "arteparecach_par_fk" FOREIGN KEY ("parent") REFERENCES "artefact" ("id"))] in adodb_throw(DELETE FROM "artefact" WHERE id IN (43178), )
Command was: DELETE FROM "artefact" WHERE id IN (43178)
[X]
Call stack (most recent first):
  • delete_records_sql("DELETE FROM "artefact" WHERE id IN (43178)", null) at /var/www/mahara/lib/dml.php:935
  • delete_records_select("artefact", "id IN (43178)") at /var/www/mahara/artefact/lib.php:612
  • ArtefactType::_delete_dbrecords(array(size 1)) at /var/www/mahara/artefact/lib.php:487
  • ArtefactType->delete() at /var/www/mahara/artefact/blog/lib.php:175
  • ArtefactTypeBlog->delete() at /var/www/mahara/artefact/blog/index.php:40

 

anonymous profile picture
Account deleted
Posts: 808
Yaju Mahida's profile picture
Posts: 131

14 January 2010, 1:27

This solves the problem thanks.


 

anonymous profile picture
Account deleted
Posts: 18

15 January 2010, 3:59

Great, everything is OK, thanks.
10 results