Video files impossible to play, download or either copy + Gallery App doesn't show any picture or video

Nextcloud version: 17.0.2
Operating system and version: Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64)
CPU: Intel® Core™ i5-6500 CPU @ 3.20GHz Intel® Core™ i5-6500 CPU @ 3.20GHz Intel® Core™ i5-6500 CPU @ 3.20GHz Intel® Core™ i5-6500 CPU @ 3.20GHz (4 4 4 4 cores)
Memory: 7.7 GB
Apache version: Apache/2.4.41 (Ubuntu)

  • conf-enabled ➔ php7.3-fpm, http2, localized-error-pages, other-vhosts-access-log, security, serve-cgi-bin, alias,
  • mods_enabled (only .conf) mpm_event, http2, ssl, actions, autoindex, deflate, dir, mime, negotiation, proxy, reqtimeout, setenvif, ``

PHP version: 7.3.13

USB-Device
Format: ExFAT
Capacity: 61,83 GB

Datatypes to be copied
Images: jpeg
Movies: m4v , mov, mp4

The issues:

  1. Some video files of type m4v, mp4 or mov can’t be watched or even downloaded from the nextcloud web-interface. The files are fine. I can put them on an USB with the help of the External storages App and watch them on my Mac.
    When I open those movies on the Nextcloud web interface I can see following using htop on my server:


    Here the web message:
    image

  2. By copying files (jpeg and m4v/mov) from the USB-drive to the Nextcloud-database the first PHP Error occurs (see below). Nextcloud stops copying. The copied folders are incomplete and each of them has a bocken file.
    Once Nextcloud even turned on 'maintenance' => true in config.php file on its own!!!
    Here a picture from the issue messages: (the message indicating that 95% capacity is used is due to the USB-Stick wich is full. My Nextcloud data_base has 2TB free storage space)


    (Yes, I am German :grin:)

  3. Due to the second Issue I then want to delete the incomplete folders on my Nextcloud.
    This also ends up in a mess:
    Nextcloud indicates, that this folder can’t be deleted because it doesn’t exists.
    By trying to delete file by file in each folder, it shows off that only one broken file in each folder is the issue. Only this file can’t be deleted and therefore also its folder.

  4. Gallery App doesn’t show any file. Nether videos nor images. The screen is blank.

Steps to replicate it for issue number 2:

  • Servers Command Line
  1. sudo mount /dev/disk/by-uuid/5DBE-1445 /automnt/usb/
  • Nextcloud Webinterface
  1. install External Storage App
  2. go to SettingsAdmin > External storages
    Type in Add storageLocal and /automnt/usb/Configuration
  3. Go to the mounted “External Storage”-folder and copy them into one of your Nextcloud folders

If you need any further informations, just tell me briefly where to find it with the Command Line. Thank you for your help!

The output of my Nextcloud log in Admin > Logging:

  1. One of the errors from copying folders containing jpeg and m4v
[PHP] Error: unlink(/tmp/oc_tmp_BYv9ZZ): No such file or directory at /var/www/nextcloud/lib/private/Preview/Movie.php#98

GET /core/preview?fileId=75832&c=e5ea60de74dc134dd50da34125649261&x=500&y=500&forceIcon=0
from 2a02:XXXX:XXXX:XXXX:XXXX:XXXX by Yannick at 2020-01-06T03:42:44+01:00
  1. Error appears when trying to delete incomplete folder on Server which should contain all files from the USB device
