Data upload not possible | Stuck at "a few seconds"

Hello,
I use a Raspberry Pi 4 on which Nextcloud is set up as a Docker container.
An external hard drive is connected to the Raspberry Pi. The image is externally behind Nginx.

Unfortunately, I have the problem that larger files (from about 4 Mbit) are not completely uploaded, but the upload hangs at “a few seconds”.

A reinstallation has not fixed the problem yet.

This image is currently running on the PI: Docker Hub

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Setup Raspberry Pi
  2. Setup Nextcloud
  3. Upload File

I have exactly the same problem… if I upload a file, let’s say 1 GB, it gonna stuck every 64 MB for 2-3 sec. If I sync my files via the nextcloud desktop mac client, this will upload some files, long processing, uploading, long processing…

I am using Raspberry Pi 4B, Raspberry OS 64-bit, external SSD via USB 3.0 (boot + storage drive), nginx, php-fpm, php-redis, ACPu and nextcloud without docker. I tried everything but no solutions for now.

Hi everyone !

Are there any errors in Overview ?
Settings → Overview → Security & setup warnings
To do this, you must be logged in with an Admin account.

No errors, I solved everything.

Hi didi44,

yes there are 2 Error messages:

  • No default phone region is set for your installation. This is necessary to be able to check phone numbers in the profile settings without country code. To allow numbers without country code, please add “default_phone_region” with the corresponding ISO 3166-1 code of the desired region.

  • The php-imagick module lacks SVG support. For better compatibility it is recommended to install it.

Could this have something to do with the fact that I can’t upload data?

Hi !

No @Nudelsalat3000 I don’t think this is the root of the problem.

  • Have you tried uploding your files directly from your Raspberry PI ?
  • Did you use a class 10 SD card ?
  • Have you tried disabling memory caching ?

Hi,

@didi44

  • We dont have a GUI on the Pi and only access it via console and did not try to upload anything from the Pi itself.
  • Yes we currently use a class 10 SD card for the Pi.
  • No we did not try that yet. Do you know how disable memory caching?

Maybe you can try it:

  1. Go to your Nextcloud and create a share folder and allow uploding.
  2. On you RaspberryPi execute this: curl --progress-bar -k -T [file.xxx] -u "[shareID]:" -H 'X-Requested-With: XMLHttpRequest' https://[your-server-ip--or-domain]/public.php/webdav/[file.xxx] | tee /dev/null

[file.xxx] replace it by a big file, don’t forget to delete the ‘[’ ‘]’.
[shareID] is the random letters generate by nextcloud.
For example my share link is : https://www.my-server.fr/s/kMSFBe3W7L9G5gM
the shareID is kMSFBe3W7L9G5gM.

Is uploading faster ?

Depending of your configuration.

Look at your config.php file in nextcloud-config-dir/config/config.php and remove this line : 'memcache.local' => '\OC\Memcache\APCu', If you don’t see it you use a different memory caching.
This is the official documentation to help you to find it. Memory caching — Nextcloud latest Administration Manual latest documentation

If the cache is disabled, is the problem solved?

Hi @didi44,
thank you for the instructions! They were very easy to follow.

  • I tried it to upload it directly via the Pi but only got the error message:
<?xml version="1.0" encoding="utf-8"?>

<d:error xmlns:d=“DAV:” xmlns:s=“sabre/dav”>
<s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
<s:message/>
</d:error>

It seems like this did not work.

  • I also managed to delete the line you provided in the config.php

Excitedly I tried if the upload is now possible but was disappointed. The error still occurs. BUT with a change. If I wait long enough the error message ‘Unknown error’ appears in the upper right corner. Now when I reload the page the files are uploaded. Is there a way to clean this error completely since I already have to wait some time until the data is now in Nextcloud?

Hi !

Do you give the correct access? You must allow upload in the folder sharing rules.
Like that : https://ibb.co/ccBPZ5H

Hmm…Curious…

Is it possible to have you Nextcloud Logs ? /nextcloud-directory/data/nextcloud.log
Don’t forget to remove all sensitive data !

Thank you,

