PDA

View Full Version : Attachments in File Upload Manager


ed762
08-23-2017, 06:57 PM
Does anyone know which one of the scheduled task is responsible for cleaning attachments that are not used in the file upload manager? It looks whatever cron it is supposed to be does not work, so none of the attachment gets cleaned up.

Dave
08-23-2017, 07:03 PM
I believe /includes/cron/cleanup2.php around line 64 to 72.

ed762
08-24-2017, 06:06 PM
Find the lines. The cron ( Vb 4.2.3 ) is not working and images are still sitting in the file management even after 1 hour.

Does anyone know the reason why this is not working? Has anyone manually deleted the images that are no longer associated with any posts? How did you go about cleaning it up?

Dave
08-24-2017, 06:21 PM
Is the refcount column value in the Filedata table 0 of said attachment(s)?

ed762
08-24-2017, 08:02 PM
None of the attachments have "0" in the refcount at all . Is that why the cron fail?

Dave
08-24-2017, 08:16 PM
Yes. refcount is the reference count (or the number of references to that attachment). It has a strict check of 0 against it, which is why it doesn't delete the attachments.

Stingray27
08-24-2017, 09:28 PM
None of the attachments have "0" in the refcount at all . Is that why the cron fail?

Its not failing then, its doing its job.
Attachments with a ref count > 0 should never be deleted.

ed762
08-25-2017, 09:22 AM
Yes. refcount is the reference count (or the number of references to that attachment). It has a strict check of 0 against it, which is why it doesn't delete the attachments.

Is this a bug within VB? because obviously there is a large number of images that are not in use by any threads.

Anyway to manually fix it?

Dave
08-25-2017, 11:52 AM
I'm not aware of any bugs regarding attachments in the latest version of vBulletin.

Kane@airrifle
08-25-2017, 11:52 AM
Find the lines. The cron ( Vb 4.2.3 ) is not working and images are still sitting in the file management even after 1 hour.

Does anyone know the reason why this is not working? Has anyone manually deleted the images that are no longer associated with any posts? How did you go about cleaning it up?

Yes but it is obviously fraught with danger. You need to triple check everything and backup first.

I used the queries from this post: https://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/427255-script-sql-comman-s-for-querying-for-orphaned-images-attachments?p=3948600#post3948600

There was a VBIV (https://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/4305995-hourly-cronjob-2-is-not-deleting-filedata) open for the failing cron cleanup, not sure if it was fixed in 4.2.3