Hi all,
I'm gonna be mad, I still have "NextCloud - 502 Bad Gateway" on my webpage when I try to go to my NextCloud.
I use Swag also and I think this is the issue
Hi all,
I'm gonna be mad, I still have "NextCloud - 502 Bad Gateway" on my webpage when I try to go to my NextCloud.
I use Swag also and I think this is the issue
You need to give more information than that.
How are you launching Nextcloud?
Which Guide did you follow to install/launch it?
So, if I summarize.
I have Nextcloud with the port 450:443 and the Databace, MariaDB: 3306:3306.
I have swag with the port 10443:443, SUBDOMAINS=wildcard, VALIDATION=duckdns and URL=xxx.duckdns.org.
All these port are published.
In my box, I set a NAP : Swag 10443:443. (the onlyone)
In Swag config, I have nextcloud.subdomain.org. I don't touch anything more.
In Nextcloud conig, i set
QuoteDisplay More'trusted_domains' =>
array (
0 => 'nextcloud.xxx.duckdns.org'
1 => '192.168.1.90:450'
),
'trusted_proxies' =>
array (
0 => 'swag',
),
'overwrite.cli.url' => 'https://nextcloud.xxx.duckdns.org',
'overwritehost' => 'nextcloud.duckdns.org',
'overwriteprotocol' => 'https',
...
'dbhost' => '192.168.1.90',
'dbport' => '3306',
What' going wrong?
Display MoreSo, if I summarize.
I have Nextcloud with the port 450:443 and the Databace, MariaDB: 3306:3306.
I have swag with the port 10443:443, SUBDOMAINS=wildcard, VALIDATION=duckdns and URL=xxx.duckdns.org.
All these port are published.
In my box, I set a NAP : Swag 10443:443.
In Swag config, I have nextcloud.subdomain.org. I don't touch anything more.
In Nextcloud conig, i set
What' going wrong?
well first...
If you go to https://www.your-domain.duckdns.org
do you get the swag page secured with a padlock?
Exactly, my connection is secure.
My container Swag, Nextcloud, Nextclouddb looks working well in the logs..
Edit:
For Nextcloud : I have this : PHP Fatal error: Uncaught Error: Call to a member function getLogger() on null in /config/www/nextcloud/cron.php:192
Exactly, my connection is secure.
My container Swag, Nextcloud, Nextclouddb looks working well in the logs..
Edit:
For Nextcloud : I have this : PHP Fatal error: Uncaught Error: Call to a member function getLogger() on null in /config/www/nextcloud/cron.php:192
OK, so it's not swag, it's working.
I've not seen that error... I'll try to look more into it a little bit, but a quick Google searched turned up this...
Which Guide did you follow to install/launch it?
Still didn't answered this.
Post your YML but hide sensible DATA (password, email, domain) inside a codebox.
And, on config.php, your overwrite host is wrong.
The correct syntax is:
I tried several things but that's not clear it's not fixed yet..
I install all php7.4 applications.
I try: in /etc/php/7.4/fpm#, then nano php.ini and add apc.enable_cli=1.
When I try This:
Quotesudo -u www-data php7.4 -f /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/config/www/nextcloud/cron.php
It says:
QuoteCannot write into "config" directory!
This can usually be fixed by giving the web server write access to the config directory.
But, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
I don't have ea-php7.4 for this commande: /usr/local/bin/ea-php74 for This
Do you have an idea or how can I resolve that?
Still didn't answered this.
Sorry it's a bit complicated because I follow multiple tutorial. we can that one one, but without command line and for subdomain using a French Youtuber.
Post your YML but hide sensible DATA (password, email, domain) inside a codebox.
Of Nextcloud?
QuoteDisplay Moreversion: "2"
services:
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
network_mode: swag_default
environment:
- PUID=1000 #change PUID if needed
- PGID=100 #change PGID if needed
- TZ=Europe/Paris #change Time Zone if needed
#- NEXTCLOUD_TRUSTED_DOMAINS=192.168.1.90
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/config:/config
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/data:/data
depends_on:
- mariadb
ports:
- 450:443
restart: unless-stopped
mariadb:
image: lscr.io/linuxserver/mariadb:latest
container_name: nextclouddb
network_mode: swag_default
environment:
- PUID=1000 #change PUID if needed
- PGID=100 #change PGID if needed
- MYSQL_ROOT_PASSWORD=SOMETHING_CLEVER #change password
- TZ=Europe/Paris #Change Time Zone if needed
ports:
- 3306:3306
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextclouddb:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted
restart: unless-stopped
Thanks for my conif.php!
Sorry it's a bit complicated because I follow multiple tutorial
And this is what is the problem.
Mixing things won't help in any way.
When I try This:
You're using Linuxserver image and the user www-data doesn't exist in it.
The user Linuxserver uses in their images/containers is abc.
I install all php7.4 applications.
I try: in /etc/php/7.4/fpm#, then nano php.ini and add apc.enable_cli=1.
Stop messing more things.
You don't have to installing nothing or edit php.ini.
The latest Linuxserver image doesn't even run on php7.4 anymore. It runs on php8.
With all the mess you have in there, better to clean up the system and start fresh.
And if you do start fresh, use a different password for the MYSQL_ROOT_PASSWORD.
Now, every reader knows it.
And if you do start fresh, use a different password for the MYSQL_ROOT_PASSWORD.
Now, every reader knows it.
LOL... Well as long as me and you keep it a secret
The latest Linuxserver image doesn't even run on php7.4 anymore. It runs on php8.
That was one of my question, php is now 8.2 but I didn't find it in my configuration, only 7.4. Is it normal or because it's the most stable version?
I can start a configuration, it's not the first time. How can I clean up? Just for Nextcloud? Remove the Stack, images, folder in appdata?
LOL... Well as long as me and you keep it a secret
And i read twice.. I'm not fully awake this morning!
And i read twice.. I'm not fully awake this morning!
That's an advantage of being on the zombie shift.. ![]()
I post half asleep around Noon-1pm
That was one of my question, php is now 8.2 but I didn't find it in my configuration, only 7.4.
PHP 7.4 is used on the host by OMV.
PHP 8 exists inside the container.
They're 2 distinct things.
How can I clean up? Just for Nextcloud? Remove the Stack, images, folder in appdata?
If you don't have any data there, yes.
After that is done, post the YML you used for SWAG, hiding sensible data and we'll continue.
Ok, so I didn't have any Nexcloud or Nexclouddb in Docker or Appdata.
My Swag stack, I iwll use the linux server image:
QuoteDisplay More---
version: "2.1"
services:
swag:
image: lscr.io/linuxserver/swag:latest
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
- URL=xxx.duckdns.org
- VALIDATION=duckdns
- SUBDOMAINS=wildcard
- DUCKDNSTOKEN=xxx
#- CERTPROVIDER= #optional
#- DNSPLUGIN=cloudflare #optional
#- PROPAGATION= #optional
- EMAIL=xxx@gmail.com
#- ONLY_SUBDOMAINS=false #optional
#- EXTRA_DOMAINS= #optional
#- STAGING=false #optional
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/swag:/config
ports:
- 10443:443
#- 10080:80
restart: unless-stopped
#authelia:
#image: docker.io/authelia/authelia:latest
#container_name: authelia
#user: "1000:1000"
#environment:
#- TZ=Europe/Paris
#volumes:
#- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/authelia:/config
#restart: unless-stopped
First make sure that the old folders are non-existant:
ls -al /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/
Make sure that the user ID 1000 is the one you want to own Nextcloud (I recall reading you used docker1 but don't see it anymore
id 1000
id docker1 # If you followed macom guide, you probably made this user but it doesn't mean it's user 1000.
Now copy/paste the code below and use it to deploy the STACK the way you feel better (with Portainer or docker-compose YML or with the openmediavault-compose)
Just don't forget to change the PASSWORD to something else
version: "2"
services:
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
network_mode: swag_default
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/config:/config
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/data:/data
depends_on:
- mariadb
ports:
- 450:443
restart: unless-stopped
mariadb:
image: lscr.io/linuxserver/mariadb:latest
container_name: nextclouddb
network_mode: swag_default
environment:
- PUID=1000
- PGID=100
- MYSQL_ROOT_PASSWORD=SOMETHING_CLEVER #change password
- TZ=Europe/Paris
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextclouddb:/config
restart: unless-stopped
Display More
After deployed, open a browser with https://IP_of_OMV:450 (accept the warning for insecure connection) and do the initial configuration of Nextcloud but take care of the DATA you enter on the screen:
On the "Create an admin account" section, write a name for the USER && PASSWORD that will be the ADMIN of Nextcloud (this USER has nothing to do with USERS on OMV. See it as a independent system):
Leave the "Data Folder" as it is:
On the "Configure the database" section, Select "MySQL/MariaDB" and write the fields with the info from the YML:
Database USER == root
Database PASS == <The password that you set on MYSQL_ROOT_PASSWORD>
Database name == nextcloud
Database host == nextclouddb # Instead of localhost
Click "Finish Setup"
After that, and it is installed, we'll go fo the rest.
First make sure that the old folders are non-existant:
ls -al /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/
I re-organize my other stack, and I use the admin account instead of auser one (which was in group root/admin/user, I will let it only user). So I got that;
drwxr-xr-x 5 root root 49 Feb 10 12:47 .
drwxr-xr-x 7 root root 116 Feb 7 23:50 ..
drwxr-xr-x 2 admin users 22 Feb 10 12:47 duckdns
drwxr-xr-x 7 admin users 111 Feb 10 12:44 heimdall
drwxr-xr-x 11 admin users 4096 Feb 3 02:34 swag
I add the stack, just modify my password and change PUID.
i get an issue here,
On the "Configure the database" section, Select "MySQL/MariaDB" and write the fields with the info from the YML:
Database USER == root
Database PASS == <The password that you set on MYSQL_ROOT_PASSWORD>
Database name == nextcloud
Database host == nextclouddb # Instead of localhost
I get that in NextCloud:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'nextcloud.swag_default' (using password: YES)
Is root the issue? And ir should be admin? Or my network swag_default? Because all my container are in Swag_default?
and I use the admin account instead of auser one
Using HOST "admin" (id 998) is nonsense, in every aspects.
Docker is meant to run with unpriviledge users.
That is why a user with id => 1000 is the correct approach.
i get an issue here,
Since I don't use SWAG outside of the Nextcloud YML, this issue never happens.
To fix it momentary and to simplify for now, bring down the STACK, delete the folders and edit the STACK, like this:
version: "2"
services:
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
# network_mode: swag_default
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/config:/config
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/data:/data
depends_on:
- mariadb
ports:
- 450:443
restart: unless-stopped
mariadb:
image: lscr.io/linuxserver/mariadb:latest
container_name: nextclouddb
# network_mode: swag_default
environment:
- PUID=1000
- PGID=100
- MYSQL_ROOT_PASSWORD=SOMETHING_CLEVER #change password
- TZ=Europe/Paris
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextclouddb:/config
restart: unless-stopped
Display More
Redeploy the stack.
Ok, I update the stacks, they are now with PUID 1000.
drwxr-xr-x 7 root root 109 Feb 10 13:45 .
drwxr-xr-x 7 root root 116 Feb 7 23:50 ..
drwxr-xr-x 2 xxx users 22 Feb 10 12:47 duckdns
drwxr-xr-x 7 xxx users 111 Feb 10 12:44 heimdall
drwxr-xr-x 4 root root 32 Feb 10 13:45 nextcloud
drwxr-xr-x 4 xxx users 68 Feb 10 13:45 nextclouddb
drwxr-xr-x 11 xxx users 4096 Feb 3 02:34 swag
Still the same issue, it seems that not the network mais the account?
Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'nextcloud.nextcloud_default' (using password: YES)
Do I need to setup with the stacks with this?
- MYSQL_DATABASE=USER_DB_NAME #optional
- MYSQL_USER=MYSQL_USER #optional
- MYSQL_PASSWORD=DATABASE_PASSWORD #optional
or, do I already have an old database?
You need to start posting the outputs inside CODEBOX, and not on Quote, please.
Changing the owner of a STACK on an existing deployment won't change the existing folders.
They have to be deleted, and when the container is recreated, they will be made with the proper ownership.
So, first, post the output of the EDITED STACK (only hide the PASSW).
Then, the output of:
ls -al /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextclouddb
ls -al /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud
Ok, I delete Nextcloud* folder and images and recreate the stack.
version: "2"
services:
nextcloud:
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
#network_mode: swag_default
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Paris
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/config:/config
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextcloud/data:/data
depends_on:
- mariadb
ports:
- 450:443
restart: unless-stopped
mariadb:
image: lscr.io/linuxserver/mariadb:latest
container_name: nextclouddb
#network_mode: swag_default
environment:
- PUID=1000
- PGID=100
- MYSQL_ROOT_PASSWORD=***
- TZ=Europe/Paris
volumes:
- /srv/dev-disk-by-uuid-f676f90c-93f5-4fdb-888e-b29ffea004f8/appdata/nextclouddb:/config
restart: unless-stopped
Display More
for Nextcloud:
drwxr-xr-x 4 root root 32 Feb 10 14:26 .
drwxr-xr-x 7 root root 109 Feb 10 14:26 ..
drwxr-xr-x 8 xxx users 131 Feb 10 14:26 config
drwxr-xr-x 2 xxx users 35 Feb 10 14:27 data
For Nextclouddb
Don’t have an account yet? Register yourself now and be a part of our community!