Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2015, 05:58 AM
dariyos dariyos is offline
 
Join Date: Nov 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Attachments have been deleted vb 4.2.3

Hello,

wrong uploaded attachments have been deleted and will delete in future and I don't know why.
Over 12.000 Files in Filesystem and Database deleted already!

An attachment from friday is also deleted.

you can see here in post #3:

http://www.sps-forum.de/codesys-und-...rittkette.html

It shows only the text:

Attachment (ID)

I know, that the attachments will be delete automatically (after upgrading to vb 4.2.3), when the refcount value of filedata entry is null - but I don't know why so many files had the refcount value 0, and why I get more "wrong uploaded attachments".

maybe there are problems with the filemanager since the upgrade?

today I will correct the values from an older Database, and copy the entrys to the actual database and upload the attachments from an backup, again.

I don't want that they will be delete in the future and get the wrong refcount value.

How is it possible to upload an attachment WRONG, that it get the value 0 and be deleted?

I don't have any Image/Attachment-Upload Plugins installed ...

What can be the issue?

PHP 5.4.42-nmm1
Mysql Version 5.6.24-nmm1-log
vb 4.2.3
Reply With Quote
  #2  
Old 09-14-2015, 01:28 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See my posts in https://vborg.vbsupport.ru/showthread.php?t=319394

Basically, it is or was possible to incorrectly attach attachments, but due to a bug in vb they weren't deleted. That bug was fixed in vb4.2.3 and following that all the incorrectly attached attachments started getting deleted.
Reply With Quote
2 благодарности(ей) от:
MarkFL, RichieBoy67
  #3  
Old 09-14-2015, 11:15 PM
dariyos dariyos is offline
 
Join Date: Nov 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont think that I had 12,000 incorrect attached attachments from 22,000 total attachments...
Reply With Quote
  #4  
Old 09-15-2015, 01:49 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just noticed the same issue on my site though I am not sure if related to that. I know that when I ran an update counter I saw attachments being removed so I stopped it. I am not sure how many attachments I lost but mostly very, very old ones.

I can still see the attachments in the database though the id is missing. I replace the id from a back up and the attachment still does not show so I am assuming the files were deleted as well. Is this possible? Would the counter delete the attachment file or is there another reason the attachment would not show when all the data is there in the attachment table?
Reply With Quote
  #5  
Old 09-15-2015, 01:59 AM
dariyos dariyos is offline
 
Join Date: Nov 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think it is a big bug!
Can't resore the attachments, most of the attachments were online, 1 month ago.

this update deletes all attachments when the refcount value is 0 from the file system and the entries in the database. (I don't know how 12,000 files can get this value)

I stopped the cleanup2.php script now, but its to late.

It is not possible to restore the files, you need all files and entries from database, too.

you have informations about attachments in the tables
- post
- thread
- attachment
- filedata

Ich have backups from all, database and filesystem, but for me it is not possible to restore all attachments.
Reply With Quote
  #6  
Old 09-15-2015, 06:38 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, in my case I think I may just be missing the filedata data.
Reply With Quote
  #7  
Old 09-15-2015, 10:58 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If refcount is 0, the attachment is not being used, and should be removed.
Reply With Quote
Благодарность от:
RichieBoy67
  #8  
Old 09-15-2015, 11:33 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ What Zachery is trying to convey is that, if the refcount is zero it means that the attachment is not being referenced i.e. used in any posts therefor it deletes them due to that fact alone. Why retain an old attachment (especially if storing attachments in filesystem which takes up more disk space) if its not being called by a page/post? It's basically like leaving tons of old recipes in your cook book despite having a new version on your tablet at a touch of a finger... in a sense if you followed my odd analogy lol! The script (update counter) is doing what it needs to do, if however something is in fact very odd about your attachments this might be something unrelated entirely or if related perhaps an issue with your single site alone, that we're unsure of so we cannot comment regarding that only what we know it should be doing.
Reply With Quote
Благодарность от:
RichieBoy67
  #9  
Old 09-18-2015, 05:39 AM
dariyos dariyos is offline
 
Join Date: Nov 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know what refcount 0 is, but I don't think I had 50 % of attachments that are not used in posts.
5 % is okay, but not 50 %, it is not impossible!

I had restored all my attachments, I correct the value of refcount and set the value to 1 where attachments used in posts...

It was definitly a WRONG that they had the refcount value 0. And I still don't know why they got this value.
Reply With Quote
  #10  
Old 09-18-2015, 08:01 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dariyos View Post
I know what refcount 0 is, but I don't think I had 50 % of attachments that are not used in posts.
5 % is okay, but not 50 %, it is not impossible!

I had restored all my attachments, I correct the value of refcount and set the value to 1 where attachments used in posts...

It was definitly a WRONG that they had the refcount value 0. And I still don't know why they got this value.
How did you fix this?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:53 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05924 seconds
  • Memory Usage 2,268KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete