ElkArte Community

Project Support => General ElkArte discussions => Topic started by: badmonkey on October 29, 2018, 08:05:44 pm

Title: Unsure if it's a bug?
Post by: badmonkey on October 29, 2018, 08:05:44 pm
And unsure how to troubleshoot or reliably replicate it. 1.1.5 install. If there are any attachment errors, post data is lost. Yes, an error message is provided (example file stat something or other). Also yes, a draft is saved, but that isn't obvious to an average user. It would be desirable for post text to succeed regardless of attachment errors. Users may always edit to attempt attachment issue correction. It would be instinctive in the event of an attachment failure. 

Anyway, does anyone have troubleshooting suggestions? Thanks!
Title: Re: Unsure if it's a bug?
Post by: emanuele on October 30, 2018, 10:07:19 am
hmm... can you post a screen of the error please?
Title: Re: Unsure if it's a bug?
Post by: badmonkey on October 30, 2018, 12:30:21 pm
hmm... can you post a screen of the error please?
 
 Be glad to, if I can catch it in the act again. Oh, the filesize error displays filepath info as well. Not sure that's a good thing either if normal users can see it.
Title: Re: Unsure if it's a bug?
Post by: badmonkey on November 05, 2018, 01:03:51 am
Here is the error:

filesize(): stat failed for /var/www/web.....
..
Title: Re: Unsure if it's a bug?
Post by: ahrasis on November 05, 2018, 12:33:25 pm
I thought I mentioned this in another post where the fix was missed? Or is it another bug?
Title: Re: Unsure if it's a bug?
Post by: badmonkey on November 05, 2018, 01:06:21 pm
I thought I mentioned this in another post where the fix was missed? Or is it another bug?
 
Good question. I recall something similar. All Elk code is current. Error aside, it isn't desirable losing post text in the event of an attachment error. 
Title: Re: Unsure if it's a bug?
Post by: ahrasis on November 05, 2018, 01:17:52 pm
Nope. Not mind but @radu81 did report this (relating to file based caching?) at: https://www.elkarte.net/community/index.php?topic=5204.0
Title: Re: Unsure if it's a bug?
Post by: badmonkey on November 05, 2018, 02:20:11 pm
Hhmm....in full disclosure, the setup uses php 7.3 (though it occurs when falling back to 7.0), opcache, apcu, nginx 1.15.5, mariadb 10.3.10
Title: Re: Unsure if it's a bug?
Post by: Spuds on November 05, 2018, 04:43:22 pm
Could you get a copy of the file that the user is trying to upload (the one that causes the attachment error)

The filesize() error just means its trying to get the size of a file that, for one reason or another, did not "make it" to the server.  You also use the attachment image resize addon? So that could be in play here as well.
Title: Re: Unsure if it's a bug?
Post by: badmonkey on November 05, 2018, 07:25:27 pm
Could you get a copy of the file that the user is trying to upload (the one that causes the attachment error)

The filesize() error just means its trying to get the size of a file that, for one reason or another, did not "make it" to the server.  You also use the attachment image resize addon? So that could be in play here as well.
 
 It's happened to me. Sometimes the second attempt is successful. Yes, I use the resize addon.  
