News:

Wondering if this will always be free?  See why free is better.

Main Menu

Attachments not uploading on boardless posting page

Started by davo88, May 02, 2024, 08:19:11 PM

Previous topic - Next topic

davo88

SMF 2.1.4
Default theme
No code edits
No imported data
Mods - Quick New Topic Button

Need a bit of help to troubleshoot an attachment loading problem when using the Quick New Topic Button. This is a stock standard SMF with no mods apart from the QNT button.
Logged in as admin, attachments load, display as thumbnails and post as normal.

Logged in as a member:
- one attachment will load (green bar completes), but not display as a thumbnail or attach to the post when the message is posted.

You cannot view this attachment.

- can load one attachment to the point where the green bar is complete, but not displaying as a thumbnail, then repeat the process and load a second, then a third to the same point. Looks like this

You cannot view this attachment.

But if I try to save that post, the attachments aren't attaching.

However, if I first post a text only message without any attachments, then choose Modify and attach an image, the attachment loads, displays as a thumbnail and is attached after saving - all as normal.

You cannot view this attachment.

I have tried different attachments, all well under the current limits set in Attachments settings.
Not sure how to go about troubleshooting this problem. Any suggestions appreciated.

Sesquipedalian

Your issues are not due to this mod, which simply adds a link in the menu to take the user to the post authoring page. What happens on the post authoring page is all controlled by SMF itself.

You should ask for help in the general support board for SMF 2.1.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

davo88

I forgot to mention that, when logged in as a member, the attaching process works normally when the post authoring page is opened via the normal 'New Topic' button within the forum. However when accessed via the Quick New Topic button, and attempting to attach the same file, it doesn't.

It looks like I have not set some permissions properly but I can't figure out what they might be.

davo88

Another observation. Logged in as a member and making a post via the 'Reply' button - attachments load (green bar completes), thumbnail displays and attachment is displayed when the post is saved. The attaching process seems to work normally whether for one or multiple attachments.

davo88

Some information from the browser console.
This was taken when logged in as a member, posting window is opened via the Quick New Topic button, one attachment as loaded, the green bar had completed its travel but no thumbnail was displayed. Not sure if this is relevant.

You cannot view this attachment.

Another browser console snip from a different test site under same attaching conditions.

You cannot view this attachment.

Sesquipedalian

#5
As I said, this is an SMF issue, not an issue with the Quick New Topic Button mod.

If you don't believe me, uninstall the mod and then go to index.php?action=post in your browser's address bar. You will see the exact same posting page, complete with the board selection menu. Then try making your post with attachments again. I guarantee that you will still encounter the same issue that you described above.

In fact, you can verify this right here on this site. Go to https://www.simplemachines.org/community/index.php?action=post and try to upload an attachment. You will see the same thing happen. It's a bug in SMF itself.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sesquipedalian

I have split and moved this bug report to the Bug Reports board, because the issue is a bug in SMF itself, as can be confirmed by following the link in my previous reply.

I suspect that a permissions issue is at work here, but it will take more investigation to find out.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

davo88

Quote from: Sesquipedalian on May 03, 2024, 05:27:28 PMIf you don't believe me, uninstall the mod and then go to index.php?action=post in your browser's address bar. You will see the exact same posting page, complete with the board selection menu. Then try making your post with attachments again.
Yes, tested this and the same thing happens.

shawnb61

I recently saw this as well.

I believe the problem in my case was the pics were so big (in terms of height vs width in pixels) the thumbnail generation was failing.

I regenerated my pix with smaller dimensions and it all worked.

So the thumbnail info that comes back to dropzone is broken, causing that dz console error.   No further js processing.

No idea why I only started seeing this recently.  I upload pix all the time.  (Browser update???)


(So in my case the issue was picture specific, not user specific.  Possibly browser specific.  If you look at the values it's trying to read in the console debugger, it's not an array as expected, it's html for a little web page that says memory exhausted....)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

davo88

Bit more information.

When logged in as admin, this appears in the console at the point where I click "Click or drag files here to attach them" before I have even selected a file to attach. Yet after selecting a file, it uploads, displays a thumbnail and posts OK.

You cannot view this attachment.

When logged in as member, this appears in the console after the file has been selected, has uploaded to the point where the green bar completes, but is unable to display a thumbnail.

You cannot view this attachment.

shawnb61

An update on this...  I am not seeing this issue anymore.  Thumbnails are fine & dz doesn't freeze.

For me, this issue went away as mysteriously as it appeared.

Note: I double-checked, & my FF has been updated, and also the point release of php on my server was updated by my host, both within the last week.  The php release notes for the new version indicate multiple fixes for memory issues & also a bug fix related to image type detection in gd. 

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

davo88

Quote from: shawnb61 on May 07, 2024, 10:37:38 PM... the point release of php on my server was updated by my host
Could you tell me what release of PHP is now running please? I'd like to try it out.

shawnb61

I am currently on 8.2.18.

Looks like 8.2.19 is already suggested.
https://php.watch/versions/8.2/releases/8.2.18
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

davo88

My cPanel only lists 8.0, 8.1, 8.2, 8.3. Tried 8.2 but get this error:
Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

With 8.3, that error doesn't occur and no change with the original problem - thumbnails don't display and attachments don't attach when logged in as a member. But everything works OK when logged in as admin.

shawnb61

I would not use 8.3 - there are known issues with the session handler which was changed a bit in php 8.3.
https://github.com/SimpleMachines/SMF/issues/7793

I suggest figuring out what is wrong with your 8.1/8.2 config.  First making sure that mysqli extension is loaded, etc.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

davo88

Quote from: shawnb61 on May 08, 2024, 03:31:01 PMFirst making sure that mysqli extension is loaded, etc.

Thanks shawnb61. That was the problem. 8.2.18 now working. Updated all three browsers and tested the problem again.  But no change in the attaching result.

Firefox - 125.0.3 (64-bit)
Brave - Version 1.65.130 Chromium: 124.0.6367.159 (Official Build) (64-bit)
Chrome - Version 124.0.6367.156 (Official Build) (64-bit)

Maybe we are talking about different attaching issues?

shawnb61

#16
I'm pretty sure it was the same issue.  The behavior and original screenshots matched.  Most of the console errors matched.

(The only console error that did not match was the draft autosave one - I never saw that.)

What are the dimensions of the pictures in question?

Anything in the apache error logs?

What is your php memory limit?

ONE MORE QUESTION:  Do you have "Adaptive Thumbnail Memory" checked under attachment settings?

I can fairly easily reproduce this (~similar) if (a) I have a very low php memory limit and (b) "Adaptive Thumbnail Memory" is unchecked and (c) my image has large dimensions - 8000x6000....
You cannot view this attachment.You cannot view this attachment.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

davo88

What are the dimensions of the pictures in question? - 800 x 600
Anything in the apache error logs? - Yes
You cannot view this attachment.
What is your php memory limit? - 1024M
post_max_size - 128M
upload_max_filesize - 64M

ONE MORE QUESTION:  Do you have "Adaptive Thumbnail Memory" checked under attachment settings? - Yes

shawnb61

Ah - first thing I'd ask your host is to disable mod security.

Also, what version of gd do you have?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

davo88

The host seemed reluctant to disable Modsecurity completely. Maybe it affects all accounts on the server. Anyway, he did find one rule that was being triggered (ID 77317957) and disabled that. I then did another test and there were no errors in the Apache log this time. Just did a second test and no errors again.

Quote from: shawnb61Also, what version of gd do you have?

GD headers Version - 2.33
GD library Version - 2.33

Quote from: shawnb61I'm pretty sure it was the same issue.  The behavior and original screenshots matched.  Most of the console errors matched.

Are you testing when logged in as a regular member? It works fine here when logged in as admin. The problem only exists when logged in as a regular member.

Advertisement: