Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: pocttopus on January 05, 2018, 02:39:04 AM

Title: Missing pictures
Post by: pocttopus on January 05, 2018, 02:39:04 AM
Hello folks,

After migrating the forum from one hosting to another, there are topics with missing pictures from the posts of the members.
I had made a backup from ftp files and database but the pictures are still missing.

How can I solve this issue and return the pictures back?
Thanks!
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 02:53:35 AM
Attachments or hotlinked images? If hotlinked, are the images actually still accessible?
Title: Re: Missing pictures
Post by: pocttopus on January 05, 2018, 03:00:56 AM
Attachments are still missing.
I am aware about hotlinked images that there is limited time when links are live/viewable.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 03:03:00 AM
Are the files actually there? How did you move the files from one server to another?
Title: Re: Missing pictures
Post by: pocttopus on January 05, 2018, 03:07:06 AM
I downloaded the whole public_html folder and uploaded the files to the new host provider.
Avatars are fine but attachments with pictures are missing.
Title: Re: Missing pictures
Post by: Arantor on January 05, 2018, 03:08:24 AM
You downloaded with what tool?
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 03:09:46 AM
OK, did you use Filezilla? :)

If you did and if you still have access to the old server:

Connect to the old server via FTP again
In the FileZilla menu, go to Transfer -> Transfer Type and choose "Binary"
Download the attachments directory again

Connect to the new server, make sure "Transfer Type" is set to "Binary"
Upload the attachments directory again, overwriting the old files

Title: Re: Missing pictures
Post by: pocttopus on January 05, 2018, 03:10:22 AM
Quote from: Arantor on January 05, 2018, 03:08:24 AM
You downloaded with what tool?
File Zilla
https://filezilla-project.org/download.php?type=client
Title: Re: Missing pictures
Post by: pocttopus on January 05, 2018, 03:16:17 AM
Quote from: Aleksi "Lex" Kilpinen on January 05, 2018, 03:09:46 AM
OK, did you use Filezilla? :)

If you did and if you still have access to the old server:

Connect to the old server via FTP again
In the FileZilla menu, go to Transfer -> Transfer Type and choose "Binary"
Download the attachments directory again

Connect to the new server, make sure "Transfer Type" is set to "Binary"
Upload the attachments directory again, overwriting the old files

Transfer type was set to "Auto".
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 03:17:11 AM
Yes, that's what I was guessing. Can you try again using Binary?
Title: Re: Missing pictures
Post by: Arantor on January 05, 2018, 03:18:54 AM
Remember: you need to use Binary both for downloading and uploading.
Title: Re: Missing pictures
Post by: pocttopus on January 05, 2018, 03:23:45 AM
Quote from: Arantor on January 05, 2018, 03:18:54 AM
Remember: you need to use Binary both for downloading and uploading.
Thanks guys, but I didn't know that.
Now I am aware about that setting and I hope that the forum is still accessible through ftp at the old hosting provider.

I will let you know what's going on.   
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 03:44:45 AM
Old issue that keeps resurfacing every now and then. :)

Important Notice: Do you use Filezilla?  Avatars and Attachments lost? (https://www.simplemachines.org/community/index.php?topic=374178.0)
Title: Re: Missing pictures
Post by: pocttopus on January 05, 2018, 04:06:41 AM
Quote from: Aleksi "Lex" Kilpinen on January 05, 2018, 03:44:45 AM
Old issue that keeps resurfacing every now and then. :)

