[Support] Linuxserver.io - Nextcloud


Recommended Posts

Situation:

Backup & restore app on phone.

Connected to Nextcloud with a webdav connection

Restore process get's stuck every time.

 

error.log file gets filled with the same error over and over again:

ERROR upstream prematurely closed FastCGI request while reading upstream, client: [ipaddress], server: _, request: "GET [filename] HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[hostname]"

 

Any ideas?

 

EDIT:

 

Seems the above error was just a symptom. Apparently you need to "tweak" Nextcloud as soon as you have more users or upload/download more data? This is what I found and did:

 

Error in /mnt/user/appdata/swag/log/nginx/error.log
	ERROR: upstream prematurely closed connection while reading upstream, client

Error in /mnt/user/appdata/nextcloud/log/php/error.log
	WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

	Added the following to /mnt/user/appdata/nextcloud/php/www2.conf

	pm = dynamic
	pm.max_children = 120

 

This resulted in the next(cloud) error. 

 

Error in /mnt/user/appdata/nextcloud/log/php/error.log
	WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 6 total children
	
	Added the following to /mnt/user/appdata/nextcloud/php/www2.conf
	
	pm = dynamic
	pm.max_children = 120
	pm.start_servers = 12
	pm.min_spare_servers = 8
	pm.max_spare_servers = 16
	pm.max_requests = 500

 

This seems to have solved the issues I had with uploading/download large amounts of data. Of course, waiting to see if an error spawned again I noticed this:

 

Error in /mnt/user/appdata/swag/log/nginx/error.log
	ERROR: FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: [ipaddress], server: _, request: "GET /admin//config.php

 

Thought it was a related error, but I got another one from a different IP with "GET /wp-login.php". Strange, because thats wordpress? Found this post claiming it's probably a bot, so unrelated. 

 

 

 

Edited by FreakyUnraid
found the fix(es)
Link to comment
On 12/12/2020 at 2:54 PM, skois said:

Today i did some further investigation.
When i uploaded a file and gave me the 504 error i open dev tools on chrome and noticed the url path. included the "dav"
So i mapped in Windows a network driver with webdav. Tried to upload 1gb file, it copied the file almost all. and it stuck at 99% (it was then uploading it to server) So after waiting for about 1 minute i got an error saying i should check my connection and try again. I though it was a random error because 1 min to upload 1gb with 20mbps is too fast. Tried again. about a minute in again. error. Tried 4gb, same time. With some math 20mbps in one minute can upload a little more than 100MB.
Then it hit me. 
Cloudflare proxy free tier have 100mb limitation on uploads (that also is a hint that webdav does not do any chunking.) 
So i set my nextcloud CNAME on cloudflare to DNS only instead of proxy. 
BOOM files start to upload correctly. Problem solved right? Nop.
There is a new limit now. I can upload with mapped webdav drive until 2gb. (2gb +1 byte failes instantly). (This needs further investigation)
So now was the time to test file uploads from WebGUI. 2GBs (exactly) uploaded succesfully!
2.1GB also succesfully! (Didn't expect that) Now trying 4GB file.

*EDIT1*

4GB returned the 504Error. I'll start looking on the reverse proxy nginx timeout configs..
*EDIT2*

Changed some timeouts to 15min on NPM and now i got "Error when assembling chunks, status code 524" instead of 504. 
ill try again with some huge time outs like 1day and see what happens.

*EDIT3*

I use NginxProxyManager, after adding my proxy host i go to /mnt/user/appdata/NginxProxyManager/nginx/proxy_host/numberoftheNChost.conf 
i copied the whole "location / " block and then i edited again the proxy host though webui (npm webui), Advanced tab.
Pasted the location /  block and added the following lines.

proxy_connect_timeout 1d;
proxy_send_timeout 1d;
proxy_read_timeout 1d;
send_timeout 1d;

Anywhere in the block doesn't matter.
After that a 5gb file upload is completed successfully. 
When i had it at 15min it didn't work, probably because the whole upload took almost an hour. 
I don't upload usually that large files through web gui but its nice to know that if i need to it will work ok.

Also there is open issue on nginxproxymanager github that someone asks to add the feature to edit the timeout from withing the gui. So we might see it there soon.

I think for now this is where my quest ends :)

*EDIT4* 

The above config helps also on the updater! No longer times out! (Just updated to NC 21 Beta1 on my test server. NC21 feels a bit faster!


 

BUT even if it succeeds it does not make ANY sense.

Cloudflare shouldn't block this upload though webgui because of the chunking. If i'm not mistaken default chunking size is 10mb.
Actually the upload was never blocked just failed assembling (but not!) If you wait a minute and refresh the page. The file is uploaded correctly and playable.
This might be a timeout setting.

 

I'll edit the last part later when file upload completes and if i have more findings

 

Did you find a way to get around the 100MB upload limit when proxying Nextcloud through Cloudflare? 

 

When I proxy Nextcloud through Cloudlfare the upload only becomes problematic when using a WebDAV connection. Uploads through the PC client and website interface all work just fine. It's like webdav doesn't use chunked uploads?

 

So I found this: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html

WebDAV address mentioned there: 

https://server/remote.php/dav/uploads/<userid>

Fails with "403 Forbidden" message

 

"normal" WebDAV address stated in Nextcloud:

https://server/remote.php/dav/files/<userid>

Fails because of connection is closed by Cloudflare because of the 100MB limit

 

 

 

 

 

 

 

Edited by FreakyUnraid
Link to comment
On 1/21/2022 at 10:53 PM, FreakyUnraid said:

 

Did you find a way to get around the 100MB upload limit when proxying Nextcloud through Cloudflare? 

 

When I proxy Nextcloud through Cloudlfare the upload only becomes problematic when using a WebDAV connection. Uploads through the PC client and website interface all work just fine. It's like webdav doesn't use chunked uploads?

 

So I found this: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html

WebDAV address mentioned there: 

https://server/remote.php/dav/uploads/<userid>

Fails with "403 Forbidden" message

 

"normal" WebDAV address stated in Nextcloud:

https://server/remote.php/dav/files/<userid>

Fails because of connection is closed by Cloudflare because of the 100MB limit

 

Are you using a reverse proxy?   I use SWAG and I had the same issue (but at a 2GB limit) until I updated nextcloud.subdomain.conf changing:


#       proxy_max_temp_file_size 2048m;   # Default
        proxy_max_temp_file_size 0; 

 

If you're using the NGINX proxy manager you may want to read this.  It mentions a similar issue that was resolved by changing the same parameter:

https://www.reddit.com/r/NextCloud/comments/li7fvh/big_files_download_problem/

 

Link to comment

I made a small mistake of moving my appdata folder from the cache drive to the array, when the nextcloud installation was running.  This made the docker freak out because it couldn't read/write to the file.  I then set the appdata config path to /mnt/user/appdata/nextcloud, and it worked, but it wouldn't let me login, and I think all my configs are gone.  When I try to login, it says that the user exists, and won't let me login.

 

I have put the appdata folder back to the cache, and changed the config path back to /mnt/cache/appdata/nextcloud, and ran the mover, however, the same problem persists.  Do I have to completely re-install nextcloud?

Link to comment
On 1/24/2022 at 4:07 PM, wsd0823 said:

Are you using a reverse proxy?   I use SWAG and I had the same issue (but at a 2GB limit) until I updated nextcloud.subdomain.conf changing:


#       proxy_max_temp_file_size 2048m;   # Default
        proxy_max_temp_file_size 0; 

 

If you're using the NGINX proxy manager you may want to read this.  It mentions a similar issue that was resolved by changing the same parameter:

https://www.reddit.com/r/NextCloud/comments/li7fvh/big_files_download_problem/

 

 

Yes, Swag with Cloudflare. I already found that solution online and tried it. No luck. Also played around with timeout settings, set chunk size to 50MB, nothing. Only Webdav was giving me issues... 

 

Webdav upload with an android app; Contacted the developer and he looked into it. He built an option to force the app to set chunksize to 50MB. And that worked! So apparently a normal webdav connection doesn't do chunking on it's own. Atleast it doesn't listen to the server, and that's why it fails with a reverse proxy with Cloudflare.

 

Nextcloud only mentions this: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html

Yeah, how am I, a simple user, suppose to use that with Webdav? Tried both adresses in Windows and they work, but keep hitting that 100MB upload limit. So no chunking it seems...

 

Perhaps similar to this: https://github.com/nextcloud/server/issues/4109 and a missing feature? Or I'm missing something.

Link to comment

I have been using Unraid and Nextcloud for a bit and had no issues until September. There was an issue with the Nextcloud desktop client and it broke around 54000 of my lifes by deleting the time stamps from them. I can access them from the UI but the desktop apps and sorting features don't work as no file has a date. Nextcloud released the following as a fix and I have no idea how I would run these commands in Unraid to fix nextcloud. I don't know how to bash etc, great at following tutorials. Does anyone have some insight how I would run these? Thank you!

 

Quote

We provide the following script to help recovery of server state due to the bug generating invalid modification date for files stored on server:

script for server side fixing of invalid dates (called solvable_files.sh)

script for server side scan of group folders (called scan_group_folders.sh)

 

To call this script follow those steps:

Copy the file in nextcloud folder on server

 

Call it with the following arguments: ./solvable_files.sh <path to storage folder without trailing /> <mysql|pgsql> <database host> <database user> <database password> <database name> <user of the webserver> <list|fix> <noscan|scan>

 

If you call it with list argument it should generate a list of the files with invalid modification date.

If you call it with fix argument it fixes all files and server database.

If you call it with scan argument it automatically triggers a scan of each modified file.

As a last step it is necessary to scan the files on the storage (unless you used the scan last argument).

sudo -u www-data php <path to nextcloud install>/occ files:scan --all

If you use group folders feature, you also need to run a specific script to also scan files in the group folders:

sudo -u www-data ./scan_group_folders.sh

 

Link to comment

Hi guys,

I have got an error by updating Nextcloud from 20.0.7 to 20.0.14 for some reason.

I checked the updater log and it says that I am stuck on the step 6.

Restarting does not work.

I tried to change in the config file Maintanance to "false" and also deleted ".step" file in the updater folder, but it does not help.

After that I need to change update secret in the config file and the process repeated with the same error.

Sometimes in the detailed response in the red field it shows "Step 6 is currently in process. Please reload this page later." I am stuck :(

Could you please advise what else can i do? I'd prefer to avoid reinstalling to secure that the user data is not deleted.

 

Thanks in advance 

 

 

 

Error.jpg

Updater log.jpg

Edited by koaly
Link to comment

Hello there, 

 

i posted it in General Support and now moved it into here.

 

Nextcloudversion: 22.2.3

PHP Version showed in Nextcloud: 7.4.26

 

i updated my Nextcloud and sadly my Onlyoffice is not working anymore. I get this Errormessage: 

Fehler beim Anschließen (cURL error 28: Failed to connect to DOMAINNAME.de port 443 after 45001 ms: Operation timed out (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://DOMAINNAME/healthcheck)✖

 

My Onlyoffice is working and accesible over the Domainname in the Browser with a Certificate - i use Nigrin Proxymanager.

 

I analysed some logfiles but cant figure out what the problem is, i just get the timeout which says no connection. 

 

Thanks for your help!

ErrorOnlyOffice.JPG

SuccessOnlyOffice.jpg

Link to comment

Hi everybody!

 

I need some support with this container but it is more a general question. My issue is that Nextcloud is keeping some of my array drives awake. I noticed that this is due to data being written in /data folder of the container which is mounted to a user share /mnt/user/nextcloud-data.

 

The cache preference of this share is set to Yes: Cache but the mover is moving all files to the array and from this point, nextcloud is mainly reading/writing from the array.. which keeps them awake.

 

A possible solution would be to change the cache to Prefer: Cache so files are staying in the cache and new writes happen when the cache is full to the array. From my little knowledge of unRAID, I have not seen the option to allow a percentage of the cache to the share.

 

I would like to achieve that kind of set up:

 

(docker) /data --> (unRAID) /mnt/user/nextcloud-data (Only: Cache)

(docker) /data/<username> --> (unRAID) /mnt/user/nextcloud-user-data (Yes: Cache)

 

So it allows Nextcloud to read/write as much as it wants and the users' files are moved when the mover is running. Feel free to point me to any other set up you might have or ideas!

 

Thanks for your help!

Link to comment
On 1/29/2022 at 3:22 PM, koaly said:

Hi guys,

I have got an error by updating Nextcloud from 20.0.7 to 20.0.14 for some reason.

I checked the updater log and it says that I am stuck on the step 6.

Restarting does not work.

I tried to change in the config file Maintanance to "false" and also deleted ".step" file in the updater folder, but it does not help.

After that I need to change update secret in the config file and the process repeated with the same error.

Sometimes in the detailed response in the red field it shows "Step 6 is currently in process. Please reload this page later." I am stuck :(

Could you please advise what else can i do? I'd prefer to avoid reinstalling to secure that the user data is not deleted.

 

Thanks in advance 

 

 

 

Error.jpg

 

 

Hi, did you solve this issue yet? Since a few days I am in the same situation.

Link to comment
On 1/29/2022 at 8:22 AM, koaly said:

Hi guys,

I have got an error by updating Nextcloud from 20.0.7 to 20.0.14 for some reason.

I checked the updater log and it says that I am stuck on the step 6.

Restarting does not work.

I tried to change in the config file Maintanance to "false" and also deleted ".step" file in the updater folder, but it does not help.

After that I need to change update secret in the config file and the process repeated with the same error.

Sometimes in the detailed response in the red field it shows "Step 6 is currently in process. Please reload this page later." I am stuck :(

Could you please advise what else can i do? I'd prefer to avoid reinstalling to secure that the user data is not deleted.

 

Thanks in advance 

 

 

 

Error.jpg

Updater log.jpg

I had this issue on my old server that had a slow cpu. It seamed like if the step took longer than expected the updater would give this error. I got around this by watching for my cpu usage to drop to idle and then clicking retry. Then it would continue. Hopefully it's that easy of a fix for you too. My understanding is updating via the command line doesn't have this issue but I never tried that.

Link to comment

Ok, so I'm probably missing something very obvious.

I'm trying to upgrade my docker installation of NextCloud.

The software via the administration/configuration web interface reports;

"Version Nextcloud 21.0.2 A new version is available: Nextcloud 21.0.7"

Unraid reports the docker is "up to date".

 

The docker does not appear to pull any new version if I add "latest" or "23.0.0" to the repository line.
I'm not sure how I can actually verify what version the docker has.

 

Pulling image: linuxserver/nextcloud:latest
IMAGE ID [1890902422]: Pulling from linuxserver/nextcloud. 
Status: Image is up to date for linuxserver/nextcloud:latest

TOTAL DATA PULLED: 0 B

Command:
root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='nextcloud' --net='eth0' --ip='x.x.x.x' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e HOST_HOSTNAME="NUC" -e HOST_CONTAINERNAME="nextcloud" -e 'TCP_PORT_443'='443' -e 'PUID'='99' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='https://[IP]:[PORT:443]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nextcloud-icon.png' -v '/mnt/user/nextcloud/':'/data':'rw' -v '/mnt/user/appdata/nextcloud':'/config':'rw' 'linuxserver/nextcloud:latest' 
804408823ce2dce0a3e1838c2c8102875d72be2a962669eb5f658a0f9f48c596

The command finished successfully!

So what am I doing wrong???

Link to comment
3 hours ago, cat2devnull said:

Ok, so I'm probably missing something very obvious.

I'm trying to upgrade my docker installation of NextCloud.

The software via the administration/configuration web interface reports;

"Version Nextcloud 21.0.2 A new version is available: Nextcloud 21.0.7"

Unraid reports the docker is "up to date".

 

The docker does not appear to pull any new version if I add "latest" or "23.0.0" to the repository line.
I'm not sure how I can actually verify what version the docker has.

 

Pulling image: linuxserver/nextcloud:latest
IMAGE ID [1890902422]: Pulling from linuxserver/nextcloud. 
Status: Image is up to date for linuxserver/nextcloud:latest

TOTAL DATA PULLED: 0 B

Command:
root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='nextcloud' --net='eth0' --ip='x.x.x.x' -e TZ="Australia/Sydney" -e HOST_OS="Unraid" -e HOST_HOSTNAME="NUC" -e HOST_CONTAINERNAME="nextcloud" -e 'TCP_PORT_443'='443' -e 'PUID'='99' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='https://[IP]:[PORT:443]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/nextcloud-icon.png' -v '/mnt/user/nextcloud/':'/data':'rw' -v '/mnt/user/appdata/nextcloud':'/config':'rw' 'linuxserver/nextcloud:latest' 
804408823ce2dce0a3e1838c2c8102875d72be2a962669eb5f658a0f9f48c596

The command finished successfully!

So what am I doing wrong???

Next cloud is updated in the app instead of updating the docker. Log into your admin account go to settings/overview. There should be an update button. You can also do it in the command line but I never figured that out.

Link to comment

Hi,

 

I am currently on 23.0.0 and for the last week or so I had the message to upgrade to 23.0.1 

 

I always dread these upgrades as they almost never run smooth. This time, although I do get the alert that an upgrade is available under the notifications, when I go to the overview section I do not have the option to upgrade. Running docker exec -it nextcloud updater.phar also reports No update available.

 

Am I missing something?

 

Thanks,

 

Lev

Link to comment

Hi guys,

 

I hope some1 will finally be able to help me. I installed Nextcloud last week using MariaDB and Nextcloud. I'm using a simple setup as I only need to use Nextcloud @ home, so I don't need to be able to access it from outside. I use it as backup for eveyone's cellphone in the household. The point is I would like to but I cannot change the amount of available space to store my pictures. I currently have 1 user (me) but the usable space is less than 8GB whille there is plenty of space on the server.

How and where do I change this amount per user?

 

Thanks... 

Edited by siamsquare
Link to comment

Hi everyone, I'm going crazy over this one.

Quote

400 Bad Request

The plain HTTP request was sent to HTTPS port

nginx

I'm running Traefik 2.6, other containers are working great, but doesn't matter what I do with NextCloud, it refuses to work via the proxy.

Accessing NextCloud locally works great.

image.thumb.png.592aa5ba085beca88c9b0a5fddadb7d7.png

 

here's my config:

image.png.1635d875e88aeec03fa1f7672e42c0fd.png

I couldn't also use Redis, getting an internal error something, but that's another story.

 

Any ideas why http->https doesn't work for me with Traefik?

Thanks!

Link to comment

Repair error: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 11 database disk image is malformed

 

Please any clue where is the DB file i need to fix / replace?

 

I'm using default SQLite i guess, probably due to Cache disk issue i get this error and cannot start Nextcloud now.

I have some backups which are automatically created (before update), so i assume i should be able to fix it somehow.

 

So i wiped "\appdata\nextcloud\www\nextcloud\*.*" and copied whole backup, but message still presist...

 

Where / What else to check?

 

thanks

Link to comment

Solution:

1. Wiped the whole docker as finded out that "DB" file is not part of backup before upgrade.

2. Install it from scratch

3. Setup MariaDB instead SQLite with was needed to add (https://techoverflow.net/2021/08/17/how-to-fix-nextcloud-4047-innodb-refuses-to-write-tables-with-row_formatcompressed-or-key_block_size/)

4. Then "rescan" of all files and putting them all to newDB via OCC command https://mangolassi.it/topic/21018/nextcloud-scan-local-files-into-db

Very helpful as it didnt went to download / upload from scratch

 

Then i wanted to try finally SWAG (internet access to Nextcloud) followed those guides:

https://knilixun.wordpress.com/nextcloud/

https://medium.com/@chrismorris_82249/setup-a-reverse-proxy-nextcloud-server-on-unraid-using-letsencrypt-831905d94f7d

, also done but i would like to set it up via ports and no clue how.

If someone could assist , would be great

 

Edited by killeriq
Link to comment
On 2/13/2022 at 5:22 PM, shpitz461 said:

Hi everyone, I'm going crazy over this one.

I'm running Traefik 2.6, other containers are working great, but doesn't matter what I do with NextCloud, it refuses to work via the proxy.

Quote

 

400 Bad Request

The plain HTTP request was sent to HTTPS port

nginx

 

Accessing NextCloud locally works great.

 

Any ideas how to fix this error going through Traefik?

Link to comment
On 2/13/2022 at 7:22 PM, siamsquare said:

Hi guys,

 

I hope some1 will finally be able to help me. I installed Nextcloud last week using MariaDB and Nextcloud. I'm using a simple setup as I only need to use Nextcloud @ home, so I don't need to be able to access it from outside. I use it as backup for eveyone's cellphone in the household. The point is I would like to but I cannot change the amount of available space to store my pictures. I currently have 1 user (me) but the usable space is less than 8GB whille there is plenty of space on the server.

How and where do I change this amount per user?

 

Thanks... 

 So I found the solution. With the first setup you create an admin account and somehow with the first install your admin account is set to unlimited storage space. I found out that when you add a second user you can set the storage space to whatever you want. So I did the same with the admin account and suddenly the limited data space was solved.

So if any1 else has issues, this is the sollution.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.