Title: Re: Unsure if it's a bug?
Post by: badmonkey on September 18, 2019, 03:08:52 am
I'm still experiencing this issue. It's unfortunate there isn't more information to report, yet. It simply seems to occur at random. The same image may fail a couple or three times, then inexplicably decide to work. Ideas? What needs to be checked?
Title: Re: Unsure if it's a bug?
Post by: Spuds on September 20, 2019, 03:00:24 am
I keep checking on this as I really think it has something to do with the attachment resize addon .... I just have not come across the right set of conditions :( ... but it really has to be something in that addon (and why I just want to make it part of the core in 2.0 since it has to kind of "hot wire" the attachment code to work right now.
Title: Re: Unsure if it's a bug?
Post by: badmonkey on September 25, 2019, 05:20:53 am
I keep checking on this as I really think it has something to do with the attachment resize addon .... I just have not come across the right set of conditions :( ... but it really has to be something in that addon (and why I just want to make it part of the core in 2.0 since it has to kind of "hot wire" the attachment code to work right now.
 
 Seems you're right! I finally caught this specimen in the error log:

File: /home/www/web3/web/sources/subs/Air_Resize.subs.php (https://www.jeep-owner.com/index.php?action=admin;area=logs;sa=errorlog;activity=file;file=L2hvbWUvd3d3L3dlYjMvd2ViL3NvdXJjZXMvc3Vicy9BaXJfUmVzaXplLnN1YnMucGhw;line=371)

Line: 371
Title: Re: Unsure if it's a bug?
Post by: Spuds on September 25, 2019, 05:14:31 pm
Something to look at, thanks!
Title: Re: Unsure if it's a bug?
Post by: badmonkey on October 18, 2019, 05:48:57 pm
Something to look at, thanks!
 
 Due to the sporadic nature of the error, this isn't 100% proven. Anecdotal observation suggests this happens when using the inline image functionality in conjunction with image resizing mod. Just to include more possible troubleshooting info.
Title: Re: Unsure if it's a bug?
Post by: Spuds on October 28, 2019, 09:05:22 pm
Well I'm finally using the AIR addon on a live 1.1.6 and its a bug for sure in the resize code.

I've tried a couple of fixes, hopping it would be easy, but same error is occurring.  I think it is a sort of race condition caused by the displaying of the little icon in the post panel, to get that it has to pass the resize code before the post and something is not done or cleared after that such that when you hit post and it does it again, it sometimes goes boom!

Well at least you know you were not crazy, well about this bug at least ;)
Title: Re: Unsure if it's a bug?
Post by: badmonkey on October 28, 2019, 09:18:12 pm
Well at least you know you were not crazy, well about this bug at least ;)
 
 Quite certain I was, and still am, a bit off the mark. ;D

Cool, at least it's a step in the right direction. Many thanks Spuds!
Title: Re: Unsure if it's a bug?
Post by: Spuds on October 30, 2019, 06:32:13 pm
OK who's ready for a test ...

Replace your current file in the subs directory with this one and lets see what happens. 

The previous resize code was triggered during the ulattach operation, that is the action that creates the icon/thumb images shown in the post attachment area.  This update skips that action and should only run when the user actually posts.  So if we did have a race condition or some file lock contention, then this should fix that.   *hopes*

Testing will tell !
Title: Re: Unsure if it's a bug?
Post by: badmonkey on October 31, 2019, 12:29:32 am
OK who's ready for a test ...

Replace your current file in the subs directory with this one and lets see what happens. 

The previous resize code was triggered during the ulattach operation, that is the action that creates the icon/thumb images shown in the post attachment area.  This update skips that action and should only run when the user actually posts.  So if we did have a race condition or some file lock contention, then this should fix that.  *hopes*

Testing will tell !
 
 The patch has been loaded on my 3 sites and released to the wolves. A couple of quick test uploads gave affirmative results. Will check in again with further results! Many thanks Spuds!!  You da man!
Title: Re: Unsure if it's a bug?
Post by: Spuds on October 31, 2019, 01:27:16 am
Thanks for putting this to the test :D you da man and I appreciate the effort..
Title: Re: Unsure if it's a bug?
Post by: badmonkey on November 05, 2019, 02:34:48 am
A few days have passed while a few dozen images have been uploaded. So far there are no related errors in the log, and no reports of failed uploads. Seems logical the fix is good! Thanks again Spuds!
Title: Re: Unsure if it's a bug?
Post by: Spuds on November 05, 2019, 03:13:04 am
Great to hear

I've also been beating on it with multiple large (10mb) files and only had a single hit in the error log, so I feel my assumption about what was occurring was correct.  I intend to do another look at exactly where the absolute best place is to run (meaning on the first attach action or the actual post action) but for now at least we have a direction to refine.

Thanks again for the testing!