Internal Server Error immediately after enabling External storage support

I am able to test build and install latest Nextcoud latest tag with Mariadb container and logon 1st time w/o issue using the docker-compose info below.

Everything I tried seemed to be going OK … also enabled TOTP on the admin account logged off on successfully… after enabling the External storage support I get the following error and am no longer able to do anything w the Nextcloud web interface… so I removed everything including deleting and recreated the external mapped volume … repeated the same steps and as soon as I enabled the External Storage support the same error hit completely breaking NextCloud…

Any ideas on where to poke around before I completely blow this out again?

Running on Ubuntu 22.04 5.15.0-56-generic kennel
docker-ce 5:20.10.14~3-0~ubuntu-bionic
portainer-ce v 2.15.1
docker-compose version 1.29.2

web server returns:


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.


docker-compose:
version: ‘3’
services:
db:
image: mariadb
container_name: nextcloud-mariadb
networks:
- nextcloud_network
volumes:
- maria-db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_PASSWORD=
- MYSQL_DATABASE=
- MYSQL_USER=
restart: unless-stopped
app:
image: nextcloud:apache
container_name: nextcloud-home
restart: unless-stopped
ports:
- 7700:80
- 8324:443
links:
- db
networks:
- nextcloud_network
depends_on:
- db
volumes:
- nextcloud:/var/www/html
- nextcloud-data:/var/www/html/data
- nextcloud-config:/var/www/html/config
- nextcloud-apps:/var/www/html/custom_apps
- nextcloud-themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
environment:
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=
- MYSQL_PASSWORD=
- MYSQL_DATABASE=
- MYSQL_USER=
- MYSQL_HOST=

volumes:
nextcloud:
nextcloud-data: # cifs mapped storage volume #
external: true
name: nextcloud-data
nextcloud-config:
nextcloud-apps:
nextcloud-themes:
maria-db:

networks:
nextcloud_network:
name: nextcloud_network
driver: bridge

If you are storing the data volume on a SMB/CIFS volume mounted by the OS, this is a common thing that causes problems. Don’t do that. You shouldn’t directly access the data directory anyway unless absolutely necessary.

Try the same setup again without using any externally mounted folders and see if it works.

I am trying to use NextCloud as a solution for home based on-prem replication of paid cloud storage services with the idea the data is safe, backed up and has a disaster recovery method that all doesn’t cause me to perform more and more administration to keep the “own” cloud data truly safe.

The amount of storage required to build a long term NextCloud solution would end up replicating the storage I already have on separate NAS devices now…

I read through the documentation and do not find ways to locally host/build such a system using NextCloud without building another server with locally attached disks as you recommend?

I would really like to leverage using my NAS for the needed storage so I don’t have more disks that require more backup strategies. I tried NFS mounts as well but couldn’t get this method to work at all?

Build a new server w attached storage in RAID/BTRFS when I own several Synology NAS devices already with this configuration? this is more waste of single use resources…

I don’t like to have to build more servers with direct attached storage which to me is the old way and this causes me more admin backup duties.

My Synology boxes are not strong enough to directly host NextCloud… It seems a custom RAID box w large RAM and strong CPU could do this as well but there is another investment in hardware disks CPU etc.

My goal of using NextCloud for “OWN” cloud with docker is having a pre-built environment to easily deploy and maintain. Using attached protected storage is again a goal so I don’t need to create backup strategies and maintain them for this docker install on a PC I use now use to build and test.

NextCloud is marketed to be a open source easily deployable on-prem own cloud but as I dig deeper it doesn’t seem to have the ability to work well w any sort of attached storage methods and this breaks a major IT strategy of how IT is now consumed and used IMHO.

You’re doing something pretty strange, so I wouldn’t be so quick to call it a limitation in Nextcloud. Did you try setting it up on a local mount as I suggested to see if your setup works otherwise?

Data folder on SMB is known to not work right. I’ve seen many others try it on the forum and have nothing but permission problems.

Not sure if it will work on a NFS mount. It might or might not. Make sure the whole thing is www-data:www-data and permission 750 for folders and 640 for files.

It should work on an iSCSI mount, and Synology can do that. I suggest trying that if the others don’t work.

I did move off the SMB/CIFS docker volume and the install is stable. The External storages feature is also working after I added in smbclient to the docker container. Not sure if what I did will survive a restart since I am not committing the docker the container to image with the new smbclient add.

I am looking at what iSCSI offer I can build from my Synology.

The more I read the more it looks as though NextCloud by docker is a good test build proof of concept to learn and if you want a long term solution with persistent and protected data one would them build a VM or full server.

It should stick around until the next time you pull a new image. If you need smbclient added permanently, you can set up a dockerfile to rebuild it with smbclient each time the image is updated. Instructions for that are here if you want to take a look.

I run two instances on VMware ESXi. At home Inhave an older server and use local storage and the official Docker images and a reverse proxy. And I have one for my company on a pair of new servers running the all-in-one docker version, and using Synology iSCSI for the VMFS datastore so it can fail over between the two ESXi servers. Both setups have been very stable.

Blockquote

I ran another build version of the NexCloud this time with an iSCSI drive mapping to the various parts on the same PC. Miserable failure again. I am not sure why that also fails and does work with VMWare bare metal host to an iSCSC drive you implement… Now this seems to be a docker implementation limitation on my Ubuntu Lunix PC versus NextCloud.

Blockquote

I have discovered a couple errors in my docker-compose for my new test on the iSCSI drive mount that lead to the failures in the build. I am able to logon to this NextCloud docker instance and enable features without error … I am also running Ubuntu 22.04 but Desktop install.

This feels to be the better option of using the SYNOLOGY iSCSI drive for the persistent storage I was looking for … Btrfs on the NAS will give me the higher storage growth when I need and I am able to reliably keep the data intact. Thanks for the responses to help me get on track…

Not sure… I couldn’t say without seeing it. Mine are VMDKs which is a little different situation. Maybe you can show how the iSCSI is formatted and mounted and what permissions are?

What I can tell you is both of mine are running Ubuntu Server 22.04 with Docker installed from the official Docker repo.