ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: badmonkey on March 22, 2017, 09:56:52 pm

Title: Attachment error causes page creation to stop
Post by: badmonkey on March 22, 2017, 09:56:52 pm
1.1RC1 A member on the big forum pointed out an issue with one of his threads.  Near the bottom of the page is this message:

Code: [Select]
fopen(/var/.../web/attachments/190730_626dcecab1dbe0507cb759b38f369712aaeb62f4.elk): failed to open stream: No such file or directory

Searching through the attachments folder manually, sure enough the file does not exist.  It has gotten corrupted/missing during the host transfer or server error or something along those lines.  It must have happened quite some time ago as it does not exist in my PC backup either.  Oh well.  The member could probably edit and replace the pic.  However, an apparent side effect is there are several posts which cannot be displayed as a result of the error stopping the page creation. 

Could some type of error handling be used to work around the problem?  If a file doesn't exist it would be desirable to still see the posts.  Thanks!!   8)
Title: Re: Attachment error causes page creation to stop
Post by: emanuele on March 23, 2017, 03:29:32 am
Could you try the attached file?
It has some logging around the fopen I feel could be the cause.
When uploaded, try to open the topic and then check the error log to see if any of "checkImageContents", "resizeImageFile" or "imagecreatefrombmp" is there.
Title: Re: Attachment error causes page creation to stop
Post by: badmonkey on March 23, 2017, 08:50:14 pm
edit

That file works eman.  The page loads, and there is a message in the forum error log.  Thanks!!   ;)
Title: Re: Attachment error causes page creation to stop
Post by: emanuele on March 24, 2017, 05:50:29 am
But what does the message say? ;)
I need to know to understand where the error actually is and fix it. :P
Title: Re: Attachment error causes page creation to stop
Post by: badmonkey on March 24, 2017, 07:15:58 am
Oh, yeah.  You know I'm a dummy half the time.  And not too bright the other half.  ;D

It says "resizeImageFile".
Title: Re: Attachment error causes page creation to stop
Post by: emanuele on May 07, 2017, 07:58:59 am
This disappeared from my radar... :-\
Fixed now:
https://github.com/elkarte/Elkarte/pull/2928/commits/141bea143263ceafb8f39ecfdd6ba7c9bd9b9259