Hi! @didi44

  • I guess I did not allow the upload. I just tried it again and the progress bar goes up to 100% and is then just stuck. The file is did not appear to my cloud and the whole Pi crashed. I had to restart it. Tried it another time - this time my Pi did not crash but the progress bar is stuck again.
  • I would love to provide you the logs but unfortunately the data directory is empty.

So the current state of the problem:

  • small files like .txt files with just some Byte of data get transfered easily without any problem
  • slightly bigger files (about 8 Mbyte of data) get stuck with the “a few seconds” problem we discussed earlier - when I reload the site the files appear in my cloud
  • files with the size of 90 Mbyte wont get uploaded at all - they have the same error like the ‘slightly bigger files’ - if I try to upload the same file again the error “[filename] is locked”

I am currently uploading a bunch of ‘slightly bigger files’ (about 120) and it already uploaded 1,4 Gbyte of data. But I am waiting for them for like 2 hours now. It seems like one file every 5 minutes gets uploaded.

Thank you :wink:

This is not normal the data directory is the folder where all the folders and documents of each user are. I think it is in another directory.
To find it look at you config.php and you will see this line 'datadirectory' => 'YOUR-DATA-DIRECTORY', check if the nextcloud.log file is here.

I have another question, file downloads are slow but when you load Nextcloud (only the WebPage not upload) in your browser is it also slow ?

@didi44
I have cleared the log and tried to upload 2 files. One wich had around 16 Mbyte and another one with 90 Mbyte. They are now both in my cloud but it took ages and the Pi crashed after the first file.

Log:
user":"–",“app”:“PHP”,“method”:“GET”,“url”:"/cron.php",“message”:“Function libxml_disable_entity_loader() is deprecated at /var/www/html/lib/private/Updater/VersionCheck.php#98”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.36”,“version”:“22.1.1.2”,“exception”:{“Exception”:“Error”,“Message”:“Function libxml_disable_entity_loader() is deprecated at /var/www/html/lib/private/Updater/VersionCheck.php#98”,“Code”:0,“Trace”:[{“file”:"/var/www/html/lib/private/Updater/VersionCheck.php",“line”:98,“function”:“onError”,“class”:“OC\Log\ErrorHandler”,“type”:"::",“args”:[8192,“Function libxml_disable_entity_loader() is deprecated”,"/var/www/html/lib/private/Updater/VersionCheck.php",98]},{“file”:"/var/www/html/apps/updatenotification/lib/Notification/BackgroundJob.php",“line”:101,“function”:“check”,“class”:“OC\Updater\VersionCheck”,“type”:"->",“args”:},{“file”:"/var/www/html/apps/updatenotification/lib/Notification/BackgroundJob.php",“line”:86,“function”:“checkCoreUpdate”,“class”:“OCA\UpdateNotification\Notification\BackgroundJob”,“type”:"->",“args”:},{“file”:"/var/www/html/lib/private/BackgroundJob/Job.php",“line”:51,“function”:“run”,“class”:“OCA\UpdateNotification\Notification\BackgroundJob”,“type”:"->",“args”:[null]},{“file”:"/var/www/html/lib/private/BackgroundJob/TimedJob.php",“line”:58,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:"->",“args”:[{“class”:“OC\BackgroundJob\JobList”},{“class”:“OC\Log”}]},{“file”:"/var/www/html/cron.php",“line”:149,“function”:“execute”,“class”:“OC\BackgroundJob\TimedJob”,“type”:"->",“args”:[{“class”:“OC\BackgroundJob\JobList”},{“class”:“OC\Log”}]}],“File”:"/var/www/html/lib/private/Log/ErrorHandler.php",“Line”:92,“CustomMessage”:"–"}}
user":"–",“app”:“PHP”,“method”:“GET”,“url”:"/cron.php",“message”:“Function libxml_disable_entity_loader() is deprecated at /var/www/html/lib/private/Updater/VersionCheck.php#100”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/xx.x.xxxx.xx Safari/537.36”,“version”:“22.1.1.2”,“exception”:{“Exception”:“Error”,“Message”:“Function libxml_disable_entity_loader() is deprecated at /var/www/html/lib/private/Updater/VersionCheck.php#100”,“Code”:0,“Trace”:[{“file”:"/var/www/html/lib/private/Updater/VersionCheck.php",“line”:100,“function”:“onError”,“class”:“OC\Log\ErrorHandler”,“type”:"::",“args”:[8192,“Function libxml_disable_entity_loader() is deprecated”,"/var/www/html/lib/private/Updater/VersionCheck.php",100]},{“file”:"/var/www/html/apps/updatenotification/lib/Notification/BackgroundJob.php",“line”:101,“function”:“check”,“class”:“OC\Updater\VersionCheck”,“type”:"->",“args”:},{“file”:"/var/www/html/apps/updatenotification/lib/Notification/BackgroundJob.php",“line”:86,“function”:“checkCoreUpdate”,“class”:“OCA\UpdateNotification\Notification\BackgroundJob”,“type”:"->",“args”:},{“file”:"/var/www/html/lib/private/BackgroundJob/Job.php",“line”:51,“function”:“run”,“class”:“OCA\UpdateNotification\Notification\BackgroundJob”,“type”:"->",“args”:[null]},{“file”:"/var/www/html/lib/private/BackgroundJob/TimedJob.php",“line”:58,“function”:“execute”,“class”:“OC\BackgroundJob\Job”,“type”:"->",“args”:[{“class”:“OC\BackgroundJob\JobList”},{“class”:“OC\Log”}]},{“file”:"/var/www/html/cron.php",“line”:149,“function”:“execute”,“class”:“OC\BackgroundJob\TimedJob”,“type”:"->",“args”:[{“class”:“OC\BackgroundJob\JobList”},{“class”:“OC\Log”}]}],“File”:"/var/www/html/lib/private/Log/ErrorHandler.php",“Line”:92,“CustomMessage”:"–"}}

