Nextcloud Bad Gateway

  • I've been trying to follow KM0201's instructions on a Raspberry Pi 4 running Raspbian lite with OMV on top (and nothing else) and keep running into the same problem. I run the docker script in step 1, but when I check the logs after deploying the stack I get the following error message in my nextcloud container:


    Exception: Not installed in /config/www/nextcloud/lib/base.php:282

    Stack trace:

    #0 /config/www/nextcloud/lib/base.php(663): OC::checkInstalled()

    #1 /config/www/nextcloud/lib/base.php(1104): OC::init()

    #2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')


    My docker script is attached here:

    When I go to lines 282 and 663 of /config/www/nextcloud/lib/base.php I find a function that I think is checking of whether something called 'systemConfig' is installed.



    I made sure I updated and upgraded all packages prior to install, is this something wrong with my compose script, something missing from the linuxserver image or something wrong with my machine (which I've re-installed from scratch twice with only OMV on).


    Any help would be appreciated, search engines don't seem to be finding anyone else with this problem.


  • ciaphas2037 those are no scripts but simple configuration files.


    The error just states that Nextcloud is not installed yet and I think that is expected behavior since that is what it is. What happens when you continue with step 2? Nextcloud is actually being installed in steps 2…5.

    • Offizieller Beitrag

    You didn't follow anything I wrote, so... not sure why you brought me up there


    What was the first sentence in that? Don't mix this with other tutorials... and what did you do, you mixed it with a dbtech tutorial


    First, get a proper PUID/PGID, rather than using admin's

    I suspect that error is because your paths are not right... under nextcloud. you have your config and data folders, both under "nextcloud". from previous experiences... Nextcloud puts some harsh permissions on that data folder... thus why my paths there are totally different..

    • Offizieller Beitrag

    That worked at least on my test setup lately.

    Its possible it does. I've helped several on Reddit however that was an issue, and simply adjusting those two folders fixed it.


    I think part of it is, people go "root crazy", ssh in as root and start creating directories as root, etc. And it just causes problems. Usually just recommend letting the stack/compose file create the folders.


    I haven't tested that theory in a while, but I've seen it and issue a few times.

  • KM0201 No problemo. Just remembered that I did it some days ago and had no problems :)


    ciaphas2037


    I've just checked it. As I said this is expected behavior.


    My test stack:


    Container log:


    Opening https://localhost:2444 I can see the page to install nextcloud. Installed without any problems. But as KM0201 said, you should stick to one guide and not mix them. And please use proper PUID and PGID.

    • Offizieller Beitrag

    I'll take your word for it.. I've not seen the issue in a while but I've had chats w/ several folks on reddit that that was an issue (or at the very least, changing the paths there worked... who knows what else they were doing on their system). From looking at the two folders in the past (/config and /daa) they had some fairly significant permission differences... but just to take a look, SSH'd my box and took a look at the permissions... they aren't exactly the same, but far more similar than I remember them in the past.


  • I wasn't sure what gid/uid to use, the guidance on linuxserver.io just confused me a bit (https://docs.linuxserver.io/ge…derstanding-puid-and-pgid) as it seemed to suggest that docker runs everything as root, but I didn't think the root gid/uid would be correct. Because I don't really understand how docker runs these things I just took the uid/gid of the admin account from my OMV. I've now created a user (docker1) who is in groups user, ssh, sudo and docker. I've also put everything in seperate directories. I've got nextcloud installed and working locally now, just need to get SWAG up and running for remote access.


    Thanks for the quick response, I'm very new to server-related things so guides like yours and community responses are really helpful.

    • Offizieller Beitrag

    I wasn't sure what gid/uid to use, the guidance on linuxserver.io just confused me a bit (https://docs.linuxserver.io/ge…derstanding-puid-and-pgid) as it seemed to suggest that docker runs everything as root, but I didn't think the root gid/uid would be correct. Because I don't really understand how docker runs these things I just took the uid/gid of the admin account from my OMV. I've now created a user (docker1) who is in groups user, ssh, sudo and docker. I've also put everything in seperate directories. I've got nextcloud installed and working locally now, just need to get SWAG up and running for remote access.


    Thanks for the quick response, I'm very new to server-related things so guides like yours and community responses are really helpful.

    If you have trouble I'll be in discord for a bit tonight. Link is in my sig.

    • Offizieller Beitrag

    Also, for what it's worth, I'd probably take that "docker" user out of the docker and sudo group. sudo, unless you really intend to use sudo priv's with this user, no need for it. docker.. there's a security issue there where someone of ill intent could delete your root partition if they were so inclined w/o root or sudo privileges just by being in this group.

    • Offizieller Beitrag

    You may have already figured this out, but to get your puid and pgid, ssh into your server and enter id <your-user>. You should get something like this if your user was wayne:

    wayne@m4:~$ id wayne

    uid=1000(wayne) gid=100(users)

    Or for your docker1 user enter id docker1.


    You will use the same puid and pgid in your swag yml file that you used in your nextcloud/mariadb yml file.

    • Offizieller Beitrag

    You can also get them from the webUI now... (users group 100 is default for all users created in the webUI, so that one should always work by default)


    https://github.com/openmediavault/openmediavault/issues/1068

  • Also, for what it's worth, I'd probably take that "docker" user out of the docker and sudo group. sudo, unless you really intend to use sudo priv's with this user, no need for it. docker.. there's a security issue there where someone of ill intent could delete your root partition if they were so inclined w/o root or sudo privileges just by being in this group.

    Thanks, removed the user from sudo and docker groups.

  • You forgot to remove ssh too. I do nt thing this user will be loggin in with ssh. And to be really safe you can set his login shell to disabled /bin/false.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    You forgot to remove ssh too. I do nt thing this user will be loggin in with ssh. And to be really safe you can set his login shell to disabled /bin/false.

    This is probably true for most users.. I use my regular user (don't create a special user just for docker).. so I SSH w/ that user a lot and thus need it in that group. I may rethink this at some point.

  • Hi KM0201,

    Great tuto !

    Once I deploy nextcloud stack, when I want to access nextcloud (https://my-omv-ip:450), I have the following message :

    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 webserver log.


    Could you help me ?

  • Hi HannesJo,


    Thanks for your reply.

    Here the log of Portainer :

    [s6-init] making user provided files available at /var/run/s6/etc...exited 0.

    [s6-init] ensuring user provided files have correct perms...exited 0.

    [fix-attrs.d] applying ownership & permissions fixes...

    [fix-attrs.d] done.

    [cont-init.d] executing container initialization scripts...

    [cont-init.d] 01-envfile: executing...

    [cont-init.d] 01-envfile: exited 0.

    [cont-init.d] 02-tamper-check: executing...

    [cont-init.d] 02-tamper-check: exited 0.

    [cont-init.d] 10-adduser: executing...


    -------------------------------------

    _ ()

    | | ___ _ __

    | | / __| | | / \

    | | \__ \ | | | () |

    |_| |___/ |_| \__/



    Brought to you by linuxserver.io

    -------------------------------------


    To support LSIO projects visit:

    https://www.linuxserver.io/donate/

    -------------------------------------

    GID/UID

    -------------------------------------


    User uid: 998

    User gid: 100

    -------------------------------------


    [cont-init.d] 10-adduser: exited 0.

    [cont-init.d] 30-config: executing...

    [cont-init.d] 30-config: exited 0.

    [cont-init.d] 40-initialise-db: executing...

    [cont-init.d] 40-initialise-db: 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.

    220724 13:01:24 mysqld_safe Logging to '/config/databases/4c225f6593e1.err'.

    220724 13:01:24 mysqld_safe Starting mariadbd daemon with databases from /config/databases



    and the log from /config/databases/4c225f6593e1.err :

  • Looks like it started successfully. Why do you use uid 998? Could you have a look into the config folder and then sth like logs/nginx/error.log?

    I’m not certain what the exact path is. Not at home atm. But there should be some nginx and php logs that may help.


    Also please show us your docker-compose file just to check. Just remove the passwords.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!