Can't empty the Trash

Permalink
Hi,

I have an issue on a site (running on v5.7.5.13) whereby I can't empty the Trash (in Dashboard -> Full Sitemap), or delete any pages in the Trash individually.

If I try to do either, I get the 'delete pages' modal window appearing, the progress bar appears for about half a second, then is replaced with this error:

{"error":{"message":"An error occurred while processing this request."},"errors":["An error occurred while processing this request."]}

Each time I try either, nothing gets deleted, and I get the following log entry:

Page "" at path "/!trash/1710" deleted

======

Anyone else seen this?

drbiskit
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi drbiskit,

Were you able to successfully empty trash before?
drbiskit replied on at Permalink Reply
drbiskit
Hi MrKDilkington - To be honest I haven't ever actually tried to do it before. I inherited the site from another developer so I will try to find out if they ever did it successfully.
drbiskit replied on at Permalink Best Answer Reply
drbiskit
*UPDATE*

I've now managed to empty the Trash. It appears there was an issue with a number of pages in the trash that was stopping them being deletable. I'm not sure quite what yet, but I think it might possibly be pages with versions that hadn't been approved. I had to go into the database to remove the offending pages (from the 'Collections' table). Once all were removed from the db, I could successfully empty the Trash.

Still trying to work out exactly what the issue was with the offending pages. Will update this if/when I find out the reason.

Marking this as best answer in case anyone else has this issue.
drbiskit replied on at Permalink Reply
drbiskit
*ANOTHER UPDATE*

I finally got to the root cause of this issue.

I had some pages and drafts in the system that were causing 2 issues:

1 - They were not allowing the 'Index Search Engine - All' Automated job to run - it would get partially through the job and then show the error: Invalid or Empty Node passed to getItem constructor.

2 - They could not be deleted in any way via the CMS. To delete I had to go into the database -> 'Collections' table, find them by Page ID, and delete them manually.

==

The cause was that I had a page type set up that had a custom attribute included in the Pages & Themes -> Page Types -> Edit Form -> Compose Form. At some point that custom attribute had been removed from the site, but it was still showing in the 'Edit Form' setup page. Once I removed that from the Edit form, everything worked as normal.

Random annoying bug, but took me a while to find, so felt it was worth sharing.
gordonc200 replied on at Permalink Reply
I've just sorted a similar issue which was caused by an old custom attribute. There was a record in the table CollectionAttributeValues for the problem page which referenced an akID that didn't exist.

Deleting this record/row from the table allowed the trash to be emptied.

All Automated jobs now run too.

The site is pretty old and has been upgraded lots of times. Some packages have been and gone and this is one of the problems I have only now overcome.

This post and my response to it also helped in the database cleanup

https://www.concrete5.org/community/forums/chat/page-copying-went-wr...
gordonc200 replied on at Permalink Reply
Another note that might help. I was trying to empty the trash containing a very large number of pages and some of these pages are quite complex. Doing this caused a timeout. Thereafter permenantly deleting any number of pages from the trash resulted in an incorrect number of pages being reported as to be deleted.

It seems this is caused by the entries in the Queues and QueueMessages tables. Truncating these tables (Queues will probably only have one entry) sorted the count.

I doubt any of this manual work on the database is advisable on a live site! I'd take it down first.

Hope this helps someone.
c5dragon replied on at Permalink Reply
c5dragon
You can open the trash and delete the individual items.
- What you already tried.
drbiskit replied on at Permalink Reply
drbiskit
Hi c5dragon - Thanks for your message, but I'm not able to do that - as mentioned above in original post and just to confirm that I can't empty the trash, or delete pages in the trash individually.