Downloads are quite fast and the WebPage in the browser is also very fast and responsive.

Hi @Nudelsalat3000 !

Thanj you, unfortunately it not useful. :slight_smile:
Sorry.

I have installed Nextcloud myself with docker and have no problems, so I don’t think the problem is there.

I’ve done some research on the web and some people have the same problem, and it looks like it could be the http2 protocol.

Is the the http2 is enable ?

This is how to check if http2 is enable:
http2 - How to check if a website has HTTP/2 protocol support - Stack Overflow (See the answer)

If it is, please can you disable it ?

Also, have you tried changing your Docker configuration (variable, configuration…)?

Thank you

Hi @didi44 !

Thanks for the huge effort!

I have checked the link you send and http2 is enabled.
Unfortunately I don’t have much knowledge about http2 at all and how to disable it. Do I have to change something on my client side or on the Pi itself?

Yes we changed the upload_max_filesize to 2G, because in the beginning the files were uploaded in small steps. The other changes were made only because of Nginx and the installation but I can not tell you every one in detail.

Thank you

Ok we wiil try to disable http2.

I not an expert in Docker so we will try to disable http2 in the browser for the moment (Firefox here).

  1. Open firefox
  2. enter about:config in the URL
  3. search http2
  4. Switch network.http.spdy.enabled.http2 to false
  5. Try to connect to your Nextcloud
  6. Check if http2 is disable with f12 → network → …

If yes, is it better ?

Hi @didi44 !
Sorry for the late reply had a busy week.
I installed firefox and disabled http2 as you told me but the problem is not solved. I checked the http2 protocol and it is still used. The upload now throws an error: File could not be loaded. Check your internet connection.

Do you have any other ideas I could try?

Hi @Nudelsalat3000 !

I’m really sorry but I’m out of ideas.

You can wait until someone is ready to help you or try to create another “Topic”.

Or if you wish install Nextcloud on your RaspberryPi without docker I can help you if you want. (I’m not an expert in Docker) :slight_smile:

I found the issue: In nginx the parameter client_body_buffer_size in the file nginx.conf was set to client_body_buffer_size 64m;. After commented it out to use default values the file uploads were smooth again.

Unfortunately, this does not solve my problem. I will now install nextcloud without docker and hope that the problem is eliminated with it