Please upgrade here. These earlier versions are no longer being updated and have security issues.

Some users, sometimes, not able to upload images. [REALLY SOLVED this time.]

This discussion is related to the ImageUpload addon.
whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
edited September 2015 in Vanilla 2.0 - 2.8

Vanilla 2.1.11

I'm hosting my site on a Digital Ocean droplet, with nginx.

I just moved the site there recently.

In testing, people could upload no problem.

When I went live, some users reported not being able to upload.

I checked chwon permissions, and could upload images.

Initially I thought it was i-Stuff specific, but some users with Android have reported it.

It doesn't affect every user, and a user who could upload from i-Pad earlier today now can't, but still can from their i-Phone.

I haven't the remotest idea what could be causing this, and there doesn't seem any obvious way to reproduce it.

Anyone had this, or got any suggestions?

Tagged:

Comments

  • Perhaps it has been due to connection timeouts, and/or size of images.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    whu606
  • hgtonighthgtonight ∞ · New Moderator

    It could very well be due to the file size of the images.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    whu606
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    @peregrine

    Thanks

    Good point.

    I think I must have uploaded a clean version of the plugin, and in my original had allowed files of 2mb, so we hadn't faced the issue before.

    Thanks.

    And thanks @hgtonight

    hgtonight
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    OK, went a bit early with the SOLVED!

    It is definitely a file size limitation, but I can't seem to change it.

    I have changed the class.imageupload to

    $Sender->AddDefinition('ImageUpload_MaxFileSize', C('Plugins.UploadImage.MaxFileSize', '2.0mb'));

    my conf.php to add

    $Configuration['Garden']['Upload']['MaxFileSize'] = '3M';

    my php.ini in fpm folder to

    upload_max_filesize = 3M

    but the limit stays stubbornly at <0.5mb

    I'm not using any caching bar memcached.

    Any further suggestions?

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Disabled and re-enabled, no difference.

  • hgtonighthgtonight ∞ · New Moderator

    You also need to set the php setting "post_max_size" to allow the content be posted.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    @hgtonight

    Thanks for the reply, but it is already at:

    post_max_size = 8M

    I just can't see why the changes aren't taking.

  • hgtonighthgtonight ∞ · New Moderator

    Are you getting a nginx error on these uploads?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    @hgtonight

    I might be...

    Where would I look?

  • hgtonighthgtonight ∞ · New Moderator

    Where ever your error_log is set in your config.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
    edited September 2015

    Well, nginx error shows

    client intended to send too large body: 1619701 bytes
    

    even thought I've changed the class.imageload file to

    $Sender->AddDefinition('ImageUpload_MaxFileSize', C('Plugins.UploadImage.MaxFileSize', '5mb'));

  • peregrineperegrine MVP
    edited September 2015

    https://www.google.com/search?q=location+of+nginx+error+logs&ie=utf-8&oe=utf-8

    you also might check php error logs as well.

    $Configuration['Garden']['Errors']['LogEnabled'] = TRUE;
    $Configuration['Garden']['Errors']['LogFile'] = 'log/DebugLog';

    http://vanillaforums.org/discussion/26786/tutorial-how-to-enable-a-debug-log-and-collect-debugging-information

    you can use ini_get and ini_set to read and change things.

    to see what php shows you can use phpinfo.

    and you can also create showsize.php and run it from your browser.

    <?php
    
    echo 'post_max_size = ' . ini_get('post_max_size') . "\n";
    echo 'upload_max_filesize = ' . ini_get('upload_max_filesize') . "\n";
    

    also add to your config.

    $Configuration['Plugins']['UploadImage']['MaxFileSize'] = '3mb'

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Thanks @peregrine

    Result shows

    post_max_size = 8M upload_max_filesize = 2M

    conf is

    $Configuration['Garden']['Upload']['MaxFileSize'] = '5M';
    

    I assume there must be another setting over-riding all these, but I have no idea what or where.

  • peregrineperegrine MVP
    edited September 2015

    so the maximum size of upload with your settings is 2M.

    is that what you want?

    maybe you are not adding it to the correct php.ini file.

    use phpinfo to determine what php.ini is being read.
    double-check your php.ini as well for duplicate entries or non-commented entries.

    with apache you can also set

    php_value upload_max_filesize 8000000

    or perhaps maybe there is something in nginx that cuts it back to 2M

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    nginx defaults to 1mb for the client_max_body_size. Consider upping that as well.

    http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator
    edited September 2015

    Turns out I had to add

    http {
        #...
            client_max_body_size 3m;
        #...
    }
    

    to nginx.conf

    Thank you both for steering me in the right direction.

    hgtonightperegrine
Sign In or Register to comment.