I’m trying to run the nextcloud stack on a Raspberry Pi4.
Now I’m on the initial landing page trying to set up the admin user but that fails with this error:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
This is the container log:
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 911
User gid: 911
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
.................................+++++
...................................+++++
writing new private key to '/config/keys/cert.key'
-----
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing...
[cont-init.d] 40-config: exited 0.
[cont-init.d] 50-install: executing...
[cont-init.d] 50-install: exited 0.
[cont-init.d] 60-memcache: executing...
[cont-init.d] 60-memcache: exited 0.
[cont-init.d] 70-aliases: executing...
[cont-init.d] 70-aliases: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1083): OC::init()
#2 /config/www/nextcloud/cron.php(42): require_once('/config/www/nex...')
}
To start, we dont support deploying any of our stuff with portainer. Portainer is bad, it causes problems. next, you didnt set PUID or PGID properly which is why you see 911 in the log.
i would guess you didnt set mariadb properly, but without seeing your compose (which you won’t have a trustworthy one because it’s portainer) i cant fathom what is missing. you also dont say which container log this is, you’re referring to 3 containers (some flavor of nginx, nextcloud, and mariadb) and only provide 1 docker log…
I would suggest deploying with docker compose and if you still have issues share your compose with us and the docker logs for all containers involved via pastebin. We have a great example (even though there’s a copy paste compose for every container) here
Hi, thanks for the info.
It’s a pitty that portainer is not supported any more. It delivers a nice overwiev of all running containers and management is easier without the need of a console.
I will read up how to set up the docker compose and see if I can get it running.
OK, understood.
I used the https://docs.linuxserver.io/images/docker-nextcloud instructions and set up the compose.yml like it is showed there. Of course I adapted the volume mappings but the rest seemed ok.
This is the output of docker-compose up.
The terminal I ran the command from is still busy. Edit: I learned that I have to use option -d to run in background.
I connected to the webgui and tried to setup the admin account and the MySQL/MariaDB.
That throws the stack traces at the end of the log.
Do I have to set up a DB docker also - there is no step in the instructions but my little understanding tells me that I have to…???
By the way, as this is the same error I encountered with the deployment via portainer I think I should share my findings.
I opted for the SQLite database instead of the MySQL this afternoon and then the setup continued without error. Unfortunately the port mappings were odd and I didn’t know how to change them so I decided to follow your advice and set it up the docker-compose way.
But now back to this issue…here is the output of the terminal after running the “compose up”.
At the setup screen I’m seeing the same errors as in my first post.
Is “/data” the correct path?
I ran another compose.yml with this options included. The same errors when trying to connect…
MYSQL_DATABASE=USER_DB_NAME #optional
MYSQL_USER=MYSQL_USER #optional
MYSQL_PASSWORD=DATABASE_PASSWORD #optional
i gave you a link with a full compose with all the options… i’m not sure why you didnt use it. If you aren’t going to specify user/pw/db on creation of the container, you need to go into mariadb and build it. I would suggest using the link i provided to you above.
Nextcloud shall be accessible only inside my home network.
I don’t need services exposed to the internet.
I think there is no need to make things complicated without reason.
I finally got it working.
The issue was the very last line on the screenshot above where it says “localhost:3306”.
The correct entry is the name of the database container name. In my case “nextcloud_db”.
Thanks for your support driz!