Important Notice: Do you use Filezilla?  Avatars and Attachments lost? (https://www.simplemachines.org/community/index.php?topic=374178.0)
It's annoys me since I didn't know this with the setting to binary. :-[
Is there any way to avoid this, but with default setting to Auto?
Title: Re: Missing pictures
Post by: Arantor on January 05, 2018, 04:08:38 AM
Not in SMF 2.0

We did solve it in SMF 2.1.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 05, 2018, 12:02:45 PM
This problem occurs due to another FZ setting which is cleverly buried in a completely different place.

Edit -> Settings -> Transfers -> File Types -> Treat files without extension as ASCII files

Attachment file names are hashed for security purposes, and extension is removed.  If transfer type is set to Auto, the hidden setting causes the attachments to be transferred as ASCII, corrupting the files.  Someone must have put in a lot of overtime thinking this up.  I believe the 2.1 fix is to just add an extension.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 05, 2018, 12:03:43 PM
That is true, now - it wasn't when this problem first occurred, but when fixing this, selecting binary manually will do. ;)
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 05, 2018, 12:16:42 PM
Don't really see the point to that setting.  All file types will transfer correctly if binary is used, so why do an ASCII transfer?  There were several schemes posted that were supposed to fix attachment files that were corrupted by ASCII transfer, but none of them worked for me.
Title: Re: Missing pictures
Post by: Arantor on January 05, 2018, 12:23:01 PM
Quote from: Sir Osis of Liver on January 05, 2018, 12:16:42 PM
Don't really see the point to that setting.  All file types will transfer correctly if binary is used, so why do an ASCII transfer?  There were several schemes posted that were supposed to fix attachment files that were corrupted by ASCII transfer, but none of them worked for me.


Partly because it's faster and partly because in theory it's the right choice for text files to have compatibility (Windows Notepad doesn't support Linux line endings for example)
Title: Re: Missing pictures
Post by: pocttopus on January 08, 2018, 11:42:02 AM
I had downloaded the "attachments" folder from the previous hosting and uploaded with Binary setting (Transfer->Transfer type->Binary), but the attachments are still missing.
On the other hand, the forum uses an SSL certificate and after the installation all the links from photobucket are not viewable but they are in the post's.
Can this be the issue for attachments too? I mean after installing the SSL?  :-\
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 08, 2018, 11:49:59 AM
Quote from: pocttopus on January 08, 2018, 11:42:02 AM
but the attachments are still missing.

Are the files in /attachments directory, or are they actually missing?  The photobucket problem is altogether different, it's on their end.
Title: Re: Missing pictures
Post by: pocttopus on January 08, 2018, 12:07:43 PM
Quote from: Sir Osis of Liver on January 08, 2018, 11:49:59 AM
Quote from: pocttopus on January 08, 2018, 11:42:02 AM
but the attachments are still missing.

Are the files in /attachments directory, or are they actually missing?  The photobucket problem is altogether different, it's on their end.
The files are uploaded on the server but they are not viewable on the forum.
Title: Re: Missing pictures
Post by: Arantor on January 08, 2018, 12:08:52 PM
Are you sure you downloaded all of the files with binary mode from the old provider and then reuploaded them, overwriting all the files you already had?
Title: Re: Missing pictures
Post by: Illori on January 08, 2018, 12:11:58 PM
Quote from: Arantor on January 08, 2018, 12:08:52 PM
Are you sure you downloaded all of the files with binary mode from the old provider and then reuploaded them, overwriting all the files you already had?

making sure to upload them in binary mode as well.
Title: Re: Missing pictures
Post by: pocttopus on January 08, 2018, 12:21:23 PM
Yes, I had uploaded them with Binary setting (Transfer -> Transfer type -> Binary) :-\
Title: Re: Missing pictures
Post by: Arantor on January 08, 2018, 12:22:48 PM
Yes but did you re-download them from your original host in binary as well? They would have been corrupted on the original download - as well as corrupted on the upload.
Title: Re: Missing pictures
Post by: pocttopus on January 08, 2018, 12:50:40 PM
Quote from: Arantor on January 08, 2018, 12:22:48 PM
Yes but did you re-download them from your original host in binary as well? They would have been corrupted on the original download - as well as corrupted on the upload.
Yes, they are also downloaded with Binary setting.  :-\
Title: Re: Missing pictures
Post by: Illori on January 08, 2018, 12:51:26 PM
are you able to open up the files in an image viewer on your computer and they show up normally?
Title: Re: Missing pictures
Post by: pocttopus on January 08, 2018, 12:59:55 PM
Quote from: Illori on January 08, 2018, 12:51:26 PM
are you able to open up the files in an image viewer on your computer and they show up normally?
Yes, I can see the pictures with IrfanView.
I get a warning that the files are .JPG and do I want to change the extension, but I can see them with IrfanView.
Title: Re: Missing pictures
Post by: aegersz on January 08, 2018, 01:34:07 PM
if you go to "Admin > Forum > Attachments and Avatars > Browse Files" and click on them, do they display ?

if you then go from "Browse Files" to the "File Maintenance"tab then try the Attachment Integrity Check

Title: Re: Missing pictures
Post by: pocttopus on January 08, 2018, 05:49:00 PM
Quote from: aegersz on January 08, 2018, 01:34:07 PM
if you go to "Admin > Forum > Attachments and Avatars > Browse Files" and click on them, do they display ?
No.
404 - Attachment Not Found

Quote from: aegersz on January 08, 2018, 01:34:07 PM
if you then go from "Browse Files" to the "File Maintenance"tab then try the Attachment Integrity Check
Yes, after this step if I return to "Admin > Forum > Attachments and Avatars > Browse Files" after I click on them the pictures are displayed on pop-up window.
But still they are not displayed in the posts.  :-[

(https://s10.postimg.org/4to7snurd/Capture.jpg)
Title: Re: Missing pictures
Post by: aegersz on January 08, 2018, 08:53:23 PM
do you have dougies' mod "Posts and PM atttachments" on ?

if so, maybe remove it, try it and if it works then put it back on. i'm running out of ideas.

so you did clean up all your attachments and have the same count as the 'from' system's ?
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 08, 2018, 09:12:21 PM
Do you have a good database backup from previous host?  Did you trying checking all the boxes in Maintain Attachments and run fix?
Title: Re: Missing pictures
Post by: Illori on January 09, 2018, 05:11:48 AM
can you post the file PATH that you have for SMF directory under admin -> server settings -> database and paths

also post the file PATH for attachments from admin -> attachments and avatars -> attachment settings

i think your path for attachment is incorrect and needs to be fixed.
Title: Re: Missing pictures
Post by: pocttopus on January 09, 2018, 07:19:10 AM
Quote from: aegersz on January 08, 2018, 08:53:23 PM
do you have dougies' mod "Posts and PM atttachments" on ?

if so, maybe remove it, try it and if it works then put it back on. i'm running out of ideas.

so you did clean up all your attachments and have the same count as the 'from' system's ?
No, I don't have that mod.
Here is the full list:

1.   Moderator and Administrator Comment Tags   1.9
2.   Activity Bar   1.1
3.   SMF 2.0.15 Update   1.0
4.   Show JDALLAUI in Post and PM   1.4
5.   Label for banned members   1.0
6.   Users Online Today   2.1
7.   Reason For Editing Mod   2.3.3
8.   Expanding & Collapsing Off-Topic Tag   3.2
9.   Thumbnail Topic Mod   3.0.1
10.   Adk Float who   1.0
11.   Optimus   1.9.6
12.   Font AweaZome   1.2
13.   Share This Topic   4.1.2
14.   Forum Hit Hard Preventer   1.3
15.   SimplePortal   2.3.7
16.   Regbar Warning   1.0.5
17.   Tagging System   3.0.1
18.   SMF 2.0.14 Update   1.0
19.   Auto Twitter Embed   1.0.1
20.   SMF Theme Changer   1.0.1
21.   @mention members   1.1.2
22.   SMF Post Prefix   2.0.3
23.   dQuoteSelection   2.6.3
24.   Unknown Actions   1.3
25.   Social Login   3.5
26.   SEO Sitemap   2.2.1
27.   Welcome Topic Mod   2.3
28.   Avatars on Board/MessageIndex   1.8
29.   SMF Likes Plus   1.5
30.   PM Informer   4.0.1
31.   Yellow: Highlight Package On Hover   1.1.2

Quote from: Sir Osis of Liver on January 08, 2018, 09:12:21 PM
Do you have a good database backup from previous host?  Did you trying checking all the boxes in Maintain Attachments and run fix?
Actually the last backup from previous hosting is almost a year old.
I think I can check this on localhost.

Quote from: Illori on January 09, 2018, 05:11:48 AM
can you post the file PATH that you have for SMF directory under admin -> server settings -> database and paths

also post the file PATH for attachments from admin -> attachments and avatars -> attachment settings

i think your path for attachment is incorrect and needs to be fixed.


Images removed at poster's request ~ Steve


Title: Re: Missing pictures
Post by: pocttopus on January 10, 2018, 06:12:11 AM
 ??? :-\
Title: Re: Missing pictures
Post by: aegersz on January 10, 2018, 08:43:01 AM
is there anything in your error log that is generated when you open a post with an attachment ?

OK, the attachments don't display but do they download when you click on them AND and can you view them once downloaded ?

what happens when you create a new post and add an attachment to it -- does it then display at least for that post ?

what bothers me is that you had a huge discrepancy when you fixed them via the Maintenance option - are you sure that you have the same amount of attachments in both systems ?

try to gather more symptoms and if we still get nowhere then maybe try the whole migration again ? 
Title: Re: Missing pictures
Post by: Illori on January 10, 2018, 08:47:58 AM
Quote from: Illori on January 09, 2018, 05:11:48 AM
can you post the file PATH that you have for SMF directory under admin -> server settings -> database and paths

also post the file PATH for attachments from admin -> attachments and avatars -> attachment settings

i think your path for attachment is incorrect and needs to be fixed.

can you provide that information?
Title: Re: Missing pictures
Post by: aegersz on January 10, 2018, 08:59:16 AM
Illori, he has done so already just a few posts back - see the pictures he provided
Title: Re: Missing pictures
Post by: Illori on January 10, 2018, 09:04:08 AM
i missed that, and it does look like it should be correct given that the attachments folder is with a lowercase a.
Title: Re: Missing pictures
Post by: pocttopus on January 10, 2018, 10:04:58 AM
Quote from: aegersz on January 10, 2018, 08:43:01 AM
is there anything in your error log that is generated when you open a post with an attachment ?

OK, the attachments don't display but do they download when you click on them AND and can you view them once downloaded ?
No, there is no error because I cannot click them. There is no links for the attachments

Quote from: aegersz on January 10, 2018, 08:43:01 AM
what happens when you create a new post and add an attachment to it -- does it then display at least for that post ?
After the migration to the new host, new attachments are fine. This is the issue only for older attachments from the previous host.

Quote from: aegersz on January 10, 2018, 08:43:01 AM
what bothers me is that you had a huge discrepancy when you fixed them via the Maintenance option - are you sure that you have the same amount of attachments in both systems ?

try to gather more symptoms and if we still get nowhere then maybe try the whole migration again ?
Yes, I click fix the errors and the list of all the attachments is shorter now. I believe that now I had lost the connection with the database to them.  :-\
Now there is no errors but there are no attachments as well displayed, only the new ones from the actual hosting.

I cannot migrate again because the old database is almost a year old. That's too long for our community.
I don't know how can I merge new post/topics with the old database. :-\
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 10, 2018, 11:50:50 AM
The attachment links are missing from the posts?  Believe I've seen this before on a broken forum, can't remember which, but I think it got fixed.  Will have a look through my notes, see if I can find it.
Title: Re: Missing pictures
Post by: pocttopus on January 10, 2018, 12:06:27 PM
Quote from: Sir Osis of Liver on January 10, 2018, 11:50:50 AM
The attachment links are missing from the posts?  Believe I've seen this before on a broken forum, can't remember which, but I think it got fixed.  Will have a look through my notes, see if I can find it.
Thanks @Sir Osis of Liver
You are very kind.
Title: Re: Missing pictures
Post by: pocttopus on January 10, 2018, 06:22:33 PM
Also I had another issue with displaying images from photobucket. I don't know why are not displayed?
There is no SSL certificate, and I don't know if there is any modification who can cause this issue.  :-\
Here is the example: http://forum.mkreef.com/index.php?topic=516.msg2017#msg2017

Any advice for this too?  :-[
Title: Re: Missing pictures
Post by: Arantor on January 10, 2018, 06:39:38 PM
There's no SSL cert but yet the image proxy is turned on and likely Photobucket notices and blocks the attempt, especially if it's not a paid account.
Title: Re: Missing pictures
Post by: pocttopus on January 10, 2018, 06:53:59 PM
Quote from: Arantor on January 10, 2018, 06:39:38 PM
There's no SSL cert but yet the image proxy is turned on and likely Photobucket notices and blocks the attempt, especially if it's not a paid account.
Thanks, I had solved this with disabling the proxy for images.  :)
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 10, 2018, 09:28:20 PM
Ok, there are a couple of things that can cause an attachment link to disappear from a post -

Group permission to view attachments can be disabled, this is default setting for guests.  If you are viewing posts as admin, you should see the links. 

If the _attachments table in database is missing an attachment or is damaged, link will not be displayed for any users. 

If attachment file has been deleted or corrupted, or /attachments directory is missing, the link will remain, you'll get a 404 if you click on it.  Look at your _attachments table, see what's in it.


Title: Re: Missing pictures
Post by: pocttopus on January 11, 2018, 03:42:09 AM
Firstly I had to return a database backup because I had lost a connection with couple of avatars and attachments.

When I go to "Admin > Forum > Attachments and Avatars > Browse Files"  i got an error 404 - Attachment Not Found
There is attachments table in the database and there so no error when I select that.

(https://s10.postimg.org/lgbsotc09/Capture2.jpg)

Title: Re: Missing pictures
Post by: aegersz on January 11, 2018, 05:54:03 AM
btw, i backup my database (mysql/InnoDB) every damn hour for 4 days on the server, clone it daily and then copy it to 2 other Intranets weekly, keep all the generations, then I rsync them to a hard drive AND Clonezilla image to another 2 hard drives !!

ABSOLUTE and TOTAL overkill but i am that precious about it.

Don't do it annually, please !

I also backup all attachments, other data and software simultaneously.

The point i am am trying to make is that you have nothing to lose with over, over, overkill.

Please devote as much time as you need to preserve your data, be it files AND database.

there is no such thing as too many backups.

my content and years in building my site must never be lost.

I hope my obsessive behaviour encourages you to avoid such personal aggravation in the future. trust noone or any single/double or even triple points of failure.
Title: Re: Missing pictures
Post by: pocttopus on January 11, 2018, 07:21:13 AM
Quote from: aegersz on January 11, 2018, 05:54:03 AM
btw, i backup my database (mysql/InnoDB) every damn hour for 4 days on the server, clone it daily and then copy it to 2 other Intranets weekly, keep all the generations, then I rsync them to a hard drive AND Clonezilla image to another 2 hard drives !!

ABSOLUTE and TOTAL overkill but i am that precious about it.

Don't do it annually, please !

I also backup all attachments, other data and software simultaneously.

The point i am am trying to make is that you have nothing to lose with over, over, overkill.

Please devote as much time as you need to preserve your data, be it files AND database.

there is no such thing as too many backups.

my content and years in building my site must never be lost.

I hope my obsessive behaviour encourages you to avoid such personal aggravation in the future. trust noone or any single/double or even triple points of failure.
I have enough backups from database and ftp files. Also I am testing on localhost just to be sure that everything will be fine on live. :)
I appreciate your opinion but I don't know how this would be helpful to solve the issue of missing attachments?  :-[
Are you referring that someone had made an attack to the forum?  ???

Maybe I had not made a good migrating to this new hosting because missing attachments are after migrating.  :-\

These are the errors and statistics:

(https://s10.postimg.org/bda1pnojt/Capture7.jpg)
Title: Re: Missing pictures
Post by: Illori on January 11, 2018, 07:40:16 AM
your attachment folder, is it on the server with a lowercase a in attachments?
Title: Re: Missing pictures
Post by: aegersz on January 11, 2018, 07:40:53 AM
no, you are right - it isn't helpful but i was horrified when you said that your last backup was a year old !

by contrasting that to my ridiculous other extreme, i was hoping that it would help you keep many more frequent DB+file copies so you don't have to revisit this upsetting time for you.

but you are in good hands here and i hope you get the help to restore much or if not all forum intrgrity.
Title: Re: Missing pictures
Post by: pocttopus on January 11, 2018, 07:50:37 AM
Quote from: aegersz on January 11, 2018, 07:40:53 AM
no, you are right - it isn't helpful but i was horrified when you said that your last backup was a year old !
Last backup from previous hosting is almost a year old, but not from current hosting.
I think this is misunderstanding.  :-\

Quote from: aegersz on January 11, 2018, 07:40:53 AM
by contrasting that to my ridiculous other extreme, i was hoping that it would help you keep many more frequent DB+file copies so you don't have to revisit this upsetting time for you.

but you are in good hands here and i hope you get the help to restore much or if not all forum intrgrity.
Yes, I have enough backups but this issue with attachments slipped before my eyes/fingers.  :-[

Quote from: Illori on January 11, 2018, 07:40:16 AM
your attachment folder, is it on the server with a lowercase a in attachments?
(https://s10.postimg.org/k4h2jsi3t/Capture7.jpg)
Title: Re: Missing pictures
Post by: aegersz on January 11, 2018, 08:23:23 AM
oh, my mistake - that gives me hope.

it does sound like possible corruption then.

wait for Sir Osis to get back to you if illori doesn't track down the error soon.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 11, 2018, 03:12:09 PM
Quote from: Illori on January 11, 2018, 07:40:16 AM
your attachment folder, is it on the server with a lowercase a in attachments?

You can rename /attachments directory, or delete it entirely, broken links will remain.  He's not seeing the links.

@pocttopus - Can you dump smf_attachments table and attach it here?
Title: Re: Missing pictures
Post by: pocttopus on January 11, 2018, 05:26:10 PM
Quote from: Sir Osis of Liver on January 11, 2018, 03:12:09 PM
Quote from: Illori on January 11, 2018, 07:40:16 AM
your attachment folder, is it on the server with a lowercase a in attachments?

You can rename /attachments directory, or delete it entirely, broken links will remain.  He's not seeing the links.

@pocttopus - Can you dump smf_attachments table and attach it here?
Here it is: https://mega.nz/#!VpVzHJrT!PnLpVslQwmU7PeGKTMzsH8QUmgj78pTAsdXY0riyKMg
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 12, 2018, 12:32:06 PM
Will take a look at it tonight.
Title: Re: Missing pictures
Post by: pocttopus on January 12, 2018, 12:59:04 PM
Thanks @Sir Osis of Liver, you are very kind and I appreciate your dedication for help me.  :)
Title: Re: Missing pictures
Post by: Sir Osis of Liver on January 12, 2018, 10:44:32 PM
There are several things not quite right in your smf_attachments, but I'm not able to duplicate the problem on a test install. 

- The first 500 rows are missing file_hash, the field is blank.  These would be the 500 oldest attachments.  Deleting the field on test install does not remove link in post, it goes 404.

- There's a duplicate index, attachment_type and attachmentType, that shouldn't cause a problem.

- There's no PRIMARY index, it should be id_attach, but removing it as PRIMARY on test install does not affect attachment in post.

- As mentioned earlier, deleting the attachment from /attachments, or renaming or deleting directory, does not remove link.

Only thing I can find that deletes the link from a post is deleting id_attach for that attachment, but that column is populated in your table.  I'm also not seeing anything that would explain why new attachments are working.  Only thing I can suggest is do a clean install in another directory, copy over /attachments, connect it to the database, run repair_settings, see what you get.
Title: Re: Missing pictures
Post by: pocttopus on January 13, 2018, 06:24:22 PM
Thanks @Sir Osis of Liver
I will try and inform you all what happened.

Thanks again! :)
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 22, 2018, 05:21:39 AM
Quote from: pocttopus on January 13, 2018, 06:24:22 PM
Thanks @Sir Osis of Liver
I will try and inform you all what happened.
So, how did it go? :) Or have you had time to try yet?
Title: Re: Missing pictures
Post by: pocttopus on January 22, 2018, 11:28:06 AM
Quote from: Aleksi "Lex" Kilpinen on January 22, 2018, 05:21:39 AM
Quote from: pocttopus on January 13, 2018, 06:24:22 PM
Thanks @Sir Osis of Liver
I will try and inform you all what happened.
So, how did it go? :) Or have you had time to try yet?
Thanks for asking me but I did not find time to solve the issue.
I will inform you as soon as possible.

Thanks for understanding.  :)
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on January 22, 2018, 11:43:26 AM
That's fine, we'll be here :)
Title: Re: Missing pictures
Post by: pocttopus on February 25, 2018, 08:48:17 AM
When I go to this picture i.e. there is an error 404:
http://mkreef.com/piwigo/upload/2014/09/24/20140924010209-5c892bc9.jpg

I really don't know how to return the attachments from previous hosting.  :-[

Quote from: Sir Osis of Liver on January 12, 2018, 10:44:32 PM
There are several things not quite right in your smf_attachments, but I'm not able to duplicate the problem on a test install. 

- The first 500 rows are missing file_hash, the field is blank.  These would be the 500 oldest attachments.  Deleting the field on test install does not remove link in post, it goes 404.

- There's a duplicate index, attachment_type and attachmentType, that shouldn't cause a problem.

- There's no PRIMARY index, it should be id_attach, but removing it as PRIMARY on test install does not affect attachment in post.

- As mentioned earlier, deleting the attachment from /attachments, or renaming or deleting directory, does not remove link.

Only thing I can find that deletes the link from a post is deleting id_attach for that attachment, but that column is populated in your table.  I'm also not seeing anything that would explain why new attachments are working.  Only thing I can suggest is do a clean install in another directory, copy over /attachments, connect it to the database, run repair_settings, see what you get.


Firstly forum was installed with clean installation and after that I just moved the backup from previous hosting in to the new one.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 25, 2018, 09:50:51 PM
Quote from: pocttopus on February 25, 2018, 08:48:17 AM
When I go to this picture i.e. there is an error 404:
http://mkreef.com/piwigo/upload/2014/09/24/20140924010209-5c892bc9.jpg

Not sure what you're doing there, but if I add .jpg extension to hashed filename and link to it directly, I get 403.  If I d/l the file, it displays normally in graphics editor.
Title: Re: Missing pictures
Post by: pocttopus on February 26, 2018, 04:54:34 AM
Yes, when i add .jpg extension the picture can be displayed with picture viewer locally on my computer, but that's not the case online on the forum. :(

Fresh installation was made and after that I just uploaded the files to the new hosting provider.
I don't know what else to do with the forum!?  :-[
Title: Re: Missing pictures
Post by: Kindred on February 26, 2018, 07:10:00 AM
how did you upload the files?


(and yes, adding an extension to the file will not make it veiweable on the forum. The forum expects file names to be hashed and extensions to be blank. The proper mime type is stored in the database for each file.
Title: Re: Missing pictures
Post by: pocttopus on February 26, 2018, 07:35:21 AM
Quote from: Kindred on February 26, 2018, 07:10:00 AM
how did you upload the files?


(and yes, adding an extension to the file will not make it veiweable on the forum. The forum expects file names to be hashed and extensions to be blank. The proper mime type is stored in the database for each file.
Well, files were not downloaded, neither uploaded with binary settings via FileZilla.
So, I cannot back to previous hosting provider and ask them for binary downloading because the migration was made one year ago. I cannot return the forum one year before, it is a long time and a lot of posts were written and new members registered.

I know it's a difficult situation but I cannot return time back.  :-[
Title: Re: Missing pictures
Post by: Kindred on February 26, 2018, 10:24:20 AM
if the files were corrupted by using the ASCII download/upload instead of binary, then there is nothing you can do...
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 26, 2018, 12:52:43 PM
If the file can be viewed in graphics editor after adding file extension, image is not corrupt.  If you add file extension and try to link directly to image, it will not display.  OP gets 404, I get 403, but there's nothing wrong with the file.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on February 26, 2018, 01:24:42 PM
To me, that path looks really odd - is that actually what it's supposed to look like?
Usually attachments are in a folder directly under your forum root, and that link would seem to have multiple levels of folders in the url.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 26, 2018, 09:40:36 PM
Think maybe he put it there just to test the file.  I tried linking directly to renamed file in /attachments on test install, got 403.  File displays correctly when loaded into image editor.

Just reviewing this topic, this is what I found earlier -

Quote from: Sir Osis of Liver on January 12, 2018, 10:44:32 PM
There are several things not quite right in your smf_attachments, but I'm not able to duplicate the problem on a test install. 

- The first 500 rows are missing file_hash, the field is blank.  These would be the 500 oldest attachments.  Deleting the field on test install does not remove link in post, it goes 404.

- There's a duplicate index, attachment_type and attachmentType, that shouldn't cause a problem.

- There's no PRIMARY index, it should be id_attach, but removing it as PRIMARY on test install does not affect attachment in post.

- As mentioned earlier, deleting the attachment from /attachments, or renaming or deleting directory, does not remove link.

Only thing I can find that deletes the link from a post is deleting id_attach for that attachment, but that column is populated in your table.  I'm also not seeing anything that would explain why new attachments are working.  Only thing I can suggest is do a clean install in another directory, copy over /attachments, connect it to the database, run repair_settings, see what you get.

Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on February 26, 2018, 11:26:57 PM
Quote from: Sir Osis of Liver on February 26, 2018, 09:40:36 PM
Think maybe he put it there just to test the file.  I tried linking directly to renamed file in /attachments on test install, got 403.  File displays correctly when loaded into image editor.

Not sure why, I just tried the same and it works just fine. Copied and renamed a jpg -attachment, and I can access it directly no problem.

The url in this however

Quote from: pocttopus on February 25, 2018, 08:48:17 AM
When I go to this picture i.e. there is an error 404:
http://mkreef.com/piwigo/upload/2014/09/24/20140924010209-5c892bc9.jpg

looks like it has year/month/date as part of the of folder structure, and then yearmonthdate as part of the file name again, when I believe SMF attachments usually start with a running number, followed by the hashed filename - so I wasn't really sure what was happening there.


Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 26, 2018, 11:40:19 PM
Try this -

http://www.thekrashsite.com/smf20/attachments/114_8246744c17785581f355efe3548a1d338b4ac493.jpg

Now try this -

http://www.thekrashsite.com/pics/114_8246744c17785581f355efe3548a1d338b4ac493.jpg

Same file, same server, something in SMF is blocking it.  Image proxy is disabled.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on February 26, 2018, 11:48:03 PM
That actually might be because of a .htaccess in your attachment folder, I think there is one in the default installations original attachment folder with a deny from all rule. The actual file should work however, if you copy it outside the attachment folder or remove the .htaccess.
A 404 would be a different thing though.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 26, 2018, 11:59:14 PM
Yeah, works now with .htaccess disabled.  OP is seeing different problem.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 27, 2018, 04:26:58 PM
Doing a bit of tinkering with this.  If you d/l attachment image using FZ with transfer type set to ascii, add file extension, it displays normally in graphics editor.  But if you remove extension and u/l it back to /attachments, it does not display in browser.  However, the attachment link remains in post.  If you delete the file, or delete /attachments directory, link still remains in post.  IIRC, the link OP posted earlier showed a post with no image and no attachment link (looks like it's since been updated with photobucket pics).  Nothing you can do to the image file or /attachments directory will cause the link to go missing, it must be something in the database.
Title: Re: Missing pictures
Post by: pocttopus on February 28, 2018, 02:17:39 AM
What are my options now?  :-\

edit:

What is this "piwigo"? I'm not familiar with this part of the link and therefor I don't have such modification.  :o
Maybe previous administrator used something but this does not looks familiar to me.  ???
Previous hosting used a Windows package.

Quote from: pocttopus on February 25, 2018, 08:48:17 AM
When I go to this picture i.e. there is an error 404:
http://mkreef.com/piwigo/upload/2014/09/24/20140924010209-5c892bc9.jpg
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 28, 2018, 11:54:34 AM
Where are you getting that link?

Title: Re: Missing pictures
Post by: Illori on February 28, 2018, 12:00:17 PM
maybe http://piwigo.org/ is helpful?
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 28, 2018, 12:03:38 PM
That's not an SMF problem, the link to file sharing site is failing, nothing to do with the forum.  Link is not reaching the file, so there's no way to know if it's corrupt or not.  Either way, as per my earlier posts, don't believe corrupt files are causing the problem.
Title: Re: Missing pictures
Post by: pocttopus on February 28, 2018, 12:17:45 PM
I understand.
Is this the reason for not displaying the pictures? I am asking this because I don't know which way to go to solve my issue.  :-\
Title: Re: Missing pictures
Post by: Sir Osis of Liver on February 28, 2018, 12:25:31 PM
The piwigo link has nothing to do with your attachments problem.  Your files may indeed be corrupt, but something else is preventing the forum from loading attachments into posts.  A corrupt attachment will not display in post, but the attachment link should still be there, and it was not in the example link you provided.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on March 06, 2018, 08:50:28 AM
Of course, this image from earlier leads us to understand that there were over 2000 links to attachments, but the files weren't where they were supposed to be.

(https://s10.postimg.org/bda1pnojt/Capture7.jpg)

And if someone went ahead and tried to fix those errors, it might have removed the links.
Title: Re: Missing pictures
Post by: pocttopus on March 06, 2018, 08:59:07 AM
Yes, if I try to fix the errors, I will lose the links from attachments.  :-\
It's difficult to say what to do in such condition.   :(
Title: Re: Missing pictures
Post by: a10 on March 06, 2018, 11:52:51 AM
Relevant, or gives some ideas ? Long ago I went trough a (tedious) "repair attachments \ posts relationships" involving 1000's of attachments, worked perfect.


https://www.simplemachines.org/community/index.php?topic=335792.msg2260457#msg2260457

https://www.simplemachines.org/community/index.php?topic=335792.msg2285999#msg2285999
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on March 08, 2018, 12:48:26 AM
Quote from: pocttopus on March 06, 2018, 08:59:07 AM
Yes, if I try to fix the errors, I will lose the links from attachments.  :-\
It's difficult to say what to do in such condition.   :(
When the error says the images are no longer there, it means you should make sure the files are accessible, and in the right folder - so make sure your attachment settings, including the folder path is correct.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on March 08, 2018, 03:18:41 PM
I believe he's already lost the attachment links in the messages, the links should display whether or not the files or /attachments directory are present.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on March 11, 2018, 01:46:25 AM
Yes, that is true - and I believe they may have been lost for some reason too. Just trying to explain the different errors.
The links a10 gave, might give ideas for how to go on from here.
Title: Re: Missing pictures
Post by: pocttopus on June 26, 2018, 06:23:13 AM
This is old topic and I don't know if this will be relevant information related to the issue with missing pictures.
Suddenly db version is 2.0.2. I'm little bit confused how can this be possible when every update was finished without any issues~!? :-\
Also how can upgrade db version!?

(https://s20.postimg.cc/6xv5tvw99/image.jpg)

(https://s20.postimg.cc/vedbofx0t/db1.jpg)
Title: Re: Missing pictures
Post by: Arantor on June 26, 2018, 06:37:57 AM
There's no upgrade to do, the DB didn't change between 2.0.2 and 2.0.15 but if you really must change it, go to the smf_settings table, find the row with smfVersion in it and change it to 2.0.15.
Title: Re: Missing pictures
Post by: Sir Osis of Liver on June 26, 2018, 06:12:57 PM
^ Hee, hee - making fudge, that's something Sir Osis would do.
Title: Re: Missing pictures
Post by: Aleksi "Lex" Kilpinen on July 14, 2018, 03:46:24 AM
As stated, the DB version is irrelevant in this case, and there is no need for further DB changes because of that "error".