Can't upload post attachments

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Can't upload post attachments

Post by Kyudos » Fri Aug 23, 2019 12:45 am

Support Request Template
What version of phpBB are you using? phpBB 3.2.5
What is your board's URL? https://www.irricad.com/phpbb3/
Who do you host your board with? Self hosted
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board?
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? No
Do you have any extensions installed? No
What version of phpBB3 did you update from? phpBB 3.2.2
What styles do you currently have installed? Prosilver
What language(s) is your board currently using? English
Which database type/version are you using? MySQL
What is your level of experience? Comfortable with PHP and phpBB
What username can be used to view this issue? NotComfortable
What password can be used to view this issue? GivingThis
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable?
Please describe your problem.
I can't add any attachments to posts, when I try the uploader just sits there like this:
Snip.png
forever. No errors.

I'm using IIS and I've set my folder permissions correctly (IUSR ans IIS_IUSRS) for write access to the files folder etc., but it doesn't make any difference.

I'm at a loss as to what to try / test next. Any help appreciated.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66597
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Can't upload post attachments

Post by Lumpy Burgertushie » Fri Aug 23, 2019 2:19 am

curious why you are using IIs for this.
are you using windows hosting?
are you trying to host this on your windows computer?

there is probably a better way to do what you want. let us know .


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Fri Aug 23, 2019 2:25 am

Why using IIS? We're a Windows shop, no-one here knows anything about *nix systems. All our servers are Windows, why would we throw another technology in the mix unnecessarily?

User avatar
warmweer
Registered User
Posts: 2688
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Can't upload post attachments

Post by warmweer » Fri Aug 23, 2019 6:22 am

Sounds similar to viewtopic.php?f=556&t=2508036&p=15230651#p15230651.
Maybe it's another one of those temporary out of the blue hickups.
How long has his specific problem been present? Is it similar to the previous one?
My board's not broken, it just went peculiar

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Mon Aug 26, 2019 9:25 pm

As far as I know, at least 3 weeks.

User avatar
EA117
Registered User
Posts: 839
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Can't upload post attachments

Post by EA117 » Mon Aug 26, 2019 11:06 pm

Not sure why the status bar is truncated, but in absence of a failure status (yellow triangle, gray triangle) showing there, and in absence of "place inline" having appeared yet, I would have to assume "we're still waiting on a response from the server / still in the process of attempting to send more data."

What happens when you just leave the page like that, for 5+ minutes. Does it eventually show a status other than "green, but incomplete"? Just wondering if maybe a LAN trace would show that the conversation is just sitting there timing out, waiting for more data to be sent from one end or the other.

If the server-side had actually "completed, but then had a PHP execution failure while trying to process the completed file", I would still expect the HTTP 500 status to come back and cause a status triangle on the upload. Still, you might just want to check the PHP error log just in case. Since this is more of a "background AJAX failure" (where the page otherwise does still look fine) versus getting an HTTP 500 while displaying the main page (which would give you a blank/white page, if not the 500 status itself).

If you had someone there handy with a LAN trace, I would have them look at whether there are any clues as to the nature of how the conversation stops and/or times out. If you wanted someone here to try and take a look, since you were NotComfortable GivingThis, if you can create a normal user account with enough upload privileges to demonstrate the issue, sending that information by Private Message to me or someone else who offered to take a look would be fine.

Running a test upload under the F12 developer view might yield a clue, too. e.g. If there is some Javascript execution problem that occurs when the completion callback happens (which should have caused the "place inline" to show up), that might show up in the console of the F12 view.

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Mon Aug 26, 2019 11:43 pm

Thanks for the reply. It doesn't seem to matter how long I leave it, I get no response. I can click "Delete File" and that removes the box.

I can't see any errors in the browser dev console, the web server logs or the PHP error log file. I'm pretty certain it is permissions related, but I can't figure out where or what I need to set. For instance, I can see a PHP.tmp file created in the webserver's PHP temp folder - but it is always 0KB, like nothing is being uploaded. Nothing gets created in the phpBB3 'files' folder. This suggests that PHP can't create/modify files in the temp directory for the upload, and thus never gets to copying it to the phpbb3 directory.

