Error during WebDav Access causes Nextcloud Crash

Hope someone can help. I just don’t get. My Nextcloud keeps crashing after accessing scanning folders for changes with Kodi over WebDav.

Nextcloud version (eg, 12.0.2): NextCloudPi version v1.15.3 / Nextcloud Version: 16.0.3.0
Operating system and version (eg, Ubuntu 17.04): Raspbian GNU/Linux 10
PHP version (eg, 7.1): Version: 7.3.4

The issue you are facing:

Nextcloud stops responding when i access files via WebDav (From Kodi).
I can still access my raspberry via SSH,
but cannot access Nextcloud (neither via WebDav, nor via WebBrowser)

I have to reboot my raspberry to get Nextcloud running again.
In the logs i found the error which causes the crash, but i don’t know how to fix it.

Steps to replicate it:

  1. Connect to NC via WebDav (From Kodi)
  2. Scan Nextcloud folders for Updates within Kodi (Via WebDav)

The output of your Nextcloud log in Admin > Logging:


{"reqId":"XVSClboc80mtThSPaLiZDwAAAAc","level":3,"time":"2019-08-14T21:53:52+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"xxx","app":"PHP","method":"GET","url":"\/remote.php\/webdav\/xxxFILEPATHxxx/xxxFileNamexxx.mkv","message":"fseek() expects parameter 2 to be int, string given at \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php#177","userAgent":"Kodi\/17.6 (Linux; Android 8.1; MI PAD 4 Build\/OPM1.171019.019) Android\/8.1.0 Sys_CPU\/aarch64 App_Bitness\/64 Version\/17.6-Git:20171119-ced5097","version":"16.0.3.0"}

The output of your Apache/nginx/system log in /var/log/____:

//EDIT: No errors within system , kernel or apache logs. 

Does it come back up if you just restart the web server?

Yes, after restarting with
‘sudo /etc/init.d/apache2 restart’
and
‘sudo /etc/init.d/php7.3-fpm restart’
Nextcloud works fine.

This warning makes me wonder if your hardware isn’t up to the task. Kodi may be overloading it scraping media or something.

You should run htop or top while Kodi connects to get a better idea of what’s going on.

Already checked that. CPU & RAM looked good when Kodi was scraping.
Plus the error is also occurring when Kodi is not scraping but only trying to start a media file.
Tried it many times, and it is always this fseek() exception from Sabre in the nextcloud log right before the server crashes.

My data is stored on a USB-NTFS-drive (mounted with ntfs-3g).
Could that cause the fseek() exception?

That part I don’t know. I would say it’s a distinct possibility but one that may be irritating to troubleshoot. Was there a particular reason for using NTFS? Any chance there’s a hardware issue with the flash drive itself?

Main reason for ntfs was so i can still connect the drive to non-linux systems. I might try ext4 if nothing else helps. Bu since file access via samba and web interface work perfect i assumed ntfs is working just fine.

I re-checked all logfiles. The kernel error was a coincidence. So the only error that appears when the server is crashing is the fseek()-error in sabre/dav (DAV/CorePlugin.php#177)

Any idea how i can debug this one? And thanks a lot for your support btw.

//Edit: The error is also occuring when browsing / downloading files via WebDav from a Windows machine. So its not Kodi-related.

I can’t say I’ve tried mounting an NTFS drive and using it as Nextcloud’s data folder, but fseek has to do with file access, so it makes me wonder if that will work or not. My gut feeling is that’s asking for trouble. It may be worth trying it with ext4 just to see if that fixes it.