[Support] Linuxserver.io - Nextcloud


Recommended Posts

Hello,

 

I set up nextcloud on unraid, using port 444 (to avoid conflict with unraid).

 

I have a rasberry pi serving as a reverse proxy, and to maintain the let's encrypt certificates, using apache.

 

The reverse proxy works fine to allow access to the unraid server from outside, but I was unable to make it work for nextcloud. It seems nextcloud defaults to a self-signed certificate, and /mnt/user/appdata/nextcloud/nginx/site-confs/default points to it with these lines:

 

ssl_certificate /config/keys/cert.crt;

ssl_certificate_key /config/keys/cert.key;

 

How do I make it work with let's encrypt's certificates that reside on the raspberry pi? I don't mind manually copying the certs (if necessary).

 

I know solutions exists using another container installed on unraid that takes care of it all, but I prefer hosting the reverse proxy on the raspberry pi, because it is on 24/7, so updating the certs is automated, and the unraid server isn't on 24/7.

 

Thank you!

 

Karl

Link to comment

Is anyone using Nextcloud and Authelia?

 

I have Authelia setup so that when ever I access on an internal network it bypassess login, when I am away I need to login with 2FA, this all works perfectly when I use Nextloud through the webclient but I'd like to see if it's possible to bypass authelia when logging in with a mobile client or similar. For other services like Valutwarden I could configure authelia to bypass any requests coming via an API but it looks like the Nextcloud app is just a skinned version of the webinterface as everything seems to be requesting the standard URLs for access.

I know Nextcloud has the ability to have its own 2FA but for ease I would prefer to use Authelia as that has already been configured with LDAP as has Nextcloud.

 

Is what I am asking for possible?

Link to comment

I've been using Nextcloud on my Unraid server uneventfully for the last couple of years.  I recently realized it wasn't working.

 

I get the following screen message when I try to access it locally:

 

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

 

If I run the command sudo -u abc php /config/www/nextcloud/console.php file:scan --all I get the following:

 

An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 14 unable to open database file in /config/www/nextcloud/lib/private/DB/Connection.php:87
Stack trace:
#0 /config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()
#1 /config/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /config/www/nextcloud/lib/private/DB/Connection.php(236): Doctrine\DBAL\Connection->executeQuery()
#3 /config/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /config/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /config/www/nextcloud/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /config/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()
#7 /config/www/nextcloud/lib/private/AppConfig.php(300): OC\AppConfig->getApps()
#8 /config/www/nextcloud/lib/private/legacy/OC_App.php(971): OC\AppConfig->getValues()
#9 /config/www/nextcloud/lib/private/Server.php(687): OC_App::getAppVersions()
#10 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}()
#11 /config/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#13 /config/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#14 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#15 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(182): OC\AppFramework\Utility\SimpleContainer->get()
#16 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /config/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#19 /config/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#20 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#21 /config/www/nextcloud/lib/private/Server.php(1064): OC\AppFramework\Utility\SimpleContainer->get()
#22 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}()
#23 /config/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#25 /config/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#26 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#27 /config/www/nextcloud/lib/private/Server.php(2024): OC\AppFramework\Utility\SimpleContainer->get()
#28 /config/www/nextcloud/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
#29 /config/www/nextcloud/lib/private/Server.php(435): OC\Files\View->__construct()
#30 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}()
#31 /config/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#33 /config/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#34 /config/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#35 /config/www/nextcloud/lib/private/Server.php(1387): OC\AppFramework\Utility\SimpleContainer->get()
#36 /config/www/nextcloud/lib/base.php(594): OC\Server->boot()
#37 /config/www/nextcloud/lib/base.php(1089): OC::init()
#38 /config/www/nextcloud/console.php(48): require_once('/config/www/nex...')
#39 {main}root@ed996750eaf9:/# cd /config/www/nextcloud

 

Can someone point me in the direction of what I can do to fix this?  My MySQL skill is somewhat lacking.  I'm hoping it might be a simple permission error.

 

Thanks

 

Mike

Link to comment

Hi,

 

I have not been updating my next cloud container in a while and I am pretty sure that I am still on nextcloud 16.

I know I should have been updating in a while, but here we are. 

 

Now after updating the container today I was greeted by an Old friend. ;)

 

This version of Nextcloud is not compatible with > PHP 7.3.
You are currently running 7.4.26.

 

Can someone please tell me with which tag I have to reinstall the docker to get nextcloud 16 back up and running so I can start my update journey to the current release.