I've set all the suggested permissions (e.g., here https://kickthatcomputer.wordpress.com/ ... -sql-2012/) but I still can't get it to work.

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Mon Aug 26, 2019 11:57 pm

I just left it for a very long time and it finally came back with a ERR_EMPTY_RESPONSE

User avatar
EA117
Registered User
Posts: 839
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Can't upload post attachments

Post by EA117 » Tue Aug 27, 2019 2:22 am

Okay, then current suggestion is still the same. Check the PHP error log. If you have someone there proficient with LAN traces, look for any additional clues in exactly how or when the HTTP connection becomes stalled and eventually times out. Or if you're willing to send test account info via PM here, either to me or someone else who offers to help, we can try and see if there are any additional clues apparent from here.

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Tue Aug 27, 2019 2:35 am

PM sent.

User avatar
EA117
Registered User
Posts: 839
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Can't upload post attachments

Post by EA117 » Tue Aug 27, 2019 6:07 am

I am able to reproduce the same symptom you showed. And the LAN trace confirms that nothing has stalled in the middle of the upload or similar. The POST operation that sends the file content has been completely sent by the client (the web browser), and the server side of the connection has sent the TCP ACK that confirms the server has received it.

But then we just sit there, waiting for the server to respond with the HTTP 200 response containing the JSON data expected in response to the plupload POST operation. But the server never responds. TCP keep-alive packets continue to be periodically exchanged, and continue to confirm that the server already received all the data of the POST operation. But there simply never is any HTTP-level response. After 600 seconds of idle connection exchanging only TCP Keep-Alive packets, the server initiates a termination of the connection.

The plupload send is attempted twice though, so a new TCP connection is created and the POST is attempted again. But exactly the same "complete POST is sent and ACK'd by the server, but then no response is received" behavior occurs, followed by the server terminating the connection again after 600 more seconds. It's after failure of this retry when you finally see the failure status shown in the web browser.

So I'm not seeing anything that looks like a communications issue; the actual application (i.e. from PHP up to phpBB code) either never received the POST, or the PHP and phpBB code crashed while attempting to create the response to the POST.

We don't suspect things like the PHP "upload_max_filesize" or "post_max_size", because those limits would have already been part of the calculation phpBB sent for the plupload "chunk_size". On your board plupload was being given a configuration that included "max_file_size: '1048576b', chunk_size: '524288b'", so we know the PHP "upload_max_filesize" and "post_max_size" are both 500KB or more. (You're welcome to check the PHPInfo display in ACP to confirm this, though.) So although "post_max_size" could have prevented the POST from reaching phpBB, that's not what's supported by the evidence.

Which leaves "did PHP or phpBB crash when trying to handle the response." Or maybe, is there a mod_security or other rule (since this is IIS and not Apache) that blocked the post even though PHP did not. (Although really, in either of those situations, we would have still expected at least a failure response from the server, rather than "no response.") But checking the web server error log and also the PHP error log (if its separate from the web server error log) are the next places to be looking, since we don't see any unusual or foul behavior out on the wire. Just a web server that never responds.

I am done with the login credentials provided, so you can remove those whenever you choose. I won't be using them any further.

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Tue Aug 27, 2019 9:02 pm

Amazing! Thanks very much for your efforts. It all points to a problem with the file system on the server, I'll just have to continue trying to debug the problem from that end.

User avatar
EA117
Registered User
Posts: 839
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Can't upload post attachments

Post by EA117 » Wed Aug 28, 2019 10:04 am

Kyudos wrote:
Tue Aug 27, 2019 9:02 pm
It all points to a problem with the file system on the server, I'll just have to continue trying to debug the problem from that end.
To me it feels like the evidence isn't exactly pointing to "the file system." All we know for sure is that the web server appears to have not made a response to the otherwise successful POST containing file upload data.

Having a PHP execution failure -- or even encountering some kind of PHP limit -- would certainly explain "not getting the response we expected". But those conditions would typically still generate some kind of response; like an HTTP 500 failure response.

But we're not even seeing a failure response in this case. Its more like "the web server never received the POST at all" (which seems unlikely, given that the LAN trace shows the TCP stack has acknowledged receipt of the POST data that was sent), or "the web server is still working on creating the response" (but after 600 seconds still hadn't been able to complete it).

Still, its worth checking your web server error log and the PHP error log (if that's not part of the web server error log) just to make sure there isn't a failure being reported which has aborted the attempt to return a response.

The idea just came to mind that possibly the web server wasn't allowing the "application/json"-type response to be returned in the file upload case; as compared to the "text/html" responses generated for most pages. But I just now tested the "Delete cookies" link on your site, and the "application/json" response involved there came through successfully.

If this issue were happening on my site, the next step would be to put some debug code in the posting.php module, in order to prove whether the uploaded file POST actually makes it that far (and the response becomes botched somewhere after that). Versus whether posting.php never gets invoked (suggesting the upload file POST was eaten or dropped somewhere before PHP or phpBB ever received it).

Because that would be the start of a "divide and conquer" approach to confirm whether you're looking for something within the web server configuration (because posting.php never even had a chance to see the file upload submission), versus whether you're looking for something within the posting.php execution itself which has failed to create a response.

Kyudos
Registered User
Posts: 42
Joined: Fri Mar 25, 2011 2:37 am

Re: Can't upload post attachments

Post by Kyudos » Mon Sep 02, 2019 11:41 pm

Progress of a sort - it seems to be a file size limit of some kind.

If I attach an image less than ~5KB, it works, anything larger it stalls.

My attachment settings say the max file size it 1MiB. PHP on the server is configured to allow 64MB.

Is there a file size limit somewhere I don't know about?

User avatar
EA117
Registered User
Posts: 839
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Can't upload post attachments

Post by EA117 » Tue Sep 03, 2019 12:57 am

Kyudos wrote:
Mon Sep 02, 2019 11:41 pm
IS there a file size limit somewhere I don't know about?
The PHP "post_max_size" setting fits that description. It's not a "file size limit", but it's a limit to the size of any POST that can be submitted; including but not limited to file uploads.

But the PHP "post_max_size" must also already be set higher than 1MB, or else we would have seen phpBB calculate a plupload "chunk_size" value which was lower than 512KB. Because phpBB is including the PHP "post_max_size" value in the calculation of "what is the smallest PHP limit we need to worry about for chunk_size?"

But you can check the PHP "post_max_size" value in the PHP Info page, and confirm it is indeed higher than 1MB.

If you happen to really be fighting something outside of the web server and PHP configuration, I suppose it's possible the Windows Server's File Server Resource Manager could have been use to set a quota on the phpBB folder? Seems a bit of a stretch, and someone really had to go out of their way to do that. But perhaps something to check for if all else is failing.

Since your assertion is that nothing appears in the web server error log and/or the PHP error log during these failed uploads, I still think my own next step would be putting some debug code in phpBB's posting.php. In order to prove whether the failed (>5KB we now believe) POSTs simply never make it as far as posting.php (which implies they're blocked at the PHP or web server level), versus whether those posts do make it into posting.php and the expected JSON response is somehow aborted or dropped internally (since the LAN trace showed no response at all, not even an HTTP status 500).

Not that knowing this immediately "solves" the issue; but it tells you in which direction to then further pursue investigation.

If you've used Microsoft's Process Monitor before, that might be an alternative way to see if an NTFS quota or other issue was in play. There would be a lot of noise to filter, but if you filtered on just the phpBB folder you could potentially see that a /files folder creation is being rejected for a particular Windows status reason; whether it's quota-related or anything else. Of course if the issue is actually at the PHP or web server level, the Process Monitor log is just going to look like "nothing is wrong", because no operation was attempted.

Post Reply

Return to “[3.2.x] Support Forum”