Uploading images keeps freezing randomly

Hello, dear Nextcloud community!

This is my first post here, so be gentle, senpais. :smiley:

Yesterday, I built a small server for my home out of old spare parts I had laying around.

I went ahead, set up and configured Nextcloud (15.0.2), following the documentation and Arch Wiki as reference.

The Problem

Everything seems to be working fine and speedy, except that I’m unable to upload picture files reliably. Sometimes, it works, sometimes not. Most of the time not, espacially when uploading entire folders of pictures.

When uploading, the progress bar appears, indicating the estimated upload time. At first, it uploads just fine, but then it just gets stuck, displaying “x minutes left” (or similar), not uploading any further.

On the other hand: Uploading regular / non-media files seems to work, even in bulk.

I searched the forums and the bugtracker and found several similar entries, but no solution. Anyone got a clue what I should try next?

I cleared the log file and checked if some error pops up when trying to upload. Nothing. Also nothing suspicious in the webserver logs. I also tried disabling all apps, checked the permissions, removed some fstab mount parameters in case something cases trouble, etc.

Overview

  • Operating System: Arch Linux
  • Webserver: NGINX (1.15.8)
  • PHP backend: PHP-FPM (7.3.1)
  • Database: MariaDB (10.3.12)
  • Caching: Redis (5.0.3) and APCu (5.1.16)
  • Data directory moved to a different location
  • All file and directory permissions set and checked
  • Followed the procedures as suggested in the admin backend to increase performance and security

All packages were installed by pacman (or from AUR in case of some PHP modules like imagick).

Enabled Apps

  • Activity (2.8.2)
  • Deleted files (1.5.0)
  • File Sharing (1.7.0)
  • Files Right Click (0.10.2)
  • Gallery (18.2.0)
  • Impersonate (1.2.0)
  • Log Reader (2.0.0)
  • Monitoring (1.5.0)
  • Notifications (2.3.0)
  • Passman (2.2.1)
  • Password policy (1.5.0)
  • PDF viewer (1.4.0)
  • Preview Generator (2.0.0)
  • Share by mail (1.5.0)
  • ShareRenamer (2.3.0)
  • Social sharing via email (1.0.5)
  • Social sharing via Facebook (1.0.4)
  • Socal sharing via Twitter (1.0.4)
  • Text Editor (2.7.0)
  • Theming (1.6.0)
  • TwoFactor via nextcloud notification (1.0.2)
  • Video player (1.4.0)

config.php

<?php
$CONFIG = array (
  'instanceid' => 'removed',
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' => 
  array (
    0 => 'removed',
    1 => 'removed', //for LAN access
  ),
  'datadirectory' => '/mnt/data_1/nextcloud/data',
  'filesystem_check_changes' => 0,
  'dbtype' => 'mysql',
  'version' => '15.0.2.0',
  'overwrite.cli.url' => 'removed',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud_nextcloud',
  'dbhost' => '127.0.0.1',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'removed',
  'installed' => true,
  'memcache.local' => '\OC\Memcache\APCu',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis.sock',
    'port' => 0,
  ),
  'mysql.utf8mb4' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'removed',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'removed',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'removed',
  'mail_smtppassword' => 'removed',
  'mail_smtpauthtype' => 'PLAIN',
  'maintenance' => false,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
    0 => 'Keine 2FA',
  ),
);

NGINX VHost configuration

upstream php-handler {
    server unix:/run/php-fpm/php-fpm.sock;
}


server {
    listen 80;
    listen [::]:80;
    server_name removed;

    return 301 https://$server_name$request_uri;
}


server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name removed;

    ssl_certificate /etc/letsencrypt/live/removed/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/removed/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/removed/chain.pem;

    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;
    add_header Referrer-Policy no-referrer;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

    fastcgi_hide_header X-Powered-By;

    root /usr/share/webapps/nextcloud/;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location = /.well-known/carddav {
        return 301 $scheme://$host/remote.php/dav;
    }

    location = /.well-known/caldav {
        return 301 $scheme://$host/remote.php/dav;
    }

    client_max_body_size 3G;
    fastcgi_buffers 64 4K;

    gzip on;
    gzip_vary on;
    gzip_comp_level 4;
    gzip_min_length 256;
    gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
    gzip_types application/atom+xml application/javascript application/json application/ld+json applicat$

    location / {
        rewrite ^ /index.php$request_uri;
    }

    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
        deny all;
    }

    location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provi$
        fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }

    location ~ ^\/(?:updater|ocs-provider)(?:$|\/) {
        try_files $uri/ =404;
        index index.php;
    }

    location ~ \.(?:css|js|woff2?|svg|gif)$ {
        try_files $uri /index.php$request_uri;
        add_header Cache-Control "public, max-age=15778463";

        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header X-Download-Options noopen;
        add_header X-Permitted-Cross-Domain-Policies none;
        add_header Referrer-Policy no-referrer;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

        access_log off;
    }

    location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
        try_files $uri /index.php$request_uri;

        access_log off;
    }

    location = /data/htaccesstest.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
}

I’m looking forward for your answers!