News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Problem with post attachments 2.0.17

Started by DarkAngel612, February 06, 2020, 09:03:22 PM

Previous topic - Next topic

DarkAngel612

I did not have this issue prior to the 2.0.17 update. When anyone...admin or member try to attach an image or whatever to a post we get a blank page. No error message, nothing just the page. There is no error log on server, in c-panel, nowhere so I am lost.

I have just now deleted all smf files from the server for this forum, and reuploaded all fresh ones. I then used the upgrade.php to make sure it took and immediately afterwards ran the repair_settings file. No joy, the post will get put into forum IF only text but not when the attachment is in there ... it was a banner 1125x475 and 357kb.

The attachment settings are set set  like in the image since we are an art site and many images are put into the posts at times. I have spent about 4+ hours at this so just decided that since it does it with or without the mods installed that I would just put all back in, members will be more comfy this way.

link: http://www.pfdlives.com/attic/index.php  (must be registered to see inside) I can provide an account for testing.

Mods installed:
1.     Stop Spammer     2.3.9
2.     BK Modding Disable Decrease Post Count Option     3.0     
3.     SMF Staff Page     1.7     
4.     Join Reason     1.5     
5.     Separate the sticky topics     1.0.1     
6.     Simple Audio Video Embedder     5.0.4     
7.     TinyPortal     1.2     
8.     httpBL     2.5.1     
9.     Change All Subjects     1.3     
10.     Sorted Package Manager Listing     1.2     
11.     Enhanced Dropdown     1.3
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

Illori


DarkAngel612

I did and it didn't make any difference. I even increased the memory/post and upload limits in php and still no joy.

I have no clue what is the problem or why we can't post image attachments
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

DarkAngel612

UPDATE:

Well sierver disappeared last night and finally got it back up again....it went nuts...LOL

Last night I was able to upload a post attachment image .jpg and .txt which were big ones and they went thru. Today I get that darn blank page again.

A member said he got this today --- has not gotten anything before too:
Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator

I have done this:


in Subs-Graphics.php

FIND: (line 281)

// Check for potential infection
            if (preg_match('~(iframe|(?<!cellTextIs)html|eval|body|script\W|[CF]WS[\x01-\x0C])~i', $prev_chunk . $cur_chunk, ) === 1)
           


REPLACE:

            // Check for potential infection
            if (preg_match('~(iframe|(?<!cellTextIs)html|eval|body|script\W|[CF]WS[\x01-\x0C])~i', $prev_chunk . $cur_chunk, $matches) === 1)


I have also done this separately:


If you want to bypass that completely, just edit Sources/Subs-Graphics.php


FIND: (line 258)