Link to comment
18 hours ago, Kevek79 said:

Hi,

 

I have not been updating my next cloud container in a while and I am pretty sure that I am still on nextcloud 16.

I know I should have been updating in a while, but here we are. 

 

Now after updating the container today I was greeted by an Old friend. ;)

 

This version of Nextcloud is not compatible with > PHP 7.3.
You are currently running 7.4.26.

 

Can someone please tell me with which tag I have to reinstall the docker to get nextcloud 16 back up and running so I can start my update journey to the current release.

Did some research today.

Am I right that I need to go back to a container version based on alpine 3.12 as 3.13 Alpine would include a PHP 7.4 version ?

 

Is 20.0.4-ls112 the last version based on Alpine 3.12 and if so, would that do the trick ?

Link to comment

If someone has the same issue than me:

 

After talking to the linuxserver.io team on their Discord, I used the tag 20.0.4-ls112 and my NC16 install is back up and running.

I do not know if this is related as I did not use the Collabora integration, that I set up when installing NC for the first time, in a while, but my collabora container is not starting anymore.

 

As their are some other things that I did not update in the past year or so and I do not need the office integration at the moment I will try to tackle that issue after getting my NC installation up to the current version.

 

At least I can now enter my nextcloud again and start the update journey to the current release ;)

 

Link to comment

I have Nextcloud setup, and I think it's working, however the unraid share that I have allocated to the docker container seems to be completly open for all nextcloud accounts, anything in someones nextcloud can be viewed by anyone who has access to the share?

 

Is this by design?

Link to comment

Hey everyone,

 

I noticed this morning that my Nextcloud clients were not connecting (everything was working fine yesterday). I went to the webgui and got this message

 

Your data directory is not writable

Permissions can usually be fixed by giving the webserver write access to the root directory.
See https://docs.nextcloud.com/server/23/go.php?to=admin-dir_permissions.

 

From reading around I need to run a chown command on the nextcloud data directory (/data within the docker, /mnt/user/nextcloud in unraid). I'm just unsure what the command should be.

 

Who is the user that should have write permissions? the unraid nobody user? abc user in nextcloud docker? should the command be run from unraid bash or from within the docker?

 

Thanks

Edited by SRB
typo
Link to comment
56 minutes ago, SRB said:

Hey everyone,

 

I noticed this morning that my Nextcloud clients were not connecting (everything was working fine yesterday). I went to the webgui and got this message

 

Your data directory is not writable

Permissions can usually be fixed by giving the webserver write access to the root directory.
See https://docs.nextcloud.com/server/23/go.php?to=admin-dir_permissions.

 

From reading around I need to run a chown command on the nextcloud data directory (/data within the docker, /mnt/user/nextcloud in unraid). I'm just unsure what the command should be.

 

Who is the user that should have write permissions? the unraid nobody user? abc user in nextcloud docker? should the command be run from unraid bash or from within the docker?

 

Thanks

 

Nvm... one of my cached disks had dropped out making all shares that use it unwrittable 🤦‍♂️

Link to comment

Hi Guys,

i tried updating my Nextcloud via the integrated Updater, but unfortunately I ran into several problems I was not able to solve myself. I have checked this thread, several other sources (like the Nextcloud forums) and unfortunately I get stuck at every solution I was able to find. But first things first, here's what happened:

1.) I started the web based updater: I get until step 3 then I get the following Error:

<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->

On clicking Retry Update I get:

Step 3 is currently in process. Please reload this page later.

If i delete the .step file I get back to the first problem.

2.) So I tried: 

docker exec -it nextcloud sudo -u abc php /config/www/nextcloud/updater/updater.phar

I get an error at Point 6

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[ ] Extracting ...PHP Warning:  require(/config/www/nextcloud/updater/../version.php): failed to open stream: No such file or directory in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658
PHP Fatal error:  require(): Failed opening required '/config/www/nextcloud/updater/../version.php' (include_path='.:/usr/share/php7') in phar:///config/www/nextcloud/updater/updater.phar/lib/Updater.php on line 658

I tried copying the version.php into that folder but that did not work either

3.) The occ command does not work at all at least I can't get it to work

 

SOLUTION (i found while typing this - i am leaving everything so others with the same error can find it easier)

I copied the missing file (version.php) from the nextcloud/update_somerandomstring/downloads/nextcloud/ to the  appdata/nextcloud/www/nextcloud/ folder and also the shipped.json to the /core/ subfolder. Then 

docker exec -it nextcloud sudo -u abc php /config/www/nextcloud/updater/updater.phar

works just fine...

  • Like 1
  • Upvote 1
Link to comment
On 5/4/2022 at 10:57 AM, Camnomis said:

I have Nextcloud setup, and I think it's working, however the unraid share that I have allocated to the docker container seems to be completly open for all nextcloud accounts, anything in someones nextcloud can be viewed by anyone who has access to the share?

 

Is this by design?

As far as I know, the short answer is - Yes.

Anyone who has access to the share on the unraid box has access to all that is on this share.

But from within nextcloud, users data should be seperated and their should be no access to another users files.

Link to comment

Hello all, 

somehow this container of Nextcloud seems to be extremely neutered, have made the update to Nextcloud 24 however I can not find any way to export or import my data under privacy the functions do not appear. But also installed APPS can not be called anywhere within the Nextcloud let alone is there a menu to display them e.g. the integration text!  

Is there a solution for this? 

I think you should switch to the official container supported by Unraid.

Link to comment

Does someone of you also have this error in the settings overview after updating to the latest version 24:

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
	- INVALID_HASH
		- core/js/mimetypelist.js

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [core/js/mimetypelist.js] => Array
                        (
                            [expected] => 94195a260a005dac543c3f6aa504f1b28e0078297fe94a4f52f012c16c109f0323eecc9f767d6949f860dfe454625fcaf1dc56f87bb8350975d8f006bbbdf14a
                            [current] => 1b07fb272efa65a10011ed52a6e51260343c5de2a256e1ae49f180173e2b6684ccf90d1af3c19fa97c31d42914866db46e3216883ec0d6a82cec0ad5529e78b1
                        )

                )

        )

)

 

It seems to be linked to OnlyOffice app overwriting the default mimetypelist which causes the mismatch - but I don't know how to fix it.

There are some post about this this issue on Github but none seem to fix the issue:

https://github.com/nextcloud/server/issues/30732

https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/600
 

Never had this before and to be honest I don't know if I should bother or just wait for the next update to get it fixed?

 

  • Like 1
Link to comment

Hello,

 

I keep receiving these errors when uploading my camera phone from my iphone to Nextcloud. Has anyone seen this before or knows a fix?

 

Movie Preview Generation Failed:

 

 

[core] Error: Movie preview generation failed Output: ["ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers","  built with gcc 10.3.1 (Alpine 10.3.1_git20210424) 20210424","  configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-libdav1d --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --enable-libsrt --enable-libssh --enable-libvidstab --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --enable-vulkan --enable-libsoxr --enable-libwebp --enable-libaom --disable-debug","  libavutil      56. 70.100 / 56. 70.100","  libavcodec     58.134.100 / 58.134.100","  libavformat    58. 76.100 / 58. 76.100","  libavdevice    58. 13.100 / 58. 13.100","  libavfilter     7.110.100 /  7.110.100","  libavresample   4.  0.  0 /  4.  0.  0","  libswscale      5.  9.100 /  5.  9.100","  libswresample   3.  9.100 /  3.  9.100","  libpostproc    55.  9.100 / 55.  9.100","/data/XXXX/files_trashbin/files/18-06-01 14-23-22 28E3.mp4.d1651894617: Invalid data found when processing input"]

at 2022-05-07T22:52:12+00:00

Link to comment

Hi, I have not seen anyone else show how to use mysqldump to generate database backups similar to
https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html
So this is the script I smashed together to make my backups (using User Scripts by Squid) that I run every day
Recap what is does

  • The script sets nextcloud in maintenance mode first
  • Then the backup run (note that I use the utf8mb4 setting) | I compress it a bit (this could be better) and add a timestamp to the file.
  • There is printed a successful or not statement to the terminal/log
  • Nextcloud is taken out of maintenance
  • Then I keep the 7 newest files and delete any older ones in my case keep the last 7 days. (this is due to not bloat my remote backup) It produces an error message here but it works.

The dedicated backup user have these privileges “SELECT, SHOW VIEW, TRIGGER, PROCESS, LOCK TABLES” for the db. I can’t remember where I found the overview of what was necessary. You could use the root user, just don’t, that user is too valuable.

To create a dedicated backup user
Open the mariadb terminal

mysql -uroot -p

enter your root password
run the user create command under. You need to change all {{}} content

CREATE USER '{{Dedicated Backup user}}'@'%' IDENTIFIED by '{{password}}'; GRANT SELECT, PROCESS, LOCK TABLES, TRIGGER, SHOW VIEW ON *.* TO '{{Dedicated Backup user}}'@'%';

This user have access to all DBs on your mariadb instance but can't grant privilege, delete or update content

I hope this is helpful and do you have any feedback let me know.

#!/bin/bash

#description=Run to backup db for nextcloud
#foregroundOnly=false
#backgroundOnly=false
#arrayStarted=true

#turn on maintenacemode
docker exec nextcloud occ maintenance:mode --on

#Backup and compression of db
docker exec MariaDB /usr/bin/mysqldump --single-transaction --default-character-set=utf8mb4 --user={{Dedicated Backup user}} --password={{password}} nextcloud | gzip > /mnt/user/{{full path to backup}}/nextcloudDB/nextcloud-sqlbkp_`date +"%Y%m%d"`.gz
if [ "$?" -eq 0 ]
then
    echo "Mysqldump executed successfully"
else
    echo "Mysqldump encountered a problem"
fi

#turn off maintenacemode
docker exec nextcloud occ maintenance:mode --off

#Keep the 7 newest files, delete the oldest
cd /mnt/user/{{full path to backup}}/nextcloudDB && ls -tp | grep -v '/$' | tail -n +8 | tr '\n' '\0' | xargs -0 rm --

---------------------------------------------------------------------
RESTORE
So my caching drive died, and I needed to recreate my db for nextcloud
This is the steps I used, together with this guide.
https://docs.nextcloud.com/server/latest/admin_manual/maintenance/restore.html
First use the same db creation commands as first time (note that I use the utf8mb4 setting), if you lost your full mariadb install like me you have lost the user accounts as well
write this is in the mariadb terminal

mysql -uroot -p
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'nextcloud' IDENTIFIED by 'password';
GRANT ALL PRIVILEGES ON nextcloud.* to 'nextcloud' IDENTIFIED BY 'password';


Find your latesed db backup-file and decompressed it from main terminal
 

gzip -d /path/to/file/nextcloud-sqlbkp_20220601.gz


write this command to restore from dump in mariadb terminal (but not logged into MariaDb commandline, Ctrl+c to logout)
make sure that your file is reachable from your mariadb docker container

mysql --user root --password nextcloud < /path/to/file/nextcloud-sqlbkp_20220601


you will get promted for a password. "nextcloud" above is the database name of target db. 
It will take som time to restore, and your db is back 😄
Be aware that you need a backup of your config files and data also, I do not understand it good enough to write about it here, but I had backups.

Edited by standbymeintothewild
Added create script for backup user and restore guide
Link to comment

looking at logs for Collabora lately, I see a lot of these: 

 [ websrv_poll ] WRN convert-to: Requesting address is denied:

and then it has my Public IP.. collabora works fine and so does Nextcloud. Is this anything to be concerned about or is it normal?

Collabora is latest/code with domain variable removed and Aliasgroup1 added. NC is on 23. 

 

Also, if I try to go to the collabora webui, I get error 400.. I'm using SWAG.

Edited by presence06
Link to comment

Hello All,

 

I recently started getting a new error when attempting to access my Nextcloud instance from within the LAN. The domain URL I had did work but now will not resolve. Yielding a "this page can not be reached" from Chrome. Alternatively, typing the IP:port returns a 400 error stating "the plain HTTP request was sent to HTTPS port". 

 

I had this working via a spaceinvader one video and i should also mention that I can reach the instance from outside the LAN, such as from my cell->the cell network/internet-> my server(using the URL and SWAG). Just not from within the LAN. 

 

Nextcloud and SWAG are run within docker on a docker network. Nextcloud shows the following mapping (172.18.0.3:443/TCP <-> 192.168.86.49:444) and SWAG shows the following also ( 172.18.0.2:80/TCP <-> 192.168.86.49:180 AND 172.18.0.2:443/TCP <-> 192.168.86.49:1443 )

 

Any ideas where I should be looking?

Edited by Aerodb
Link to comment

cant Update to v24.0.1 by WebUI having errors (504: Gateway time-out) on step 3 or 5  .... (Using Unraid 6.10.1 + NPM +Clouflare)

tryed to add :

 

location ~ \.php(?:$|/) {

fastcgi_read_timeout 600; fastcgi_send_timeout 600; fastcgi_connect_timeout 600; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;

}

 

but then having error of webdav  and no connection from Cloudflare in update....

 

Edited by Masterwishx
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.