Menu

"File upload error", probably size-related but can't track it down

Help
2016-11-23
2016-11-24
  • Brian Koontz

    Brian Koontz - 2016-11-23

    So I'm running v4 under nginx and php-fpm. Everything is working: I can make entries, set up attachments, etc. But, I can't seem to attach anything over 2M in size (specifically PDF files). Anything smaller, no problem. I've tracked down just about every upload setting in nginx and php-fpm (see below). Timeouts are set to 60s; the error message appears after about 10s so I don't believe it's a timeout error. I realize this probably isn't a wikindx issue, but I'm hoping someone suggests a setting I might have overlooked.

    Current size-related settings:

    nginx.conf:
    client_max_body_size 20M;

    php.ini:
    upload_max_filesize = 20M
    post_max_size = 20M
    memory_limit = 128M
    max_execution_time = 60
    max_input_time = 60

    wikindx config.php:
    public $WIKINDX_MEMORY_LIMIT = "128M";
    public $WIKINDX_MAX_EXECUTION_TIMEOUT = "60";

     
    • Joachim

      Joachim - 2016-11-24

      I'm running both v4 and a test installation of v5 under nginx, too, and did some short tests. Sorry, couldn't reproduce your problem, I was able to attach files up to 127 MB without a glitch, nginx balked at a PDF of 140 MB, which related to the setting of client_max_body_size = 128M in the nginx.conf.

      My php.ini has
      memory_limit = 128M
      upload_max_filesize = 128M
      post_max_size = 128M
      max_execution_time = 30
      max_input_time = 60

      wikindx config.php:
      public $WIKINDX_MEMORY_LIMIT = "128M"
      public $WIKINDX_MAX_EXECUTION_TIMEOUT = FALSE

      So, sorry, no other settings I'm aware of. (But, no offense meant, you DID reload the php-fpm and nginx services after changing your settings?) Did you look at the nginx error logs for the cause of the problem?

      Joachim

       

      Last edit: Stéphane Aulery 2024-02-20
      • Brian Koontz

        Brian Koontz - 2016-11-24

        Joachim--

        Thanks for the response. I'll try bumping everything up to 128M and see what happens.

        I'll restart both nginx and php-fpm just to be sure.

        --Brian

         
  • Mark Grimshaw

    Mark Grimshaw - 2016-11-23

    Hi Brian,

    The settings look fine. Can you post your error message?

    Mark

     
  • Brian Koontz

    Brian Koontz - 2016-11-23

    "File upload error." I've traced the actual error message to line 281 in core/modules/attachments/ATTACHMENTS.php, but will have to do some more digging:

    275 // Store attachment
    276         private function storeFile()
    277         {
    278                 include_once("core/file/FILE.php");
    279                 list($filename, $hash, $type, $size) = FILE::fileUpload($thi    s->vars['fileName']);
    280                 if(!$hash)
    281                         $this->badInput->close($this->errors->text("file", "    upload"));
    
     

    Last edit: Brian Koontz 2016-11-23
  • Brian Koontz

    Brian Koontz - 2016-11-24

    Ugh...caught up by that nasty mix of systemd and init.d in Ubuntu. Turns out there's no error message if you try to stop/start php-fpm from init.d. I'll withhold my rant about systemd :)

    Thanks for the assist. Attachments work fine now.

     

    Last edit: Brian Koontz 2016-11-24

Log in to post a comment.