function checkImageContents($fileName, $extensiveCheck = false)
{

ADD AFTER:

    return true;
   


I also tried them both together and still nobody can upload attachments at all.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

DarkAngel612

Another update.

I have installed a database that we had 1 month ago before using the 2.0.16 or .17 and can post attachments once more. We have lost nearly a months worth of stuff but did tell them that might happen.

I tried doing the 2.0.16 installation by just uploading the full install package and both once running the upgrade.php and another time without doing that....several reinstalls of full .15

The attachments worked once in .16 so I redid the .17 full installer and the same thing with / without upgrade.php and no more attaching images or anything no matter what size. So needless to say I have had to revert to .15

I can try doing the upgrade to .16 by manually peeking at its insides and manually editing .15 files so if things go bat crazy again I can just delete the edits and re-save again.

I have not installed the mods although I do not see that they make a difference in the workings since they were not install in any of the .16/.17 file uploads.

Hope this works.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

dave_galera

Has anybody got a fix for this problem as we no longer can upload attachments.....we just get a blank page as reported above. We are runing version 2.0.17

Dave

shawnb61

Anything in the smf error log?

How about the apache error log?

If you open the debugger on your browser, are there any errors in the console?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

dave_galera

Hi,

Have check browser log...nothing, will check other logs later.

Tried uploading a 100 x 100 .png to a new reply in an existing post....all OK
Modified post and tried uploading 1200 x 770 .png (350KB) and got blank page

When I viewed the post the new reply created above had disappeared from the post and all the buttons and Quick reply is no longer visible at the bottom of the page....strange

Kindred

you issue is -- with fair certainty -- the issue noted in the first response.

Your system is choking on memory...  if the mod didn't help, then I suggest checking with your host.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DarkAngel612

Yes the memory was indeed the problem in my forums...no idea how but it was trying to allocate waaaay too much ram and after I adjusted it from its enormous amount down to 1024 for each forum the members can attach images to their posts again.

Now if only the PM Attachments mod would do us the favor of allowing images they would all be happier...LOL

Thanks for the help.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

dave_galera

Thanks for suggestions, we have implemented the mod but still cannot add attachments.

Unfortunately I am not familiar with SMF, I have been dropped in it to see if I can help.....so, can you please explain how I adjust the memory allocation in SMF for each member.......or is it a server change?

DarkAngel612

In my case it was a server side issue. I ahve a dedicated server so went into WHM and change the php memory allocation from default (I think it was 256 or 512MB normally) to 1024. That did the trick.

Somehow mine got upped to 2048 and it caused the server to do all sorts of things.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

dave_galera

We set memory_limit in the .ini file and it has made no difference, also checked apache log file which shows no errors,,,,so we have decided to move away from the SMF system.

Thanks for your help.

DarkAngel612

Sorry to hear that, I did have another forum that I had to do drastically and install a backup of the database to reflect it being 2 months prior to the update. We lost many posts but it did correct the issue. The memory helped the main forum.
Fantasy Attic ::  Fantasies Realm Market :: SMF 2.0+ with various mods and TinyPortal

proo

Quote from: dave_galera on March 05, 2020, 10:31:02 AM
We set memory_limit in the .ini file and it has made no difference, also checked apache log file which shows no errors,,,,so we have decided to move away from the SMF system.

Thanks for your help.

On the attachment settings uncheck the "Resize images when showing under posts". That did the trick at least for now.

CapnK

Quote from: proo on March 25, 2020, 12:29:38 PM
Quote from: dave_galera on March 05, 2020, 10:31:02 AM
We set memory_limit in the .ini file and it has made no difference, also checked apache log file which shows no errors,,,,so we have decided to move away from the SMF system.

Thanks for your help.

On the attachment settings uncheck the "Resize images when showing under posts". That did the trick at least for now.

I've been getting the same error (white screen when trying to attach a picture in SMF <- maybe bold will help this solution show up in searches; took me forever to find it!) with nothing in error logs to show what was the reason. Changing this setting fixed it (Thank you, proo!).

In troubleshooting, I also found that if I replaced my /Sources/Subs-Graphcs.php with the old/backup version (v.2.0.9 IIRC), it would work just fine, attachments as usual.

Bug of some sort?

iaccountant

I'm getting these reports too.

I tried modifying (from admin) the file size, and I got rid of all attachments up until 2018, removed all attachments that were in excess of my new max...but no avail

I am not an expert here, in SMF or php, and I cannot access my server (I think) as it is a hosted shared server (Cpanel)

Has anyone determined whteher this is indeed a bug in .17 ??



shawnb61

#17
At this point, I'm fairly certain it has nothing to do with 2.0.16/2.0.17.  The main reason is I started seeing similar issues back in 2.0.14/2.0.15 on my production forum... 

Resizing images & generating thumbnails takes a lot of memory.  So disabling those options & implementing the memory mod worked for me.  I also saw a setting for the memory mod & had to change that value (under Admin | Configuration | Modification Settings | Miscellaneous | Image Processing Memory Limit).

My strong suspicion is that we are seeing two major trends:
  -  Hosts are squeezing resources.  I have seen a few symptoms of that on my host, this being one.
  -  Cameras - even on smartphones - are taking significantly higher res pics over the last few years.

So the options at the moment include things all mentioned above:
- De-select the reencode option
- De-select the extensive security checks option
- De-select the resize images under posts option
- Implement memory mod
- Tweak memory limit for the mod (experiment, maybe up & down)

OTOH...  The thing mentioned above that is intriguing to me is that someone mentioned that reverting to the 2.0.9 version of Subs-Graphics.php fixed the problem for them.  There have only been two changes to that code since 2.0.9.  If someone else seeing this issue can try this, that would be something concrete to work from.  The problem, as always, is being able to reproduce the issue...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

One other thought...  For anyone having the issue...

If you run phpinfo, do you see the fileinfo php extension enabled?  If not, have it enabled.

Although fileinfo has been standard in php since php5.3, it is possible that some builds that do not have it enabled by default.  And the recent change to subs-graphics uses fileinfo to better determine the type of file being uploaded. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

iaccountant

The tweaked settings (only needed to deselect resize images) along with what I did yesterday (tweaked file sizes, eliminated old attachments) allowed my to upload a file.

I did NOT upload the memory mod

Asked users to try and break things and will report back with results.

Thanks for the help

Advertisement: