XF 1.5 Error Attaching Images

Wesker

Well-known member
This is an ongoing issue for which our host can not resolve. Since we migrated to our new servers, we have had a number of issues uploading files. We can temporarily fix the issue but then it comes back later.

THE FOLLOWING ERROR OCCURRED

The uploaded file is too large for the server to process. (We changed the phrase)

Updated the PHP file to this

We have set the below mentioned values for the respective directives.

========================
memory_limit = 1024M
upload_max_filesize = 1024M
post_max_size = 1024M
======================

admin.php?options/list/attachments
Maximum Attachment File Size (KB) set to 1024
Set to ImageMagick PECL Extension
This is checked Use Flash Uploader

Need assistance as we can't seem to fix the issue.
 
Host says

We have tested the upload script /images/delete/upload.php and we didn't see any issues while uploading images.

If this was the server side issue then this script wouldn't have run successfully.

We have tried whatever settings we are aware of. Also we see that you have nginx installed on the server and we are not fully aware of the configuration of the nginx as per your website requirement,

It is best to seek assistance from your website developer or seek assistance from professionals nginx administrator who can better guide you regarding these settings and configuration as per your website requirement.
 
Have you checked what happens with the test script I provided when it stops working? Does it report an error code for the same files?

None

Array
(
[upload] => Array
(
[name] => P.png
[type] => image/png
[tmp_name] => /tmp/phpgYbHpu
[error] => 0
[size] => 162351
)

)
 
I will test this over the next few days but my belief and what looks to be happening is that it maybe randomly not allowing attachments to be uploaded. In the last 10 minutes it now permits files to be uploaded but prior to that errors were displaying when trying to attach files.
 
According to this page, the error is:
UPLOAD_ERR_NO_TMP_DIR
Value: 6; Missing a temporary folder. Introduced in PHP 5.0.3.

Looking at the actual PHP source, this happens when it fails to create a temporary file in the upload_tmp_dir location (or other temp directory). So that definitely points to the issue being temp directory related.
 
CHANGES MADE
We have updated the upload_tmp_dir directory path to /tmp in PHP configuration. The attachment carries verification for the same.

However this morning the error continued always around this time until 2PM EST the error keeps coming back.
 
It's something your sysadmin or host is going to have to investigate.

Clearly something on the server is changing, which is preventing files from being written.
 
It's something your sysadmin or host is going to have to investigate.

Clearly something on the server is changing, which is preventing files from being written.

Host says

It is not the temp directory issue as what we are seeing and suggested by XF,

When ever we restarts the nginx and httpd service it starts working.

Also make sure that before setting the /tmp directory, it was working and after some point it stops and it is abnormal. There is nothing relation of the suggestion which was provided by XF team.

We are clueless of what exactly is causing this issues. Also we have already mentioned that we have tried what ever possibilities we are know too and we have tried it.

We recommend you to seek assistance from your website developer or seek assistance from professionals nginx administrator who can better guide and fix it for you regarding these settings and configuration as per your website requirement.
 
When ever we restarts the nginx and httpd service it starts working.

o make sure that before setting the /tmp directory, it was working and after some point it stops and it is abnormal.

Clearly then it's not an XF issue.

Many customers use nginx without issue - we use it for this forum.

If your host is unable to resolve it, I would suggest looking for a new host.
 
Looking at the actual PHP source, this happens when it fails to create a temporary file in the upload_tmp_dir location (or other temp directory). So that definitely points to the issue being temp directory related.
Under Linux, this can easily happen if /tmp (or whatever is the temp directory) runs out of inodes due to having too many files. This is not uncommon since most of the time the number of inodes creates is based of partition size, which doesn't work if you have a tiny tmp partition (ram or otherwise) and then stuff it full of session or temp files.

Especially on shared hosting.
 
The inodes thing did cross my mind, though I wasn't expecting it to clear itself after an Nginx restart. Pointing upload_tmp_dir at somewhere on the "main" partition may be a workaround then.
 
The inodes thing did cross my mind, though I wasn't expecting it to clear itself after an Nginx restart. Pointing upload_tmp_dir at somewhere on the "main" partition may be a workaround then.

Reply back:

The issue is not related with Inodes of the server. If the Inodes on the server would had get full then the website would had also stuck and it would stopped working. The upload_tmp_dir option is already pointed to main partition of the server.
 
Well, I know it's not an nginx issue (at least on CentOS) as I use nginx and ran 2 XF sites (and several other different scripts) with no issues.
It's going to come down to either an add-on you have in place (not real likely) or the server setup itself (most likely). By your hosts admission (if I remember correctly) they are apparently not that familiar with nginx.
There is no "special configuration" for the XenForo script required, other than the FURL requirement setup (which is easy and has to be done differently on some scripts).
Who configured nginx, the php-fpm processor and your vhost on the server?
Have they disabled selinux?
 
Back
Top Bottom