[webdav] Fatal: OCP\Lock\LockedException: "Photos/Photo Archive Yannick" is locked at <<closure>>

 0. /var/www/nextcloud/lib/private/Files/View.php line 790
    OC\Files\View->changeLock("/Photos/Photo Archive", 2, true)
 1. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php line 141
    OC\Files\View->rename("/Photos/Photo Archive", "/Photos/PROBLEM ORDNER")
 2. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php line 151
    OCA\DAV\Connector\Sabre\Node->setName("PROBLEM ORDNER")
 3. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 642
    Sabre\DAV\Tree->move("files/Yannick/P ... k", "files/Yannick/Photos/PROBLEM ORDNER")
 4. <<closure>>
    Sabre\DAV\CorePlugin->httpMove(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 5. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpMove"], [Sabre\HTTP\Requ ... }])
 6. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:MOVE", [Sabre\HTTP\Requ ... }])
 7. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 8. /var/www/nextcloud/apps/dav/lib/Server.php line 317
    Sabre\DAV\Server->exec()
 9. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
10. /var/www/nextcloud/remote.php line 163
    undefinedundefinedrequire_once("/var/www/nextcl ... p")

MOVE /remote.php/dav/files/Yannick/Photos/Photo%20Archive%20
from 2a02:XXX:XXXX:XXXX:XXXX:XXXX by Yannick at 2020-01-06T03:50:17+01:00

The output of my config.php file in /path/to/nextcloud:

$CONFIG = array (
  'instanceid' => 'ocvkhpupfr4s',
  'passwordsalt' => 'XXXXXXXXXXXXXX',
  'secret' => 'XXXXXXXXXXXXXXXXXXXX',
  'trusted_domains' =>
  array (
    0 => 'XXXXXXXX.com',
    1 => '192.XXXXXXXX',
    2 => '192.XXXXXXXX',
    3 => 'XXXXXXXX.com',
  ),
  'datadirectory' => '/media/nextCloud/database',
  'dbtype' => 'mysql',
  'version' => '17.0.2.1',
  'overwrite.cli.url' =>
  array (
    0 => 'http://192.XXXXXXXX/nextcloud',
    1 => 'http://XXXXXXXX.com/nextcloud',
    2 => 'http://192.XXXXXXXX',
    3 => 'http://XXXXXXXX.com',
  ),
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'bDO437YJM8W82rjTkXHK3praQ3Azjxk',
  'installed' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'XXXXXXXX',
  'mail_domain' => 'XXXXXXXX',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'XXXXXXXX',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'XXXXXXXX',
  'mail_smtppassword' => 'qognif-7poNza-nasdys',
  'maintenance' => false,
  'data-fingerprint' => '0ced89cd786dec4d08cc1ef812cfaf3a',
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'blacklisted_files' =>
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'cron_log' => true,
  'enable_previews' => true,
"/var/www/nextcloud/config/config.php" 95L, 2848C     

The last output of my Apache/system log in /var/log/apache2/access.log:

2a02:XXXX:XXXX:XXXX:XXXX:XXXX - - [06/Jan/2020:14:41:08 +0100] "GET /apps/logreader/poll?lastReqId=qS1fjBqA8CKgsahkkbx9 HTTP/2.0" 200 64 "https://XXXXXXXX.com/settings/admin/logging" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15"

systemctl status php7.3-fpm.service

● php7.3-fpm.service - The PHP 7.3 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.3-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-01-06 03:19:34 CET; 13h ago
     Docs: man:php-fpm7.3(8)
 Main PID: 1267 (php-fpm7.3)
   Status: "Processes active: 0, idle: 20, Requests: 9800, slow: 0, Traffic: 0req/sec"
    Tasks: 21 (limit: 4915)
   CGroup: /system.slice/php7.3-fpm.service
           ├─1267 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
           ├─8614 php-fpm: pool www
           ├─8615 php-fpm: pool www
           ├─8616 php-fpm: pool www
           ├─8617 php-fpm: pool www
           ├─8618 php-fpm: pool www
           ├─8654 php-fpm: pool www
           ├─8684 php-fpm: pool www
           ├─8685 php-fpm: pool www
           ├─8695 php-fpm: pool www
           ├─8696 php-fpm: pool www
           ├─8697 php-fpm: pool www
           ├─8698 php-fpm: pool www
           ├─8703 php-fpm: pool www
           ├─8704 php-fpm: pool www
           ├─8705 php-fpm: pool www
           ├─8798 php-fpm: pool www
           ├─8824 php-fpm: pool www
           ├─8825 php-fpm: pool www
           ├─8834 php-fpm: pool www
           └─8842 php-fpm: pool www

Jan 06 03:19:33 SERVER systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Jan 06 03:19:34 SERVER systemd[1]: Started The PHP 7.3 FastCGI Process Manager.

configuration of /etc/php/7.3/fpm/php-fpm.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
[global]
pid = /run/php/php7.3-fpm.pid
error_log = /var/log/php7.3-fpm.log
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 10s
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
include=/etc/php/7.3/fpm/pool.d/*.conf

Thank you for your help!

Hey,

You may try running
sudo -u www-data php occ files:scan --all
and
sudo -u www-data php occ files:cleanup

Hello,
Thanks for your help, but it didn’t help:
This is the Terminal’s result:

Is it possible that the reason for those streaming issues are only due to a low upload / download configuration?

I’ve solved the issue!
The problem was that wrong modules were enabled / disabled in apache2. In conf-enabled I switched:
mpm_eventmpm_prefork
Now I can stream every kind of video and Nextcloud Talk video-chats also work much better now. The new photos app from Nextcloud also presents all pictures without any issue.

Thanks again to this great community!